From e8e3665142ed96e8afe6a1b3f7302971bc7386b6 Mon Sep 17 00:00:00 2001
From: Abdul Wahab <32850166+abdulwahabone@users.noreply.github.com>
Date: Fri, 29 May 2026 11:02:12 +0900
Subject: [PATCH] Live mode: staged AI copy edits (#158)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat(live): manual text-edit panel + Astro inject + stale-lockfile reap
Adds a manual text-edit popover under the live-mode bar so users can
retype copy directly without going through generate. The footer's
"Apply edits" button fires a manual_edits event; the server writes
the changes back to source via the new live-edit.mjs deterministic
file mutator. Mirrors the wrap+accept flow but skips variant generation.
New scripts:
- skill/scripts/live-edit.mjs: writes manual_edits back to source
- skill/scripts/live-text-rows.js: browser walker that surfaces every
pure-text descendant of the picked element as an editable row
Touched scripts:
- skill/scripts/live-browser.js: text panel UI, CONFIGURING state hook
- skill/scripts/live-poll.mjs: manual_edits routing
- skill/scripts/live-server.mjs: manual_edits endpoint + handler
- skill/scripts/live-wrap.mjs: small adjustments to support the flow
Docs + tests:
- skill/reference/live.md: manual-edit section
- tests/live-edit.test.mjs, tests/live-text-rows.test.mjs
Also bundles two live-mode reliability fixes that surfaced during
manual testing of the feature:
1. live-inject now emits is:inline when the inject target is a .astro
file. Astro otherwise processes the \n' +
+ '\n' +
open + ' ' + MARKER_CLOSE_TEXT + ' ' + close + '\n'
);
}
-function insertTag(content, config, port) {
- const block = buildTagBlock(config.commentSyntax, port);
+function insertTag(content, config, port, filePath) {
+ const block = buildTagBlock(config.commentSyntax, port, filePath);
// insertBefore: match the LAST occurrence. Anchors like `