Modernize the comparison UI and add a review workflow - #18
Merged
Conversation
Move the pages out of Python f-strings into Jinja templates and static assets, and turn the compare page into something a review can actually be done in: update the reference from the page, see whether a diff was accepted, and step through the documents. Compare page: - "Update reference" copies the monitored file over the reference one - files whose reference was updated are marked accepted for the session; the mark is dropped again when the monitored file changes afterwards - previous/next navigation with a position counter and a "diffs only" toggle that skips files that already match - view modes (A / A|B / B), a collapsible diff panel and keyboard shortcuts, which also work while the focus is inside a pane - the diff strip paints differing pixels red, draws the differing regions as overlay bars (a few pixels vanish when the image is scaled into the column), tracks the visible part of the document and jumps both panes to a clicked position Overview page: the per-status counts moved into the filter buttons, the status cell is a plain table cell again so the columns line up, and statuses are patched in place instead of reloading the whole page. Fixes found on the way: - a comparison could start before submit() had stored its future, which raised inside the worker and left the file on "pending" forever - a failing comparison left the same permanent "pending" - screenshots are cropped to the content, so positions and areas derived from a diff refer to the page instead of the very tall render window - rendered diffs are cached by the inputs' mtimes instead of re-rendering per request - paths are resolved against their root before serving or copying update_ref is now POST /api/update_ref/<path>; the previous GET endpoint and /status are kept for scripted use. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rpRWyT4az4Lz1irRRWrPD
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.
Reworks the pages served by
compare-html-serverso that a regression review can be done from the compare page itself, and moves the markup out of Python f-strings into Jinja templates plus static assets (shipped via[tool.setuptools.package-data]).Compare page
u) copies the monitored file over the reference one, then reloads both panes and the diff.✓ acceptednext to its live status for the rest of the session. The mark is dropped again if the monitored file changes afterwards. In-memory only, nothing is written to disk.5 / 9) and a diffs only toggle that skips files that already match.←→ jk 1 2 3 d u r Esc ?) that also work while the focus is inside a pane.Overview page
All 9 · Differences 6 · Pending 0 · Same 3 · Accepted 1) instead of a separate chip row that named the same states in a different order.alert(), and polling that patches rows in place and only reloads when the set of files actually changed.Fixes found on the way
submit()had stored its future, socompare()raisedRuntimeError("Path not submitted for comparison")inside the worker and the file stayed onpendingforever. Reproduced on every run.pending; it is now logged and reported asdifferent.html-render-diff'sfirst error at X%output.Compatibility
update_refis nowPOST /api/update_ref/<path>. The previousGET /update_ref/<path>and/statusare kept for scripted use.Tested manually against
--driver chrome, including from a clean install of the package to confirm the templates and static files are packaged.🤖 Generated with Claude Code