refactor(log-viewer): drop the sprite timeline renderers - #8
Closed
lukecotter wants to merge 1 commit into
Closed
lukecotter wants to merge 1 commit into
lukecotter wants to merge 1 commit into
Conversation
The mesh renderers replaced the sprite ones: FlameChart uses MeshRectangleRenderer, MeshMarkerRenderer and MeshAxisRenderer, and SearchOrchestrator uses MeshSearchStyleRenderer. No production file imported the sprite path. Deletes AxisRenderer, SearchStyleRenderer, TimelineMarkerRenderer, SpritePool and EventBatchRenderer, plus markers.test.ts and batching.test.ts, which constructed only those classes. TemporalSegmentTree.test.ts and RectangleCache.bucket.test.ts already cover the culling, size classification and bucketing that batching.test.ts exercised. sortMarkersByTimeAndSeverity had no coverage outside markers.test.ts, so its case moves to MarkerProcessor.test.ts. Marker viewport culling, end-time resolution and per-type colour lose their tests. They asserted sprite tint, alpha, x and width — internals of the deleted class. MeshMarkerRenderer keeps visibleIndicators private and had no suite of its own before this change either.
Owner
Author
|
Refiling against certinia/debug-log-analyzer — that is where this should merge. |
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.
📝 PR Overview
Removes code the extension no longer runs. First of a planned series that reduces the
codebase: this PR is deletions and test-setup sharing only, so nothing a user can reach
changes.
The mesh renderers replaced the sprite ones some time ago —
FlameChartusesMeshRectangleRenderer,MeshMarkerRendererandMeshAxisRenderer, andSearchOrchestratorusesMeshSearchStyleRenderer. The sprite predecessors were neverdeleted. They still compiled, still ran in CI, and no production file imported them.
🛠️ Changes made
AxisRenderer(287),SearchStyleRenderer(209),TimelineMarkerRenderer(192),SpritePool(154),EventBatchRenderer(144).SpritePool's only importers were the other four.markers.test.ts(699) andbatching.test.ts(564), which constructed onlythose classes.
sortMarkersByTimeAndSeverity—into
MarkerProcessor.test.ts, beside the other exports of that module.SearchHighlightRenderer's cullingcomments now name
SelectionHighlightRenderer, which holds the identicalimplementation;
MeshRectangleRendererdocuments that it does not cull.Net: −2,237 lines.
🧩 Type of change (check all applicable)
📷 Screenshots / gifs / video [optional]
No UI change. The timeline renders through the mesh path before and after.
🔗 Related Issues
None.
✅ Tests added?
sortMarkersByTimeAndSeverityhad no coverage outside the deletedmarkers.test.ts, soit gains a case in
MarkerProcessor.test.ts.Coverage this PR gives up.
markers.test.tsalso covered marker viewport culling,end-time resolution and per-type colour. Those cases asserted sprite
tint,alpha,xand
width— internals of the deleted class — so they could not move across as written.MeshMarkerRendererkeepsvisibleIndicatorsprivate and had no suite of its own beforethis PR either, so the gap is pre-existing rather than new, but it is not closed here.
The fix worth making is extracting
MeshMarkerRenderer.render()'s pure per-marker blockinto
MarkerProcessor, where those three behaviours become directly testable. Filed asfollow-up, not done here.
batching.test.tsneeds no replacement:TemporalSegmentTree.test.tsandRectangleCache.bucket.test.tsalready cover the culling, size classification andbucketing it exercised, against the live path.
📚 Docs updated?
No user-visible change, so no CHANGELOG entry. README and help site untouched.
Anything else we need to know? [optional]
Verified with
pnpm test(2,567 passing, 186 suites),pnpm lint(0 errors) andpnpm build(all three bundles). The build is the load-bearing check here — rollup hasto resolve every import for the bundles to be produced.
Two pre-existing problems found while reviewing this change, both left alone:
MetricStripRenderer.ts:471re-sorts the marker array every frame ([...markers].sort)inside the 16.6ms budget, and exception markers are unbounded. Memoising on array
identity is a three-line fix.
SearchHighlightRenderer.ts:150hardcodesconst EVENT_HEIGHT = 15where its twinuses
TIMELINE_CONSTANTS.EVENT_HEIGHT, which that file already imports.TimeGridCalculator.tsstill carries four comments naming the deletedAxisRenderer.The file has no importers at all and is deleted in the next commit on this branch, so the
comments go with it.