Human overview · for understanding
One mutable working copy · publish makes the version · full undo · faster by design · 2026-06-23
One mutable working copy · publish makes the version · full undo · faster by design
Master summary — the gist in 30 seconds
Input: client comments + admin edits/AI fixes on a page. Output: a clean working copy the admin shapes freely, frozen into a published version (the client-visible checkpoint) only on an explicit publish — with a full undo trail and a clean 3-state comment model.
flowchart LR C["Client<br/>comments"] --> W["WORKING copy<br/>(mutable, admin-only)"] A["Admin edits<br/>+ AI fixes"] --> W W -->|"edit freely,<br/>undo, re-run AI"| W W -->|"Ügyfélnek küldés →"| P["PUBLISHED version<br/>(frozen, client sees)"] P -.->|"forks fresh"| W
Input: any edit (HTML, CSS, reorder, per-comment AI, regenerate-all). Output: the SAME working version, rewritten in place — no new version row. Publish freezes it → published, and forks a fresh working copy (n+1).
flowchart TD E1["section edit"] --> W["working copy"] E2["CSS edit"] --> W E3["reorder"] --> W E4["per-comment AI"] --> W E5["regenerate-all"] --> W W -->|"NO new version"| W W ==>|"PUBLISH only"| V["new published version"]
Input: a submitted comment (always lands 'nincs kész'). Output: the admin freely moves it not-done ⇄ done ⇄ rejected — ALL three reversible (elvetve is NOT a dead-end: it can go back to nincs kész or kész) — while the version is working; AI-resolved ones get a 🤖 badge; once the version publishes, its done/rejected comments become read-only 'locked'.
stateDiagram-v2 [*] --> nincs_kész: submit nincs_kész --> kész: admin / AI 🤖 kész --> nincs_kész: revert (HTML kept) + re-run nincs_kész --> elvetve: reject + note elvetve --> nincs_kész: un-reject elvetve --> kész: un-reject → done kész --> elvetve: reject kész --> locked: publish elvetve --> locked: publish note right of locked: read-only<br/>in a frozen version
Input: 'Új verzió / Ügyfélnek küldés'. Output: a warning popup (X carry forward, Y close) → working freezes to published (client unlocks + auto-advances ~20s) → not-done comments re-anchor onto a fresh working copy STILL as not-done (with a faint 'V1' origin badge); done/rejected freeze. There is NO destructive 'restore' — instead the existing version-history dropdown loads any past version's HTML AND its comments in their frozen state, read-only ('↩ Legújabb' returns to newest). And the moment the admin makes a real edit, the client view shows '🔧 Feldolgozás alatt' and can't comment until the next publish.
flowchart LR
W["working n<br/>(admin edits → client locked 🔧)"] -->|publish| WARN{"warning popup<br/>carry X · close Y"}
WARN --> P["published n<br/>(client unlocks)"]
P --> W2["working n+1<br/>(not-done re-anchored,<br/>still not-done, 'V1' badge)"]
P -.->|"version-history dropdown<br/>(read-only: HTML + frozen comments)"| H["browse any old version"]
Input: each in-place edit. Output: an ordered EditEvent record {what changed, before-state, AI prompt + raw output, when, who}. Undo pops the MOST RECENT edit and restores its before-state (strict LIFO — no out-of-order undo of an arbitrary earlier edit). The very same records export as the JSON + Markdown audit ('the exact prompts given to AI and each output').
flowchart LR S0["state 0"] --> S1["state 1<br/>+EditEvent"] S1 --> S2["state 2<br/>+EditEvent"] S2 --> S3["state 3<br/>+EditEvent"] S3 -.->|undo| S2 S2 -.->|undo| S1 S3 ==>|export| AUD["audit<br/>JSON + MD"]
Input: your worry about 'communication limited to a single path / multiple editing paths at once'. Output: keep the single DB writer (it's tiny + safe); the actual block is staging_run_in_flight — one AI run per page at a time, because today all edits share ONE blob. New model: each edit = its own snapshot → different sections edit/run in parallel. Swap the page lock for a per-section guard.
flowchart TD
subgraph TODAY["today: one shared blob"]
R1["AI run A"] --> LOCK["page LOCK<br/>(must wait)"]
R2["AI run B"] --> LOCK
end
subgraph NEW["new: snapshot per edit"]
SA["edit sec 1"] --> OK["run in parallel"]
SB["edit sec 2"] --> OK
end
TODAY -.->|rebuild| NEW
Input: the live-QA bugs. Output: count = ALL open comments project-wide (22 shows 22, not 7); the server becomes the single source of truth for drafts (no more nav A→B→A duplicates); one comment = body + image atomically; rejected shows exactly 'Elvetve — note', never AI text.
mindmap
root((clean rules))
counts
project-wide<br/>not last batch
drafts
server is truth
no dupes on nav
comment
body+image<br/>one row
rejected
Elvetve + note<br/>never AI text
Input: the locked decisions (full rebuild, no live data, full undo, JSON+MD audit). Output: pure cores first (state + lifecycle + counts + undo) → fresh clean tables (no migration) → server wiring → client/reviewer UI rewrite → live Chrome QA at 1280/768/390. A code-tag backup before the schema swap; branch off production; push only when you say so.
timeline title Rebuild milestones M1 : core comment states M2 : lifecycle + counts + undo core M3 : clean schema (no backfill) M4 : server wiring + per-section concurrency M5 : client + reviewer UI rewrite M6 : live Chrome QA → iterate