Skip to content

Remove orphaned diff2html viewer assets (~1MB unreferenced since #221) #273

Description

@gregoryfoster

Summary

The dashboard still ships the diff2html viewer's client assets and CSS overrides, but nothing mounts or references them. #221 stripped the notification-side diff surface; the viewer's front-end residue was left behind.

Found during the 2026-08-19 backlog staleness pass, while evaluating #126.

The orphans

Asset Size Referenced by
src/dashboard/static/js/vendor/diff2html-ui.min.js 1004K nothing
src/dashboard/static/js/diff-viewer.js 4.0K nothing
src/dashboard/static/css/input.css diff2html override block (~lines 254–280) selectors that never render

Verified absent across the whole dashboard:

  • No /changes/{id} route anywhere in src/dashboard/routes/.
  • No template contains diff-mount, data-unified-diff, or diff-content.
  • No template loads diff-viewer.js.
  • Diff2HtmlUI.draw() therefore never runs.

The CSS block compiles into the shipped output.css, so the dead selectors are served to every page.

Why remove rather than keep for #222

#222 will eventually restore a diff surface, so the tempting move is to leave these in place. Two reasons not to:

  1. Restore change detail (unified diff + chunk semantics) once Replicator provides a persistent content store #222 already uses a git restore anchor for exactly this. It names 89d64eb (the commit preceding the Notification Template UI/UX polish: event labels, Context layout, and strip the dead diff/significance surface #221 strip) and instructs restoring from there rather than rewriting. Deleted assets are recoverable the same way — nothing is lost.
  2. Unreferenced vendor code reads as live. A megabyte of vendored JS and a block of CSS overrides targeting .diff-mount will look load-bearing to the next person working on dashboard assets. That ambiguity is the actual cost, and it compounds the longer it sits.

The pinned version is recorded in diff-viewer.js's own header comment (diff2html-ui 3.4.52), so a future restore knows what to re-vendor even without the file.

Scope

  • Delete src/dashboard/static/js/vendor/diff2html-ui.min.js.
  • Delete src/dashboard/static/js/diff-viewer.js.
  • Remove the diff2html block from src/dashboard/static/css/input.css — the position: relative row anchor, the .d2h-tag suppression, and the preflight padding/border re-assertion added in Diff Raw Content: line numbers overlay content cells #120.
  • Rebuild CSS: bash scripts/build-css.sh, then restart per AGENTS.md.
  • Check docs/UI.md and docs/STYLE.md for references to the viewer or its component classes; §10 lists vendored JS explicitly (htmx, app, dark-mode, htmx-a11y) — confirm it does not also name these.
  • docs/STYLE.md §11 (Overriding Vendored CSS) uses diff2html as its worked example of the @layer vendor pattern. Keep the section — the pattern is still the house rule — but it will need a different example, or a note that the example is historical.

Restore pointer

Record in the commit message that the assets are recoverable from 89d64eb (or any commit before this one), so #222 does not have to rediscover it.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions