Skip to content

feat: before/after review step before export - #32

Merged
little-did-I-know merged 3 commits into
mainfrom
feature/before-after-review
Oct 28, 2026
Merged

little-did-I-know merged 3 commits into
mainfrom
feature/before-after-review

Conversation

@little-did-I-know

@little-did-I-know little-did-I-know commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Every export (button, Ctrl+E, command palette) now opens a full-screen review first: the file as first loaded on the left, what would be exported on the right.
  • Each side has a 3D view over its G-code text. Text is one aligned, virtualized list with added lines green and removed lines red.
  • Changed moves are highlighted in 3D: added or altered on the "after" view, removed on the "before" view. The layer follows the selected change.
  • Next/Previous buttons jump between changes with a "Change N of M" counter. Esc closes without exporting.
  • Continue exports exactly the lines that were reviewed (captured when the review opened). The review refuses to open while a file is loading or re-parsing.
  • GcodeViewer3D can take its own parser ({ parser, review }) and highlight moves by line; default viewer behavior is unchanged.
  • New src/line-diff.js: aligned line diff with hunks. It anchors on lines unique to both sides so recovery exports stay readable.

Notes

  • The original file is snapshotted in loadFile, so "before" always means the file as first loaded, including after Edit-mode changes.
  • While the review is open, shortcuts other than Esc/Tab/Enter/Space/scroll keys and Ctrl+C/A are blocked so state can't change under it.

Test plan

  • npm test passes (377 tests, including new line-diff tests for inserts, edits, edges, large files, recovery-shaped and over-cap diffs)
  • Browser checks: pause/Z-offset/deleted-move highlights, light and dark themes, recovery export, 245k-line file, no-changes review, keyboard handling, Esc during parse
  • Manual pass: export a few real sliced files and compare the review against the downloaded file

Aligned row diff with hunks, changed-line sets, and a line-to-layer lookup. Falls back to a block replace past an edit-distance cap so very large changes stay fast.
Every export now opens a full-screen review of the file as first loaded against what would be exported, with aligned G-code text, 3D views with highlighted changed moves, linked layers, and next/previous change navigation. Continue exports exactly the lines that were reviewed. The viewer can take its own parser, and the line diff anchors on unique lines so recovery exports stay readable.
loadFile refuses while the review is open, and drag/drop is cancelled in the review so the browser cannot navigate away to a dropped file.
@little-did-I-know
little-did-I-know merged commit a774b73 into main Oct 28, 2026
2 checks passed
@little-did-I-know
little-did-I-know deleted the feature/before-after-review branch October 28, 2026 21:02
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