Save Favorite Messages (Prompt Templates)#2736
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
3 issues found across 36 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="backend/chainlit/socket.py">
<violation number="1" location="backend/chainlit/socket.py:326">
P2: The `# pyright: ignore [reportOptionalCall]` comment is misplaced. To be consistent with other handlers in this file and to actually suppress the warning on the `sio.on` call, the comment should be on the decorator line, not the function definition.</violation>
</file>
<file name="backend/chainlit/data/sql_alchemy.py">
<violation number="1" location="backend/chainlit/data/sql_alchemy.py:841">
P2: Inconsistent `showInput` handling compared to `get_all_user_threads`. This could expose input data that should be hidden. Apply the same conditional logic used elsewhere in this file.</violation>
</file>
<file name="backend/chainlit/data/dynamodb.py">
<violation number="1" location="backend/chainlit/data/dynamodb.py:632">
P2: `strip("THREAD#")` removes any character from the set {'T','H','R','E','A','D','#'} from both ends, not the prefix substring. If a thread ID happens to end with any of these characters, it would be incorrectly truncated. Use `removeprefix("THREAD#")` instead for correct prefix removal.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
7608011 to
d3595c6
Compare
|
This PR is stale because it has been open for 14 days with no activity. |
hayescode
approved these changes
Jan 7, 2026
tonca
pushed a commit
to tonca/chainlit
that referenced
this pull request
Mar 24, 2026
This adds a way to mark a user message as favorite. When a user has at least 1 favorite message and favorites are enabled in the config (default is False) then a new star icon allows to select favorite messages that are used as prompt templates. The Step.metadata is used to store this information. - [x] Translations are added - [x] All datalayer implementations are adjusted - [x] Config to enable/disable this feature is added (default false) <img width="427" height="951" alt="image" src="https://github.com/user-attachments/assets/2f1af869-3878-47c7-9383-21223f965690" /> <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Add “Favorite Messages” so users can star messages and reuse them as prompt templates from the composer. The feature is behind a config flag and works across supported data layers. - **New Features** - Config: features.favorites flag (default false). - Backend: store favorites in Step.metadata.favorite; new socket events message_favorite and fetch_favorites; emitter sends set_favorites. - Data layer support: get_favorite_steps for SQLAlchemy, Chainlit DB, and DynamoDB; LiteralAI returns empty. - Frontend: star toggle on user messages; new FavoriteButton in the composer to insert a favorite; client state and translations added; unit tests for the button. - **Bug Fixes** - Frontend: tooltip on FavoriteButton now closes after selecting a favorite. <sup>Written for commit f8cf94f. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a way to mark a user message as favorite. When a user has at least 1 favorite message and favorites are enabled in the config (default is False) then a new star icon allows to select favorite messages that are used as prompt templates.
The Step.metadata is used to store this information.
Summary by cubic
Add “Favorite Messages” so users can star messages and reuse them as prompt templates from the composer. The feature is behind a config flag and works across supported data layers.
New Features
Bug Fixes
Written for commit f8cf94f. Summary will update automatically on new commits.