Skip to content

feat(panel): add Before/After toggle for retouch layers - #5

Merged
hongducdev merged 3 commits into
mainfrom
hongducdev/feat/before-after-toggle
Nov 8, 2026
Merged

hongducdev merged 3 commits into
mainfrom
hongducdev/feat/before-after-toggle

Conversation

@hongducdev

Copy link
Copy Markdown
Owner

Summary

  • New Trước / Sau button on the Retouch tab hides or shows every layer the panel created, so the result can be compared with the original image.
  • js/panel.js records the layers each layer-creating command adds (layer-id diff around the command), so Photoshop Actions with unknown layer names are covered. The user's own layers and layers they hid themselves are never touched.
  • jsx/before-after.jsx holds the state per document for the Photoshop session; each toggle is one History step.
  • Running a tool while the result is hidden shows the hidden layers first, so the image is never half hidden.
  • An empty toggle shows a plain Vietnamese message instead of an error.

Not included

Batch (BA), Chữ / Logo, Brush and RAW open are not tracked. Layers created outside the panel (manual Action runs) are not tracked.

Test plan

  • All tests/check-*.js pass (23 files, including the new check-before-after.js)
  • tests/photoshop-before-after-audit.jsx on Photoshop 23.2: 8-bit and 16-bit scratch documents, 22 checks pass (empty toggle, groups, user layers keep visibility, one History step, new tool restores, deleted layer)
  • Real commands (MLXG, mcwl) through the real loader: 2 panel layers hidden and shown, Background untouched

Remember the layers each retouch command creates and hide or show them with one
button, leaving the user's own layers untouched. Each toggle is one History step.
…idden layers before rebuild commands

Show hidden layers before frame, watermark, artboard and batch commands so a flatten never drops them,
read the toggle state from the document instead of trusting stored state, keep owned ids across Undo/Redo,
ignore a command that left another document active, and read only the layer properties needed.
@hongducdev
hongducdev merged commit a3cf0b5 into main Nov 8, 2026
1 check passed
@hongducdev
hongducdev deleted the hongducdev/feat/before-after-toggle branch November 8, 2026 08:14
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