Skip to content

Add live comment updates to FW Lite - #2661

Open
hahn-kev-bot wants to merge 3 commits into
developfrom
claude/fw-lite-live-comments-b74220
Open

hahn-kev-bot wants to merge 3 commits into
developfrom
claude/fw-lite-live-comments-b74220

Conversation

@hahn-kev-bot

@hahn-kev-bot hahn-kev-bot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

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-free IFwEvent (mirrors EntriesChangedEvent). Consumers just re-query.

Producers

  • Sync: SyncService.SyncResultsHaveCommentChanges inspects 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).
  • Local: MiniLcmApiNotifyWrapper publishes on comment writes and on read-status changes (mark read/unread) — so unread counts stay correct even when no comment data itself changed.

Consumers

  • Comment panel (CommentDialog) refetches threads + unread while open.
  • Unread badge re-queries its project count.
  • Per-entry unread indicator (EntryView) refreshes.
  • Entry list (EntriesList) re-queries only when the unread-comments filter is active.

Arrival animation

  • New threads and new comments slide in, with a brief background highlight.
  • Only genuine arrivals animate: a per-panel grace window mutes the highlight for 1.5s after the panel opens, and each thread/comment snapshots that flag at creation — so the initial list never flashes, but anything arriving afterward (synced or a local post) does.

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

  • ✅ Manually verified in-app (two windows): posting/replying/resolving in one window live-updates the other's comment panel, unread badge, per-entry indicator, and unread-comments-filtered entry list — no manual refresh.
  • ✅ Arrival slide + highlight confirmed visually; initial list does not flash on open.
  • FwLiteShared.Tests SyncServiceTests — 9/9 pass (5 new, covering comment-change detection).
  • svelte-check — 0 errors.

The 1.5s arrival grace window is a constant in CommentDialog and easy to tune.

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>
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 666f674f-b277-47e4-92b6-35aca4be70af


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Sep 17, 2026
@argos-ci

argos-ci Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 18, 2026, 4:38 AM
e2e (Inspect) ✅ No changes detected - Sep 18, 2026, 4:44 AM

hahn-kev and others added 2 commits September 18, 2026 10:01
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
hahn-kev-bot marked this pull request as ready for review September 18, 2026 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants