Add live comment updates to FW Lite - #2661
Open
hahn-kev-bot wants to merge 3 commits into
Open
hahn-kev-bot wants to merge 3 commits into
hahn-kev-bot wants to merge 3 commits into
Conversation
Comments already sync via the same CRDT path as entries, but nothing told the frontend when they changed. Add a coarse, project-scoped CommentsChangedEvent mirroring EntriesChangedEvent: - Sync producer: SyncService detects comment/thread changes in the pulled commits and publishes after applying read status. - Local producer: MiniLcmApiNotifyWrapper publishes on comment writes and on read-status changes (mark read/unread), so unread counts stay correct even when no comment data changed. - Consumers: the comment panel refetches while open, the unread badge re-queries its count, the per-entry unread indicator refreshes, and the entry list re-queries only when the unread-comments filter is on. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Track thread/comment ids known at first load in CommentDialog; ids that appear afterward (via sync or a local post) are briefly flagged as arrivals. That flag drives a slide-in plus a short background tint on the new thread card / comment, so only genuine arrivals animate — not the whole list when the panel opens or reopens. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the per-id new-vs-known tracking (SvelteSets + $effect.pre) with a single flag that mutes the arrival flash for 1.5s after the panel opens. Threads/comments snapshot the flag at creation, so the initial batch never flashes (even once the mute lifts) while anything arriving afterward does. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hahn-kev-bot
marked this pull request as ready for review
September 18, 2026 06:45
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.
Comments now come in live:
Video1.webm
new threads too:
Video.webm
when the unread comments filter is on the entry list is also refreshed when a new comment comes in. Note that the comment counter badge is not updated as then it would always be listening and triggering in the background, but maybe that's better?
🤖 AI summary
FW Lite already syncs comments over the same CRDT path as entries, but nothing notified the frontend when comments changed — so the comment panel, unread badge, and unread-filtered entry list only updated on manual refresh. This adds a live-update path mirroring the existing entity one, plus a subtle arrival animation.
New event
CommentsChangedEvent— a coarse, project-scoped, payload-freeIFwEvent(mirrorsEntriesChangedEvent). Consumers just re-query.Producers
SyncService.SyncResultsHaveCommentChangesinspects the pulled commits for comment/thread create/edit/status/delete changes and publishes after read status is applied (pure over sync results, no DB hit).MiniLcmApiNotifyWrapperpublishes on comment writes and on read-status changes (mark read/unread) — so unread counts stay correct even when no comment data itself changed.Consumers
CommentDialog) refetches threads + unread while open.EntryView) refreshes.EntriesList) re-queries only when the unread-comments filter is active.Arrival animation
Design note: read-status mutations intentionally fire the coarse event, otherwise marking a thread read wouldn't live-update the badge / unread-filtered list.
Test plan
FwLiteShared.TestsSyncServiceTests— 9/9 pass (5 new, covering comment-change detection).svelte-check— 0 errors.The 1.5s arrival grace window is a constant in
CommentDialogand easy to tune.