Skip to content

perf: sticky site header + open-time NeedStyles font face clamp - #310

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/perf-maintainability-sweep-ffed
Nov 22, 2026
Merged

cursor[bot] merged 2 commits into
mainfrom
cursor/perf-maintainability-sweep-ffed

Conversation

@chaxus

@chaxus chaxus commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Two landing/editor performance-and-UX improvements:

  1. Sticky site header — Homepage and long content pages scrolled the top bar away. The bar is now position: sticky on both chrome stylesheets (home.css and landing.css), with an opaque --ran-color-bg background. Also removed overflow-x: hidden from #landing-hero (that ancestor broke sticky) and adjusted the content-page .side rail so it clears the bar.

  2. Open-time NeedStyles clamp (guard 15c) — Word/Slide open used to request every face (NeedStyles 15) of every family. After CheckFontNeeds, we rewrite LogicDocument.Fonts from Document_CreateFontMap style bits, keep Regular + Italic for chrome/placeholders, leave paste (LoadDocumentFonts2) and map-absent extras alone, and honor the same bits in x2t-worker fontSources() so conversion does not re-pull unused faces.

Tests

Sticky header

  • Unit: design-contract pins sticky + opaque background; #landing-hero has no overflow-x.
  • E2E: site-design-consistency scrolls / and /help and asserts the bar stays at y ≈ 0.
  • Reverse: position: relative on both bars → E2E red; restored.

NeedStyles clamp

  • Unit: font-need-styles.test.ts (Style→bits, clamp helpers, fontSources bit filter).
  • E2E: embed-regression “open-time NeedStyles is clamped…” expects Arial NeedStyles === 7 (R|I|B) on a Regular+Bold sample; font-load acceleration still green.
  • Reverse: short-circuit rewriteFontsNeedStyles → Arial stays at 15, E2E red; restored. Keeping Italic also cleared tip-level asc_onError -25 that appeared when the clamp was Regular|Bold only.

Follow-ups (not in this PR)

panel.ts split, #94 GIF merge, chart round-trip E2E remain queued.

Open in Web Open in Cursor 

Long homepage and content pages scrolled the brand, language switcher, and
GitHub links out of reach. Stick both chrome bars to the viewport, clear the
content-page rail under the bar, and drop overflow-x from #landing-hero so
sticky can attach to the viewport rather than the section.

Co-authored-by: ZhouHang <hicaxs@gmail.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Deploying document with  Cloudflare Pages  Cloudflare Pages

Latest commit: d3aea77
Status: ✅  Deploy successful!
Preview URL: https://cd749145.document-7hm.pages.dev
Branch Preview URL: https://cursor-perf-maintainability.document-7hm.pages.dev

View logs

Skip unused italic/bold/BI face downloads on Word/Slide open by rewriting
LogicDocument.Fonts after CheckFontNeeds from CreateFontMap bits, keep
Regular+Italic for chrome, leave paste and map-absent extras alone, and
honor the same bits in x2t fontSources. Unit + embed-regression cover it;
reverse verify: disable rewrite and Arial stays at 15.

Co-authored-by: ZhouHang <hicaxs@gmail.com>
@cursor cursor Bot changed the title fix(landing): keep the site top bar sticky while scrolling perf: sticky site header + open-time NeedStyles font face clamp Nov 22, 2026
@cursor
cursor Bot merged commit 4cc2bc5 into main Nov 22, 2026
20 checks passed
@cursor
cursor Bot deleted the cursor/perf-maintainability-sweep-ffed branch November 22, 2026 11:57
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