Skip to content

feat: guard .aem store + select-all in Review changes - #33

Merged
davidnuescheler merged 3 commits into
mainfrom
feat/aem-guard-review-select-all
Aug 25, 2026
Merged

feat: guard .aem store + select-all in Review changes#33
davidnuescheler merged 3 commits into
mainfrom
feat/aem-guard-review-select-all

Conversation

@davidnuescheler

Copy link
Copy Markdown
Contributor

Two small, independent improvements (one commit each).

1. Guard the .aem pristine store against accidental edits

.aem/ holds the pristine server copies the app diffs and reverts against. An accidental edit (often an AI assistant "tidying" files) silently corrupts change detection. Cheap deterrents — not a security boundary:

  • Pristine originals are marked read-only (0o444) after every legitimate write (download, push round-trip, post-push mtime touch). The write bit is cleared right before the app's own rewrites/deletes so sync is never blocked.
  • A README ("DO NOT EDIT") and a catch-all .gitignore are dropped into each .aem dir whenever the manifest is written.
  • The tree is unlocked before "delete local content" so read-only originals don't trip fs.rm (notably on Windows).

All chmod is best-effort — a failure can never abort a sync. New pure module src/main/aem-guard.js with unit tests; the content CLI inherits the behavior through the shared da-sync functions.

2. Select/deselect-all checkbox in Review changes

The review rail had no one-click way to (un)check every file. The static "Changes" heading is replaced with a tri-state master checkbox: empty when nothing is checked, indeterminate when some are, ticked when all are. It toggles every reviewable file and stays in sync with per-row checkboxes, Space-to-toggle, and Cmd+A; it disables when there's nothing to review or a push/revert is running. The header inset is now symmetric so the checkbox lines up with the per-row checkboxes.

Testing

  • npm run lint clean.
  • npm test — 343 passing (6 new tests in test/aem-guard.test.js).
  • Renderer/UI changes verified by the author in-app.

🤖 Generated with Claude Code

davidnuescheler and others added 3 commits August 25, 2026 16:24
The `.aem` folder holds the pristine server copies the app diffs and
reverts against; an accidental edit (often by an AI assistant tidying
files) silently corrupts change detection. Discourage that cheaply:

- Mark pristine originals read-only (0o444) after every legitimate write
  (download, push round-trip, post-push mtime touch), clearing the bit
  right before the app's own rewrites/deletes so sync never gets blocked.
- Drop a README ("DO NOT EDIT") and a catch-all `.gitignore` into each
  `.aem` dir whenever the manifest is written.
- Unlock the tree before "delete local content" so read-only originals
  don't trip `fs.rm` (notably on Windows).

All chmod is best-effort — a failure can never abort a sync. New pure
module `aem-guard.js` with unit tests; the `content` CLI inherits the
behavior via the shared da-sync functions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The review rail had no one-click way to (un)check every file. Replace the
static "Changes" heading with a tri-state master checkbox: empty when
nothing is checked, indeterminate when some are, ticked when all are.
Toggling it checks or clears every reviewable file, and it stays in sync
with per-row checkboxes, Space-to-toggle, and Cmd+A. It disables while
there is nothing to review or a push/revert is running.

The header inset is now symmetric so the master checkbox lines up with
the per-row checkboxes below it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@davidnuescheler
davidnuescheler merged commit cdbcd79 into main Aug 25, 2026
5 checks passed
@trieloff

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants