Add notifications, bookmarks, and better UI - #32
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Xeet’s TUI with reply/mention notifications (polling, unread state, popups + panel) and improves navigation/UI (feed tabs, bookmarks switching), while adding persistence safeguards for notification metadata and shared transaction-id signing state.
Changes:
- Add an authenticated NotificationsTimeline API client + parsing/tests, including query-id discovery/refresh.
- Add a notifications panel + popup UX in the timeline model with adaptive polling and persisted unread/delivered state.
- Improve feed navigation/UI (tab/shift+tab cycling, header indicator updates) and update docs/help text accordingly.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TODO.md | Adds planned item describing in-app reply/mention notifications. |
| README.md | Documents new navigation keys (tab cycling, notifications panel/popup actions) and polling behavior. |
| pkg/config/config.go | Persists notification metadata (account/delivered/read IDs), adds locked writes and a partial-save path for notification state. |
| pkg/config/config_test.go | Adds coverage for concurrent notification state persistence and keyring-skip behavior. |
| pkg/config/config_lock_windows.go | Adds Windows file-lock implementation for config writes. |
| pkg/config/config_lock_unix.go | Adds Unix file-lock implementation for config writes. |
| pkg/config/config_lock_other.go | Adds no-op lock for unsupported OSes. |
| pkg/api/web.go | Extends operation QIDs to include NotificationsTimeline; reuses transaction-id state per session; tweaks query-id refresh detection. |
| pkg/api/transaction_id.go | Adds per-session transaction-id generator cache to reuse signing state across short-lived clients. |
| pkg/api/transaction_id_test.go | Tests that transaction-id cache is scoped per session. |
| pkg/api/notifications.go | Implements NotificationsTimeline fetch + parsing to keep actionable replies/mentions. |
| pkg/api/notifications_test.go | Unit tests for parsing, request shape, query-id refresh flows, and auth error mapping. |
| pkg/api/notifications_live_test.go | Adds opt-in live test for notifications against a real session. |
| pkg/api/discover.go | Updates discovery hints to support NotificationsTimeline bundles. |
| pkg/api/discover_test.go | Tests new NotificationsTimeline discovery hint selection. |
| internal/timeline/view.go | Adds notifications mode rendering, header feed tabs + unread indicator, and popup overlay rendering. |
| internal/timeline/view_test.go | Tests header feed tabs + notification indicator rendering constraints. |
| internal/timeline/thread.go | Refactors thread entry/exit for notification integration; supports jumping into notifications from thread. |
| internal/timeline/reply.go | Ensures thread results can be applied correctly when reply editor is opened from notifications flows. |
| internal/timeline/notifications.go | Adds polling, notification queue/popup logic, unread tracking, persistence calls, and panel UI behavior. |
| internal/timeline/model.go | Wires notifications into the global update loop, adds feed cycling keys, and integrates notifications into post actions/viewport sync. |
| internal/timeline/model_test.go | Adds extensive tests for notification baseline, popups, panel navigation, polling backoff, and nested thread interactions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
164
to
166
| // needsQueryIDRefresh reports whether a response indicates the persisted-query | ||
| // id rotated: a plain 404, or a 400 that names the persisted query problem. | ||
| func needsQueryIDRefresh(res *httpResult) bool { |
Comment on lines
+64
to
+66
| if client.ApplyRefreshedQueryIDs(cfg) { | ||
| _ = mgr.Save(cfg) | ||
| } |
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
Testing