Skip to content

fix(cli): persist read TUI news - #11171

Merged
catrielmuller merged 1 commit into
mainfrom
fix/tui-news-read-state
Jun 15, 2026
Merged

fix(cli): persist read TUI news#11171
catrielmuller merged 1 commit into
mainfrom
fix/tui-news-read-state

Conversation

@catrielmuller

@catrielmuller catrielmuller commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Context

https://kilo-code.slack.com/archives/C09GD7US2UB/p1781261716763419

Summary

  • persist opened TUI news IDs so viewed notifications no longer reappear
  • show only unread notifications while allowing newly published news to appear normally
  • add an explicit close button to the News dialog

Opening the News dialog is the read boundary: all notifications displayed in that dialog are recorded in the existing TUI KV store. This keeps the behavior local to the CLI and avoids requiring server-side read state.

image

@kilo-code-bot

kilo-code-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

The implementation is clean and correct. The News namespace utility is well-designed — ids() defensive-casts the persisted value, unread() and read() are pure functions tested at the unit level, and the KV integration in kilo-news.tsx correctly snapshots unread() before calling kv.set so the read boundary is atomic.

Minor observations (not blocking):

  • news_read_ids in the KV store grows unboundedly. For a low-volume notification service this is fine in practice, but if the ID set ever gets large, a future cleanup pass could prune IDs not present in the fetched notifications list.
  • Line 61 of kilo-news.tsx calls unread() twice in JSX (unread()[0] and unread().length). Because unread is a createMemo, both calls are free (memoized) and return the same value — no correctness issue, just a cosmetic note.
  • The dialog now has two close affordances: the existing esc button at the top-right and the new close button at the bottom. Both call dialog.clear(), which is intentional per the PR description.
Files Reviewed (5 files)
  • .changeset/close-read-tui-news.md
  • packages/opencode/src/kilocode/components/news.ts
  • packages/opencode/src/kilocode/components/kilo-news.tsx
  • packages/opencode/src/kilocode/components/dialog-kilo-notifications.tsx
  • packages/opencode/test/kilocode/news.test.ts

Reviewed by claude-4.6-sonnet-20260217 · 640,427 tokens

Review guidance: REVIEW.md from base branch main

@catrielmuller
catrielmuller merged commit de0c3eb into main Jun 15, 2026
21 checks passed
@catrielmuller
catrielmuller deleted the fix/tui-news-read-state branch June 15, 2026 15:14
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants