Repository navigation
perf: sticky site header + open-time NeedStyles font face clamp - #310
Merged
Merged
Conversation
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>
Deploying document with
|
| 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 |
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>
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
Two landing/editor performance-and-UX improvements:
Sticky site header — Homepage and long content pages scrolled the top bar away. The bar is now
position: stickyon both chrome stylesheets (home.cssandlanding.css), with an opaque--ran-color-bgbackground. Also removedoverflow-x: hiddenfrom#landing-hero(that ancestor broke sticky) and adjusted the content-page.siderail so it clears the bar.Open-time NeedStyles clamp (guard 15c) — Word/Slide open used to request every face (NeedStyles 15) of every family. After
CheckFontNeeds, we rewriteLogicDocument.FontsfromDocument_CreateFontMapstyle bits, keep Regular + Italic for chrome/placeholders, leave paste (LoadDocumentFonts2) and map-absent extras alone, and honor the same bits inx2t-workerfontSources()so conversion does not re-pull unused faces.Tests
Sticky header
design-contractpins sticky + opaque background;#landing-herohas nooverflow-x.site-design-consistencyscrolls/and/helpand asserts the bar stays aty ≈ 0.position: relativeon both bars → E2E red; restored.NeedStyles clamp
font-need-styles.test.ts(Style→bits, clamp helpers,fontSourcesbit filter).embed-regression“open-time NeedStyles is clamped…” expects Arial NeedStyles === 7 (R|I|B) on a Regular+Bold sample; font-load acceleration still green.rewriteFontsNeedStyles→ Arial stays at 15, E2E red; restored. Keeping Italic also cleared tip-levelasc_onError -25that appeared when the clamp was Regular|Bold only.Follow-ups (not in this PR)
panel.tssplit, #94 GIF merge, chart round-trip E2E remain queued.