Skip to content

feat(effects): optimize large-document profiling, incremental mutations and late font refresh (#12) - #177

Merged
prabothcharith merged 2 commits into
developmentfrom
feat/issue-12-large-doc-font-refresh
Nov 4, 2026
Merged

prabothcharith merged 2 commits into
developmentfrom
feat/issue-12-large-doc-font-refresh

Conversation

@prabothcharith

Copy link
Copy Markdown
Owner

Closes #12

Summary of Changes

  1. Capacity Scaling (MAX_HOST_ELEMENTS = 8000):

    • Doubled traversal capacity limit from 4,000 to 8,000 eligible elements.
    • Bounded execution time and flat memory storage preventing browser freezes on enterprise DOMs.
  2. Incremental Mutation Batching (FOUC Prevention):

    • Refactored �pplyPage / �pplyPageSession to support existing session continuity.
    • When new nodes are added via childList, existing styled elements remain intact and newly added candidate subtrees are incrementally processed in < 1 ms.
    • Eliminates visible flash of unstyled content (FOUC) and CPU spikes during dynamic list updates or infinite feeds.
  3. Late Web Font Loading Refresh:

    • Subscribes to document.fonts.ready and loadingdone event.
    • Recalculates line-height and text enlargement against actual rendered font metrics without requiring manual user toggling.
  4. Host Root Attribute Observation:

    • Observes documentElement and �ody with �ttributeFilter: ['class', 'data-theme', 'dir', 'lang'].
    • Adapts to theme switching (.dark, data-theme) and direction/language adjustments (dir='rtl', lang='si') automatically.
    • Strictly avoids observing inline styles on children to eliminate observer recursion/feedback loops.
  5. Documentation & Verification:

    • Created \docs/LARGE_DOCUMENT_PROFILING.md\ with methodology, node benchmarks, and memory profiles.
    • Updated \docs/TROUBLESHOOTING.md, \docs/ROADMAP.md, \docs/PROJECT_STATUS.md, and \CHANGELOG.md.
    • Added unit/benchmark tests in \ ests/largeDocumentAndFontRefresh.test.tsx\ and browser test in \ ests/browser/widget.spec.ts.
    • Verified clean typecheck, lint, 50/50 test files (497 tests passing), consumer builds, and Playwright tests.

Copilot AI balanced review requested due to automatic review settings November 4, 2026 04:30
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-04T04:30:22.656430Z
We couldn’t complete this review. Comment @codex review to try again.
16eec29 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@prabothcharith
prabothcharith merged commit 0fc0311 into development Nov 4, 2026
4 checks passed
@prabothcharith
prabothcharith deleted the feat/issue-12-large-doc-font-refresh branch November 4, 2026 04:44
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