-
Notifications
You must be signed in to change notification settings - Fork 0
perf: reuse WBS badge shells and skip metadata grid rerenders #495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
38
commits into
develop
Choose a base branch
from
perf/dom-template-cache-current-develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+992
−34
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
b477717
perf: bound WBS badge template caches
seonghobae b201a9a
test(perf): compare 5000-row render against protected base
seonghobae ff2b5bf
test(perf): prove metadata edits preserve the 5k-row grid
seonghobae 1c4f294
perf(render): avoid rebuilding task grid for project metadata
seonghobae 335e667
merge(perf): reconcile current protected develop
seonghobae e043b1d
test(perf): reject row data in badge template caches
seonghobae 711f34a
fix(perf): cache immutable badge shells only
seonghobae 5ded4af
fix(ui): move owner badge colors to stylesheet
seonghobae d5e0e10
test(perf): require zero allocation on every metadata sample
seonghobae e7ad20d
docs(perf): require immutable DOM cache shells
seonghobae dd799cd
docs(perf): record immutable badge shell boundary
seonghobae fbe0291
docs(changelog): record immutable badge shells
seonghobae 59ba07f
merge(perf): reconcile protected develop
seonghobae 323a2d4
merge(perf): preserve current protected develop behavior
seonghobae 285e3d0
merge(develop): preserve toast delivery with render performance work
seonghobae 61b9d6e
test(perf): prove progress template clone isolation
seonghobae b3dd6e5
merge(develop): reconcile render performance root with OpenCode config
seonghobae 3c9f244
merge(develop): reconcile metadata render performance with adaptive o…
seonghobae b0523bd
merge(develop): preserve protected dependency upgrades in performance…
seonghobae 16fcc6f
test(ui): model native progress select semantics
seonghobae 086d00d
test(a11y): require accessible owner badge contrast
seonghobae 72da018
test(a11y): register owner badge contrast regression
seonghobae 60d3a4c
test(a11y): evaluate effective badge CSS cascade
seonghobae bfa7b68
fix(a11y): make owner badge palette WCAG AA
seonghobae 671fb05
test(perf): cover immutable render benchmark base resolution
seonghobae 031dd50
test(perf): register benchmark-base regression
seonghobae 2249e6e
fix(perf): resolve benchmark base for protected pushes
seonghobae 8d11eb3
fix(perf): require immutable baseline evidence on push and PR
seonghobae 3c5e657
fix(ui): normalize owner values before badge hashing
seonghobae dcdc8da
fix: preload browser modules for static shell
seonghobae 9cc7ecc
fix(ui): keep owner badge palette index unsigned
seonghobae 05b646f
fix(a11y): enforce owner badge contrast
seonghobae b17f2d6
fix(a11y): restore existing stylesheet tail
seonghobae b5d46cd
test(perf): keep local cloud e2e independent of benchmark base
seonghobae aa28031
fix(perf): isolate baseline benchmark from local cloud e2e
seonghobae 3906b37
test(perf): require benchmark CI coverage
seonghobae 9c2cc0b
fix(perf): keep render benchmark in CI
seonghobae 0390160
test(perf): tighten benchmark script contracts
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # Immutable DOM badge shells and browser evidence | ||
|
|
||
| ## Decision status | ||
|
|
||
| This record describes an **active pull-request implementation**, not protected-`develop` | ||
| truth until integration completes. ScopeWeave may reuse unattached owner/status badge | ||
| shells in the WBS render loop only when all of the following remain true: | ||
|
|
||
| - every returned node is a clone rather than the cached shell itself; | ||
| - cached shells contain no task, owner, status, title, description, accessible name, | ||
| or other row-specific value; | ||
| - row-specific text, classes, `title`, and `aria-label` values are applied only after | ||
| cloning; | ||
| - owner colors use a fixed set of stylesheet classes rather than inline styles or an | ||
| owner-value registry; | ||
| - empty cells and warning paths keep their existing semantics; and | ||
| - production-browser interaction tests accompany allocation-focused unit tests. | ||
|
|
||
| The optimization is deliberately limited to small immutable badge structures. | ||
| Editable controls, validation relationships, and elements whose event listeners or | ||
| mutable child state differ per row are not cached here. | ||
|
|
||
| ## DOM correctness and privacy boundary | ||
|
|
||
| `cloneNode()` copies the node and its attributes. Its `deep` argument controls whether | ||
| child nodes are copied; it does not transfer listeners registered through | ||
| `addEventListener()`. ScopeWeave therefore keeps the two cached badge shells free of | ||
| row-specific attributes and child text, clones them shallowly, and mutates only the | ||
| returned clone. | ||
|
|
||
| This boundary is also a data-retention control. Owner names and status explanations | ||
| are not used as DOM-cache keys and are not retained in detached template nodes. | ||
| High-cardinality customer values therefore cannot grow a detached-node cache or leave | ||
| historical row text in reusable templates. | ||
|
|
||
| ## Resource bound and deterministic color | ||
|
|
||
| The owner badge uses one immutable shell and the status badge uses one immutable | ||
| shell. Their memory bound is therefore structural rather than an input-cardinality | ||
| LRU limit. A deterministic integer hash maps an owner string to one of 20 fixed | ||
| `owner-badge--color-N` classes defined in `styles.css`; the shell itself contains no | ||
| owner value and no inline `background` style. | ||
|
|
||
| This supersedes the earlier 256-entry input-keyed owner/status template maps. That | ||
| approach bounded entry count but still retained task/user data in cache keys and | ||
| detached DOM nodes. | ||
|
|
||
| ## Metadata-only render integration | ||
|
|
||
| Project-name persistence remains on the single user-visible `renderAll()` integration | ||
| path. `renderAll({ metadataOnly: true })` refreshes project metadata and returns before | ||
| metric calculation, analytics, visible-task construction, and task-grid replacement. | ||
| Base-date changes continue through the full render path because they affect schedule | ||
| metrics. | ||
|
|
||
| ## Test-first evidence contract | ||
|
|
||
| The focused unit contract verifies that: | ||
|
|
||
| - cached owner/status shells do not retain row text, title, accessible name, or inline | ||
| color; | ||
| - returned nodes are distinct clones populated with the correct current row value; | ||
| - a changed status description appears on the returned clone without mutating the | ||
| cached shell; | ||
| - 300 unique status values and 300 unique owners allocate no new template elements | ||
| after their respective shell is initialized; | ||
| - 5,000 identical owners likewise allocate no new template elements after shell | ||
| initialization; and | ||
| - empty-value behavior remains unchanged. | ||
|
|
||
| The Playwright benchmark drives the production bootstrap and rendering path with 5,000 | ||
| rows. For each warm project-name edit it records duration, `document.createElement()` | ||
| calls, heap delta when available, live DOM-node count, and whether the first task-row | ||
| node retained identity. The candidate contract requires **every** warm metadata sample | ||
| to create zero elements and preserve task-grid identity. Edit, inline-progress, and | ||
| drag/reorder probes remain acceptance checks in the same browser run. | ||
|
|
||
| ## Evidence interpretation | ||
|
|
||
| A prior hosted A/B run demonstrated a large metadata-edit improvement against its then | ||
| protected base, but predecessor-head or predecessor-base success is not exact-current- | ||
| head evidence. After any source, test, documentation, stylesheet, or base-reconciliation | ||
| change, the PR must regenerate browser and repository-native evidence for the unchanged | ||
| exact contributor head and independently resolved live protected base before the result | ||
| can support merge or release. | ||
|
|
||
| Cold-load and long-task values remain diagnostic unless the benchmark is explicitly | ||
| designed and powered for claims about those outcomes. The performance claim for this | ||
| slice is limited to the project-name metadata-edit hot path. | ||
|
|
||
| ## Rollback | ||
|
|
||
| Revert the immutable badge-shell helpers, fixed owner color classes, focused unit | ||
| contract, metadata-sample assertion, browser benchmark registration, changelog entry, | ||
| and this record together. A rollback does not change persisted WBS data or server APIs. | ||
|
|
||
| ## References | ||
|
|
||
| Mozilla. (2026). *Node: cloneNode() method*. MDN Web Docs. | ||
| https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode | ||
|
|
||
| Web Hypertext Application Technology Working Group. (2026). *DOM standard*. | ||
| https://dom.spec.whatwg.org/ | ||
|
|
||
| World Wide Web Consortium. (2017). *Long Tasks API 1*. | ||
| https://www.w3.org/TR/longtasks-1/ | ||
|
|
||
| World Wide Web Consortium. (2024). *High Resolution Time Level 3*. | ||
| https://www.w3.org/TR/hr-time-3/ |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.