Skip to content

Reduce main-thread thrashing and eliminate full-page-reload on nav#265

Draft
Blargian wants to merge 1 commit into
mainfrom
script-optimizations
Draft

Reduce main-thread thrashing and eliminate full-page-reload on nav#265
Blargian wants to merge 1 commit into
mainfrom
script-optimizations

Conversation

@Blargian

Copy link
Copy Markdown
Member
  • Replace scroll-reset.js rAF polling loop (60fps, forever) with history.pushState/replaceState patch that fires ch:navigate events
  • Use history.pushState in tab-nav.js for locale/tab navigation so switching translations is SPA-speed instead of a full page reload
  • Add RAF debounce to the three unthrottled MutationObservers in navbar-cta.js, ask-ai-button.js, and quickstart-back-link.js; those observers fired on every React DOM mutation with no throttle
  • Disconnect navbar-cta and ask-ai-button observers once injection succeeds — they don't need to keep watching after that
  • Replace updateLogoTheme() with pure CSS display rules in styles.css
  • Replace 9 inline style assignments in styleDropdownHeaders() with a single CSS class (.ch-mobile-nav-header) defined in styles.css
  • Move all injectStyles() CSS blocks from JS into styles.css so they parse at load time rather than being injected late (affects clickhouse-sql-highlight.js, custom-footer.js, navbar-cta.js, ask-ai-button.js)

- Replace scroll-reset.js rAF polling loop (60fps, forever) with
  history.pushState/replaceState patch that fires ch:navigate events
- Use history.pushState in tab-nav.js for locale/tab navigation so
  switching translations is SPA-speed instead of a full page reload
- Add RAF debounce to the three unthrottled MutationObservers in
  navbar-cta.js, ask-ai-button.js, and quickstart-back-link.js; those
  observers fired on every React DOM mutation with no throttle
- Disconnect navbar-cta and ask-ai-button observers once injection
  succeeds — they don't need to keep watching after that
- Replace updateLogoTheme() with pure CSS display rules in styles.css
- Replace 9 inline style assignments in styleDropdownHeaders() with a
  single CSS class (.ch-mobile-nav-header) defined in styles.css
- Move all injectStyles() CSS blocks from JS into styles.css so they
  parse at load time rather than being injected late (affects
  clickhouse-sql-highlight.js, custom-footer.js, navbar-cta.js,
  ask-ai-button.js)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ClickHouse-docs 🟢 Ready View Preview Jun 24, 2026, 8:22 PM

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.

1 participant