Repository navigation
fix(aggregator): author pickers on demand — /program 44.3 MB → ~0.7 MB, /board 12.9 MB (#1179) - #3842
Merged
Merged
Conversation
…, /board 12.9 MB (#1179) Every card on the list pages inlined a full author picker: 5 standing identities plus one <option> per registry session (~700 sessions, ~123 KB). /program carried 351 copies (43.8 MB of its 44.3 MB), /board 94 copies (11.7 MB of 12.9 MB) — quadratic in cards x sessions, and the single-threaded render stalled other pages behind it. Pickers now server-render the standing identities only and hydrate the full list on demand: a delegated pointerdown/focusin hook (in the shared DASH_AFTER_JS) fetches the new GET /api/author-identities once per page and fills every picker, preserving each pickers current value. Datastar fragment re-renders arrive standing-only and re-hydrate from the cached list on first touch. No-JS and fetch-failure paths keep the standing identities, which are the common case; the submit handlers are unchanged (they read the same select[name=author]). The three duplicated option builders collapse into one exported authorOptionsHtml() that filters out session identities. Regression tests in test/author-picker-1179.test.ts pin standing-only rendering for the actbox/comment/card pickers, a 200-card size bound, and the endpoint serving the full list. Measured live before: /program 44,276,707 B, /board 12,932,555 B. After (worktree server, live stores): /program 716,762 B with 354 pickers and zero inlined session options; identities endpoint serves all 699 identities in 160 KB, fetched only on demand.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 55 minutes. View limit details
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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 1, 2026
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.
Problem (measured live 2026-11-01 ~10:54 CST, laptop loopback)
Byte composition (parsed from the actual HTML):
<select>elements = 43,762,227 B (98.8%) — 703 selects, 246,767 options. Per card there is one Act as picker: 5 standing identities + one option per registry session (699 options, ~123 KB) — inlined 351 times. The per-item status forms themselves are only 0.26 MB total.<details>total is the same bytes nested.So the pages were quadratic in cards x sessions, and the registry grows every day. The single-threaded server also stalled other pages behind these renders.
Fix
authorOptionsHtml()(new, shared by the three previously duplicated option builders — actbox Act as, comment form, card comment box) renders standing identities only; session identities are never inlined.data-author-picker. A delegated pointerdown/focusin hook in the sharedDASH_AFTER_JSfetches the newGET /api/author-identitiesonce per page and fills every picker, preserving each picker's current value. Fragment re-renders arrive standing-only and re-hydrate from the cached list on first touch. If the fetch fails or JS is off, pickers keep the standing identities (the common case — Drew is the default). Submit handlers are unchanged: they read the sameselect[name=author].Tests
test/author-picker-1179.test.ts(6 tests): standing-only rendering for all three picker sites, a 200-card x 300-session size bound (pre-fix ~9 MB, now <0.4 MB), the endpoint serving the full standing+session list, and /sessions rendering pickers standing-only with the hydration hook present.slice-3 routes > dns + sessions + pages routes serve, /api/registry.json claude-code record) fails identically on clean main; pre-existing, unrelated. Typecheck error count identical to main (12, none in touched files).Smoke (worktree server against live stores)
Live post-merge before/after for /program and /board will be recorded on #1179.
Refs #1179
Need help on this PR? Tag
@codesmith-botwith what you need.