Repository navigation
fix(website): remove the layout shift on docs pages; close the onboarding plan - #176
Merged
Merged
Conversation
…ding plan Lighthouse on the live site scored docs pages 85-94 on performance from a 0.19-0.29 layout shift on cold loads: the web font arrived after first paint, Arial broke lines differently, and the fixed right sidebar was positioned from `--sl-content-width: 76ch`, a unit that changes with the font. Now: the content width is in rem; `scrollbar-gutter: stable` keeps the first and final layouts on the same viewport width; a metric-matched `Inter Fallback` face (size-adjust and ascent/descent overrides against Arial) breaks lines identically before and after the swap; and sync-docs copies the three Latin font files to public/_fonts under stable names so the head preloads them with the HTML. Five consecutive runs of /docs/install/ at CLS 0; 100 in every category on every page measured. The plan's slice table and ledger now record every slice as shipped, with a closing entry (what worked, what to carry forward, Lighthouse method). Closes ENG-926.
lg2m
added a commit
that referenced
this pull request
Sep 25, 2026
`SessionStore::push_message`, `complete_streamed_turns`, `warm_empty`, `mark_focused`, and `evict_cold_bodies` mutate body state only, but went through `get_mut`, which drops the derived tree index. Every `AssistantMessageStarted` and `TextAppended` therefore rebuilt the sidebar order — exactly the per-frame rebuild `body_mut` exists to avoid. They now use `body_mut`. The test guarding this compared the order `Vec`'s pointer before and after, which passes whenever the allocator hands the rebuilt index the freed block; it failed on CI for main at 536a817 and for #176. The store now counts index rebuilds under `cfg(test)` and the test asserts exactly one, which fails deterministically against the old code (2 vs 1). Closes ENG-927.
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.
Linear: ENG-926. Closes the onboarding plan (ENG-875 tree).
Lighthouse on the live site
Desktop preset against https://retsu-ai.github.io/qq/:
//docs/install//docs/configuration/The one problem was a layout shift on docs pages on cold loads. Lighthouse's trace named the culprit: the fixed right sidebar and every paragraph moved when the web font arrived. Two causes compounding: Inter's fallback (Arial) breaks lines differently, and Starlight positions the fixed sidebar from
--sl-content-width, which we had set to76ch— a unit that changes width with the font.Fix
--sl-content-width: 50rem(same measure, font-independent).scrollbar-gutter: stable— the first layout (short document, no scrollbar yet) and the final one now agree on viewport width.Inter Fallback@font-face(size-adjust: 107%, ascent/descent overrides against Arial/Liberation Sans) so line breaks are identical before and after the swap.sync-docscopies the three Latin font files (Inter variable, JetBrains Mono 400/500 — 91 KB total) topublic/_fontsunder stable names, the@font-facerules point at them (base path substituted fromsite.config.mjs), and the head<link rel=preload>s the two every page paints with. Fonts now arrive with the HTML instead of a round-trip after the CSS. The five non-Latin Inter subsets the fontsource import pulled in are gone.After, against the built
dist/: five consecutive runs of/docs/install/at CLS 0; 100 / 100 / 100 / 100 on/,/docs/install/,/docs/configuration/,/docs/tui/.Method note for the ledger: a CDP probe sampling the sidebar's rect never reproduced the shift — the observer itself delayed first paint past the font load. Lighthouse's trace was the reliable instrument.
Plan closed
docs/plans/onboarding-ux.mdstatus → Complete; every slice row → Shipped (the plan table had never been updated as slices landed; the ledger had). Closing ledger entry records what worked (one audit every slice cited; one ledger, stacked merges; docs-truth + generated site landing together) and what to carry forward (sharedCARGO_TARGET_DIR; ADR-first saved a protocol bump). Homebrew tap and token confirmed in place — no owner setup outstanding.Verification
nub run build(sync,astro check0 errors, 476 links resolve), Lighthouse as above. Site-only change; no Rust.