Skip to content

Conversation

@eiseleMichael
Copy link
Contributor

@eiseleMichael eiseleMichael commented Dec 22, 2025

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.

  • Translations are added
  • All datalayer implementations are adjusted
  • Config to enable/disable this feature is added (default false)
image

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.

Written for commit f8cf94f. Summary will update automatically on new commits.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. data layer Pertains to data layers. frontend Pertains to the frontend. labels Dec 22, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(&quot;THREAD#&quot;)` removes any character from the set {&#39;T&#39;,&#39;H&#39;,&#39;R&#39;,&#39;E&#39;,&#39;A&#39;,&#39;D&#39;,&#39;#&#39;} 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(&quot;THREAD#&quot;)` 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data layer Pertains to data layers. frontend Pertains to the frontend. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant