Repository navigation
feat(favorites): favorites, recently opened pages and a light theme (B.3) - #117
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jos Nienhuis <6952249+joszz@users.noreply.github.com>
…B.3) Favorites and recently opened pages, kept per user on the server so the phone and the laptop share them: a star in the page header and the row menu, a favorites list above the sidebar tree, and "Recently opened" on the start page. Two tables (favorites, page_visits) and five endpoints, live pages only, private to the user. A light theme from the same tokens: every colour is light-dark(light, dark), so the system setting applies with no script and no flash, and System, Light and Dark in the user menu choose per device. The contrast test and the axe scans check both palettes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jos Nienhuis <6952249+joszz@users.noreply.github.com>
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.
Run B.3 (plan:
docs/runs/B.3.md, with its handoff).What a person gets
aria-pressed) and "Add to / Remove from favorites" in a row's menu. Starred pages are listed above the tree in the sidebar (and the phone's drawer), in the order they were starred, with titles from the tree so a rename shows at once.Design decisions worth a look
@themeislight-dark(<light>, <dark>), withcolor-scheme: light darkon the root. The strict CSP leaves no room for a script inindex.html, so the system setting has to work from CSS alone. A choice in the menu setsdata-themeon<html>before the app mounts. No component changed for the theme, and nodark:variant is used.live_pages, as the tree and search do. Nothing touches a page's version,updated_ator the tree version, and no audit line is written.for update) for their transaction. Two stars from two devices cannot pass the limit of 200, and two visits never prune the same rows at once. Different people never wait for each other.live_pages, and the lock is the samefor updatepatternTagServiceand the compactor use. Starring checks only the page and the pages above it (TreeService.IsLiveAsync), not the workspace's whole tree.Tests
FavoriteEndpointTests(17): idempotent star and unstar, a viewer may star, trash and restore, the 200 limit (also under parallel stars), privacy, stranger and anonymous, cascade on delete, no version or audit change, visit order, the 51st visit, parallel visits of one page and of many. The deny-by-default policy test covers the five endpoints; the migration's column test has the two tables.theme.ts(blocked storage,data-theme, the browser bar), the contrast of both palettes and a check that every colour token has two values, the browser bar colours equalsurface-panel, the stores (rollback of only the refused change, reads that wait for visits), the star, the sidebar list, the row menu item, the start page, the relative times, the visibility helper.favorites.spec.tsandtheme.spec.tson desktop and both phones;a11y.spec.tsruns axe on every state in both themes on all four projects, with the sidebar with favorites and the start page with recents added.pnpm check(Postgres up): web 1462, sidecar 152, server 1986 with the timing tests, Playwright 413, all passed.Found on the way
{}; the server tests do the same.syncClient.tskeeps its own visibility listener: it sends a heartbeat, not a reload, and the shared helper is for reloads.Review fixes (
/code-review, Opus 5.5, 10 findings, all fixed)Rollback of only the refused toggle; the browser bar following a chosen theme, its colours tied to the token by a test; the favorites limit and the visit pruning safe under parallel requests (user row lock); the page just opened on the start page at once; relative times that move on; a
Setfor the sidebar's lookups; fewer and cheaper queries; one helper for "read again when the tab is back"; a sharedisTheme, a corrected test name, a repeated assertion removed. Details in the handoff ofdocs/runs/B.3.md.For the test pass
Added to
docs/test-pass.mdunder "B.3": light and dark following the system on the phone (also the browser bar) and a chosen theme surviving a reload; reading in both themes by day and night; a star and an open crossing from one device to the other; the star and the recent list with a screen reader.🤖 Generated with Claude Code