Skip to content

Comments

feat: allow easy deletion of favorites#2792

Merged
hayescode merged 1 commit intoChainlit:mainfrom
eiseleMichael:feat/improve-favorites
Feb 24, 2026
Merged

feat: allow easy deletion of favorites#2792
hayescode merged 1 commit intoChainlit:mainfrom
eiseleMichael:feat/improve-favorites

Conversation

@eiseleMichael
Copy link
Contributor

@eiseleMichael eiseleMichael commented Feb 19, 2026

closes #2753

  • adds an icon button to un-favorite a message without having to go back to the original message
  • move set_step_favorite to base datalayer, so it can easily be overwritten for users that want to store them separately
Bildschirmfoto 2026-02-19 um 16 21 35

Summary by cubic

Let users remove a favorite directly from the Favorites picker, with instant UI updates and a data-layer flow to persist the change.

  • New Features

    • Trash button in the Favorites list to unfavorite in place.
    • Optimistic toggling updates messages and favorites immediately via react-client.
    • Added “Remove favorite” translation key across locales.
  • Refactors

    • Added a default set_step_favorite to the base data layer, still overridable.
    • Socket handler uses the data layer, resolves the step for favorite/unfavorite, normalizes timestamps, emits updates, and refreshes favorites.

Written for commit fe132b4. Summary will update 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 Feb 19, 2026
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.

2 issues found across 25 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/chainlit/data/base.py">

<violation number="1" location="backend/chainlit/data/base.py:117">
P2: set_step_favorite signature is missing the user_id parameter that callers pass, causing a runtime TypeError for data layers that rely on the base implementation and blocking per-user favorites overrides.</violation>
</file>

<file name="backend/chainlit/socket.py">

<violation number="1" location="backend/chainlit/socket.py:355">
P2: Unverified client payload can be persisted as a favorite when no matching server-side step is found, allowing arbitrary message data to be injected into stored favorites.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@hayescode hayescode added this pull request to the merge queue Feb 24, 2026
Merged via the queue into Chainlit:main with commit 0b3ebea Feb 24, 2026
9 checks passed
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.

Delete Favorite Messages (Prompt Templates)

2 participants