Add assistant message starring and fix Svelte state handling#25
Merged
0xGingi merged 1 commit intonanogpt-community:mainfrom Jan 1, 2026
jcrabapple:analytics-speed-metrics
Merged
Add assistant message starring and fix Svelte state handling#250xGingi merged 1 commit intonanogpt-community:mainfrom jcrabapple:analytics-speed-metrics
0xGingi merged 1 commit intonanogpt-community:mainfrom
jcrabapple:analytics-speed-metrics
Conversation
- Add star/unstar toggle for assistant messages with optimistic UI and server sync - Track starred state via reactive effect instead of capturing initial message value to satisfy Svelte state rules Co-Authored-By: Warp <agent@warp.dev>
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.
Summary
This PR adds support for starring assistant messages in the chat view and fixes a Svelte state-handling issue related to
message.starredinsrc/routes/chat/[id]/message.svelte.Changes
src/routes/chat/[id]/message.svelte.isStarredusing$stateplus a$effectthat reacts tomessage.starredinstead of capturing the initialmessagevalue in the state initializer.api.messages.setStarredwith optimistic UI updates and rollback on failure.api.messages.getAllFromConversationafter a successful update so other consumers stay in sync.Rationale
Previously, the starred state logic referenced
messagedirectly inside the$stateinitializer, which caused Svelte to warn that the reference only captures the initial value. This PR moves that logic into a$effect, ensuring thatisStarredalways reflects the latestmessage.starredvalue.The new star toggle provides a quick way for users to flag assistant messages as important, while keeping the UI responsive and consistent with server state.
Testing
bun --bun run dev.messageare emitted at build/runtime.Co-Authored-By: Warp agent@warp.dev