Skip to content

refactor(log-viewer): drop the sprite timeline renderers - #8

Closed
lukecotter wants to merge 1 commit into
mainfrom
refactor-drop-dead-code
Closed

lukecotter wants to merge 1 commit into
mainfrom
refactor-drop-dead-code

Conversation

@lukecotter

Copy link
Copy Markdown
Owner

📝 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 — FlameChart uses
MeshRectangleRenderer, MeshMarkerRenderer and MeshAxisRenderer, and
SearchOrchestrator uses MeshSearchStyleRenderer. The sprite predecessors were never
deleted. They still compiled, still ran in CI, and no production file imported them.

🛠️ Changes made

  • Delete the sprite render path: AxisRenderer (287), SearchStyleRenderer (209),
    TimelineMarkerRenderer (192), SpritePool (154), EventBatchRenderer (144).
    SpritePool's only importers were the other four.
  • Delete markers.test.ts (699) and batching.test.ts (564), which constructed only
    those classes.
  • Move the one behaviour that lost its only coverage — sortMarkersByTimeAndSeverity
    into MarkerProcessor.test.ts, beside the other exports of that module.
  • Repoint comments that named a deleted file. SearchHighlightRenderer's culling
    comments now name SelectionHighlightRenderer, which holds the identical
    implementation; MeshRectangleRenderer documents that it does not cull.

Net: −2,237 lines.

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

📷 Screenshots / gifs / video [optional]

No UI change. The timeline renders through the mesh path before and after.

🔗 Related Issues

None.

✅ Tests added?

  • 👍 yes

sortMarkersByTimeAndSeverity had no coverage outside the deleted markers.test.ts, so
it gains a case in MarkerProcessor.test.ts.

Coverage this PR gives up. markers.test.ts also covered marker viewport culling,
end-time resolution and per-type colour. Those cases asserted sprite tint, alpha, x
and width — internals of the deleted class — so they could not move across as written.
MeshMarkerRenderer keeps visibleIndicators private and had no suite of its own before
this 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 block
into MarkerProcessor, where those three behaviours become directly testable. Filed as
follow-up, not done here.

batching.test.ts needs no replacement: TemporalSegmentTree.test.ts and
RectangleCache.bucket.test.ts already cover the culling, size classification and
bucketing it exercised, against the live path.

📚 Docs updated?

  • 🙅 not needed

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) and
pnpm build (all three bundles). The build is the load-bearing check here — rollup has
to resolve every import for the bundles to be produced.

Two pre-existing problems found while reviewing this change, both left alone:

  • MetricStripRenderer.ts:471 re-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:150 hardcodes const EVENT_HEIGHT = 15 where its twin
    uses TIMELINE_CONSTANTS.EVENT_HEIGHT, which that file already imports.

TimeGridCalculator.ts still carries four comments naming the deleted AxisRenderer.
The file has no importers at all and is deleted in the next commit on this branch, so the
comments go with it.

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.
@lukecotter

Copy link
Copy Markdown
Owner Author

Refiling against certinia/debug-log-analyzer — that is where this should merge.

@lukecotter lukecotter closed this Sep 17, 2026
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