mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
docs(specs): v4 data-organization + inline-editing design specs (agreed 2026-10-23)
spec-v4-data-organization.md: per-entity content files, per-feature-group UI (14 groups), per-page field-level manifests incl. synthetic resume consumer, orphan-field validation rule; lands after inline-editing. spec-v4-inline-editing.md (E1-E7): delete JsonPanel, pencil-icon-trigger inline editing with field-provenance chips/tooltips (document -> pointer, clipboard copy), chip-level tag editors, ghost add/delete/move record controls, per-record settings popover, auto-generated slug ids, handle-only social links with loader-derived URLs, per-field keep-mine/keep-theirs conflict resolution. spec-v4-live-edit.md: mark JSON-panel scope superseded (5.1, 5.4, 5.8, row 14). AGENTS.md: register both specs as design-agreed-not-yet-implemented.
This commit is contained in:
1 parent
fecbd44899
commit
fbf75d8ffa
4 files changed
+286
-6
No files matched your search
@@ -90,7 +90,7 @@ Content is split once, at authoring time, into language-neutral **structure docu
|
|||||||
- `src/i18n/draft.ts` — `DraftStore`: baselines (`data` + `last_commit_sha`) of the six content documents, copy-on-write draft, leaf-path diff, cross-document validation on every accepted edit, three-way rebase on 412 conflicts (origin / base / working kept separate), draft persisted to sessionStorage `portfolio-draft`, sequential-PUT save (one commit per touched document, resume from the first unwritten one on failure), and appending new id union members to `src/types/index.ts` after their documents land
|
- `src/i18n/draft.ts` — `DraftStore`: baselines (`data` + `last_commit_sha`) of the six content documents, copy-on-write draft, leaf-path diff, cross-document validation on every accepted edit, three-way rebase on 412 conflicts (origin / base / working kept separate), draft persisted to sessionStorage `portfolio-draft`, sequential-PUT save (one commit per touched document, resume from the first unwritten one on failure), and appending new id union members to `src/types/index.ts` after their documents land
|
||||||
- `src/components/ui/EditableText.tsx` — the site's own element (`as` = the tag or motion component it renders today) becomes the inline editor only in edit mode; commit on blur only (Vietnamese IME-safe), Esc cancels, Enter commits single-line fields, paste is plain-text, empty required values are rejected at commit; without an `EditContext` provider it renders byte-identical markup to the plain element
|
- `src/components/ui/EditableText.tsx` — the site's own element (`as` = the tag or motion component it renders today) becomes the inline editor only in edit mode; commit on blur only (Vietnamese IME-safe), Esc cancels, Enter commits single-line fields, paste is plain-text, empty required values are rejected at commit; without an `EditContext` provider it renders byte-identical markup to the plain element
|
||||||
- `src/components/layout/EditBar.tsx` — fixed save bar: per-path diff with revert, conflict resolution (rebase / take-theirs / hand-merge), per-document save status, partial-save resume, exit confirm; `src/components/layout/JsonPanel.tsx` — per-document JSON editor with shape hints, record templates (structure + text stubs created together), orphan-free record delete, read-only `ui.json` tabs
|
- `src/components/layout/EditBar.tsx` — fixed save bar: per-path diff with revert, conflict resolution (rebase / take-theirs / hand-merge), per-document save status, partial-save resume, exit confirm; `src/components/layout/JsonPanel.tsx` — per-document JSON editor with shape hints, record templates (structure + text stubs created together), orphan-free record delete, read-only `ui.json` tabs
|
||||||
- Editable surface is content text only (bio, tagline segments, project titles/summaries/section prose, experience titles/responsibilities, skill-group titles, philosophy titles/descriptions); structure fields (`featured`, `variant`, technologies, links, ids) are edited in the JSON panel; `ui.json` is read-only in v4
|
- Editable surface is content text only (bio, tagline segments, project titles/summaries/section prose, experience titles/responsibilities, skill-group titles, philosophy titles/descriptions); structure fields (`featured`, `variant`, technologies, links, ids) are edited in the JSON panel; `ui.json` is read-only in v4. **Design agreed 2026-10-23 (`spec-v4-inline-editing.md`), not yet implemented:** the JSON panel will be deleted — pencil-icon-trigger inline editing with field-provenance chips (`document → pointer`), chip-level tag editors, ghost add/delete/move record controls, per-record settings popover, auto-generated ids, handle-only social links with loader-derived URLs
|
||||||
- Dev parity: `vite.config.ts` proxies `/api/content/` to the Gitea Contents API exactly like production nginx — run `pnpm dev` with `GITEA_TOKEN` set; without it edit mode falls to the offline state (bundled content, save disabled)
|
- Dev parity: `vite.config.ts` proxies `/api/content/` to the Gitea Contents API exactly like production nginx — run `pnpm dev` with `GITEA_TOKEN` set; without it edit mode falls to the offline state (bundled content, save disabled)
|
||||||
- Spec: `docs/design/specs/v4/spec-v4-live-edit.md` §5–§6
|
- Spec: `docs/design/specs/v4/spec-v4-live-edit.md` §5–§6
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ All specification documents are in `docs/design/`:
|
|||||||
| `specs/ui/spec-ui-*.md` | UI specs per section (hero, about, expertise, etc.) |
|
| `specs/ui/spec-ui-*.md` | UI specs per section (hero, about, expertise, etc.) |
|
||||||
| `specs/v2/spec-v2-*.md` | v2 feature specs (resume, seo, blog, analytics, testing, cicd) |
|
| `specs/v2/spec-v2-*.md` | v2 feature specs (resume, seo, blog, analytics, testing, cicd) |
|
||||||
| `specs/v3/spec-v3-*.md` | v3 feature specs (theme colors, theme switch, theme palette switch, palette reference, UI enhancements, mobile navigation, nav & CTA enhancements, nav swatch & hamburger, typography, i18n, resume improvements, resume redesign, review fixes) |
|
| `specs/v3/spec-v3-*.md` | v3 feature specs (theme colors, theme switch, theme palette switch, palette reference, UI enhancements, mobile navigation, nav & CTA enhancements, nav swatch & hamburger, typography, i18n, resume improvements, resume redesign, review fixes) |
|
||||||
| `specs/v4/spec-v4-*.md` | v4 feature specs (i18n locale overlay, git-backed live edit with preview, authenticated Contents-API write path; supersedes v3-i18n Phase 2) |
|
| `specs/v4/spec-v4-*.md` | v4 feature specs (i18n locale overlay, git-backed live edit with preview, authenticated Contents-API write path; supersedes v3-i18n Phase 2). `spec-v4-data-organization.md`: per-entity content files, per-page field-level manifests, per-feature-group UI — design agreed 2026-10-23, **not yet implemented**. `spec-v4-inline-editing.md`: edit everything on the page (pencil-icon triggers, tag chips, record add/delete/move, settings popover), JSON panel deleted — design agreed 2026-10-23, **not yet implemented**; it supersedes live-edit §5.1/§5.4 panel scope. The current layout and JsonPanel below remain authoritative until those specs land |
|
||||||
|
|
||||||
Read `spec.md` first for product context. Read `spec-v2.md` for current feature scope.
|
Read `spec.md` first for product context. Read `spec-v2.md` for current feature scope.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,162 @@
|
|||||||
|
# Specification — v4 Data Organization (per-entity content, per-page manifests, per-group UI)
|
||||||
|
|
||||||
|
Status: **Design agreed 2026-10-23; implementation TODO.** Follow-up to `spec-v4-live-edit.md`; does not change its D1–D10 decisions, only the physical document layout and the edit-mode document registry.
|
||||||
|
|
||||||
|
## 1. Decisions from the 2026-10-23 discussion
|
||||||
|
|
||||||
|
| # | Decision | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| D1 | Content text is managed **per entity**, one file per entity per language | Structure documents are already per entity; the text document mirrors its structure document 1:1. Join, validation, and commits become per-pair. |
|
||||||
|
| D2 | Page data is managed **per page** as a **manifest of references**, not as copied text | Entities legitimately span pages (bio on home + `/about`, experiences on home + `/experience`, projects on three pages). Copying per page re-creates the duplicated-fact problem the row 18–19 cutover just removed. The manifest answers "where does this page's data come from" without duplication. |
|
||||||
|
| D3 | UI chrome is one file per **feature-group**, not per React component file | Strings shared by sibling components (nav chrome by Navigation + MobileMenu + ThemePaletteMenu + ResumeNavButton; social by Footer + Contact) would duplicate or cross-import under a strict per-component split. A feature-group is "the component plus its variants". |
|
||||||
|
| D4 | Manifests are **field-level** | The stated goal is provenance per page; entity-level would not say which field renders where. Field-level is also what powers EditBar page grouping (§6.3). |
|
||||||
|
| D5 | Spec first, implementation in a later pass | This file is the contract; implementation order and acceptance criteria are §7–§8. |
|
||||||
|
|
||||||
|
Non-goals:
|
||||||
|
|
||||||
|
- Pages do **not** render from manifests. Section layouts are bespoke (hero ≠ timeline ≠ grid); a generic renderer driven by manifests would rewrite all seven pages and lose their design. The manifest is a provenance index and an edit-mode grouping source, not render config.
|
||||||
|
- No content is duplicated across documents. `CONTENT` and `UI` as consumed by components keep byte-identical shapes; components do not change.
|
||||||
|
|
||||||
|
## 2. Target tree
|
||||||
|
|
||||||
|
```
|
||||||
|
src/data/ # structure, language-neutral (unchanged files)
|
||||||
|
profile.json skills.json experience.json projects.json
|
||||||
|
pages/ # NEW: per-page manifests, language-neutral
|
||||||
|
home.json about.json experience.json projects.json
|
||||||
|
project-detail.json contact.json philosophy.json
|
||||||
|
resume.json # synthetic consumer manifest (no route) — see §5
|
||||||
|
pages.ts # NEW: loader + PageId typing
|
||||||
|
|
||||||
|
src/i18n/locales/vi/
|
||||||
|
content/ # text per entity (replaces content.json)
|
||||||
|
profile.json skills.json experience.json projects.json
|
||||||
|
ui/ # chrome per feature-group (replaces ui.json)
|
||||||
|
navigation.json footer.json social.json hero.json about.json
|
||||||
|
expertise.json experience.json projects.json project-detail.json
|
||||||
|
contact.json philosophy.json resume.json common.json edit.json
|
||||||
|
src/i18n/locales/en/ # mirror (partial overrides, unchanged semantics)
|
||||||
|
```
|
||||||
|
|
||||||
|
`src/i18n/index.ts` merges every file into the same `CONTENT` / `UI` records it exports today. `dict-types.ts` keeps the document types; each file is validated against its slice type at load, exactly as the current whole-document check. The existing fallback rule (missing EN field → VI value; arrays atomic) is unchanged and now operates per entity file.
|
||||||
|
|
||||||
|
## 3. Content split per entity
|
||||||
|
|
||||||
|
- `content.json` → four files per language under `locales/<lang>/content/`. Entity id ↔ file ↔ resolved record:
|
||||||
|
|
||||||
|
| Entity id (manifest, draft paths) | Structure doc | Text docs | Resolved record |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `profile` | `src/data/profile.json` | `content/profile.json` | `c.profile` |
|
||||||
|
| `skillGroups` | `src/data/skills.json` | `content/skills.json` | `c.skillGroups` |
|
||||||
|
| `experiences` | `src/data/experience.json` | `content/experience.json` | `c.experiences` |
|
||||||
|
| `projects` | `src/data/projects.json` | `content/projects.json` | `c.projects` |
|
||||||
|
|
||||||
|
- Cross-document validation rules (§3.6 of the live-edit spec) are unchanged in substance; they now run per pair — orphan/missing keys, HTML-in-text, id unions — with a smaller blast radius per rule.
|
||||||
|
- DraftStore baselines become per file. A save already PUTs one commit per touched document; after the split, touching bio and a project summary produces two commits (`profile.json`, `projects.json`) instead of one fat `content.json` commit. Conflict detection and three-way rebase are per-document and already independent — no semantics change, finer granularity.
|
||||||
|
|
||||||
|
## 4. UI feature-groups
|
||||||
|
|
||||||
|
The current `ui.json` namespaces map 1:1 onto groups; the split is mechanical. Ownership:
|
||||||
|
|
||||||
|
| File (per language) | Namespace today | Owned by (feature-group) |
|
||||||
|
|---|---|---|
|
||||||
|
| `ui/navigation.json` | `nav` | Navigation, MobileMenu, ThemePaletteMenu, ResumeNavButton |
|
||||||
|
| `ui/footer.json` | `footer` | Footer |
|
||||||
|
| `ui/social.json` | `social` | SocialLinks (footer + contact surfaces) |
|
||||||
|
| `ui/hero.json` | `hero` | Hero (HeroParticles carries no copy) |
|
||||||
|
| `ui/about.json` | `about` | About section + AboutPage |
|
||||||
|
| `ui/expertise.json` | `expertise` | Expertise |
|
||||||
|
| `ui/experience.json` | `experience` | Experience section + ExperiencePage |
|
||||||
|
| `ui/projects.json` | `projects` | Projects section + ProjectsListPage |
|
||||||
|
| `ui/project-detail.json` | `projectDetail` | ProjectDetailPage |
|
||||||
|
| `ui/contact.json` | `contact` | Contact section + ContactPage |
|
||||||
|
| `ui/philosophy.json` | `philosophy` | PhilosophyPage |
|
||||||
|
| `ui/resume.json` | `resume` | resume PDF labels (consumed by `scripts/generate-resume.ts`) |
|
||||||
|
| `ui/common.json` | `common` | cross-cutting atoms: `backToTop`, `contactTag`, `experienceTag`, `resumeDownload`, resume-modal strings (BackToTop, tags, DownloadResume, ResumeDialog) |
|
||||||
|
| `ui/edit.json` | `edit` | EditBar, EditModeShell (incl. `edit.fields` labels; new inline-control labels per `spec-v4-inline-editing.md`) |
|
||||||
|
|
||||||
|
`ui.json` stays read-only in edit mode (v4 rule, unchanged). `generate-resume.ts` and every component keep consuming the merged `UI` — zero call-site changes.
|
||||||
|
|
||||||
|
## 5. Page manifests
|
||||||
|
|
||||||
|
`src/data/pages/<page>.json`, one per route, plus a synthetic `resume.json` consumer manifest (id `resume`, no route — the resume PDF is a real consumer of content text and would otherwise be the orphan-rule's blind spot). Schema:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"id": "about",
|
||||||
|
"route": "/about",
|
||||||
|
"content": [
|
||||||
|
{ "entity": "profile", "fields": ["name", "bio", "subtitle", "currentInterests", "philosophy"] },
|
||||||
|
{ "entity": "skillGroups", "fields": ["*"] }
|
||||||
|
],
|
||||||
|
"ui": ["about"]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- `entity` uses the §3 entity ids; `fields` are paths into the joined text/structure records; `"*"` claims the whole entity.
|
||||||
|
- `ui` lists **page-owned** groups only. Component-owned groups (`navigation`, `footer`, `social`, `common`, `resume`, `edit`) are owned by the component side and provenance for them is the component mapping in §4 — they are not repeated in every manifest.
|
||||||
|
- Manifests are language-neutral (which data a page shows is not a translation fact). They are structure-side data: part of validation, committed like structure documents, **read-only in the app** (`spec-v4-inline-editing.md` §3) — edited as repo files by the developer.
|
||||||
|
|
||||||
|
Initial content mapping — derived from the code scan of every consumer (2026-10-23), to be re-derived exactly at implementation:
|
||||||
|
|
||||||
|
| Page | profile | skillGroups | experiences | projects |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| `home` | `name`, `tagline`, `roles`, `bio`, `currentInterests`, `philosophy`, `tldr`, links (`email`, handles) | `*` (Expertise) | `*` (timeline) | featured subset: `title`, `summary`, `metrics` |
|
||||||
|
| `about` | `name`, `bio`, `subtitle`, `currentInterests`, `philosophy` | `*` | — | — |
|
||||||
|
| `experience` | `tldr` | — | `*` | — |
|
||||||
|
| `projects` | — | — | — | `*`: `title`, `summary`, `metrics` |
|
||||||
|
| `project-detail` | — | — | — | per-id: `title`, `summary`, `role`, `metrics`, `sections.*` |
|
||||||
|
| `contact` | links (`email`, handles) | — | — | — |
|
||||||
|
| `philosophy` | `philosophyQuotes` | — | — | — |
|
||||||
|
| `resume` (synthetic) | `name`, `title`, `bio`, `email`, links | `*` | `*` | `*` |
|
||||||
|
|
||||||
|
`home` does **not** claim `title` — the code scan shows Hero renders `name`/`roles`/`tagline` only; `title` is consumed by the resume generator, which the synthetic manifest now covers honestly.
|
||||||
|
|
||||||
|
### 5.1 Validation rules (added to `validate.ts`)
|
||||||
|
|
||||||
|
1. Manifest ids = the 7 route ids (`PageId` union, matching the router) + the synthetic `resume` consumer; no orphan or missing manifest.
|
||||||
|
2. Every `content[].entity` is a known entity; every field path resolves in the joined records (`"*"` always valid).
|
||||||
|
3. Every `ui` group name exists in the UI documents.
|
||||||
|
4. **No orphan fields:** every editable content text field must be claimed by at least one manifest. This makes drift mechanically caught in the dangerous direction — add a field to a text document without declaring which page shows it → `pnpm build` fails. The reverse drift (a manifest claims a field a page stopped rendering) is not mechanically detectable; it is caught by the review checklist "changing what a page renders includes updating its manifest".
|
||||||
|
|
||||||
|
## 6. Edit-pipeline consequences
|
||||||
|
|
||||||
|
6.1 **Document registry** (`draft.ts`): writable documents = 4 structure + 8 text. The 7 manifests and the 28 UI files are **read-only in the app** (manifests per `spec-v4-inline-editing.md` §3; UI per the v4 rule) — they are not draft baselines. Baselines, snapshots (sessionStorage `portfolio-draft`), path-diff, and rebase key off the writable registry — same code, data-driven list instead of a hardcoded six.
|
||||||
|
|
||||||
|
6.2 **Save:** unchanged sequential-PUT pipeline; commit granularity per touched file. The Gitea repository must contain the new file layout before the proxy answers 200 (same dependency as live-edit row 11).
|
||||||
|
|
||||||
|
6.3 **EditBar:** the changed-path diff gains page grouping — each changed path is annotated with the pages whose manifest claims it ("appears on: /about, home"). Grouping is computed from the manifests, not from component code.
|
||||||
|
|
||||||
|
Grouping includes the synthetic `resume` manifest ("appears on: resume PDF").
|
||||||
|
|
||||||
|
6.4 **JsonPanel:** SUPERSEDED 2026-10-23 by `spec-v4-inline-editing.md` (E1) — the panel is deleted; structural editing moves to on-page controls. Manifests are read-only in the app (developer documents; the orphan-field validation rule is the enforcement). EditBar page grouping (6.3) stands.
|
||||||
|
|
||||||
|
6.5 **Unchanged:** nginx `/api/content/` proxy and `vite.config.ts` (paths are already data-driven), the auth/session flow, branch targeting (D10), `scripts/smoke-draft.ts` (fixtures follow the new registry), `generate-resume.ts`, `generate-sitemap.ts`.
|
||||||
|
|
||||||
|
## 7. Implementation order
|
||||||
|
|
||||||
|
Order decided 2026-10-23: this spec lands **after** `spec-v4-inline-editing.md` — the panel is deleted against the current 6-document layout first, so grouped panel tabs are never built for a panel that is about to die.
|
||||||
|
|
||||||
|
1. Split `content.{vi,en}.json` → `content/{entity}.json`; loader merge; per-pair validation. Gate: merged `CONTENT` output byte-identical to pre-split (automated diff before/after).
|
||||||
|
2. Split `ui.{vi,en}.json` → `ui/{group}.json`; loader merge. Gate: merged `UI` byte-identical.
|
||||||
|
3. Add `src/data/pages/*.json` + `pages.ts` + `PageId`/manifest types + validator rules 1–4.
|
||||||
|
4. `draft.ts` registry, snapshot keys, `smoke-draft.ts` fixtures.
|
||||||
|
5. ~~JsonPanel grouped tabs~~ → inline editing controls per `spec-v4-inline-editing.md` §5; EditBar page annotations stay in scope.
|
||||||
|
6. Docs: AGENTS.md Data Layer + Component Structure, live-edit spec §12 follow-up row.
|
||||||
|
|
||||||
|
## 8. Acceptance criteria
|
||||||
|
|
||||||
|
- [ ] Merged `CONTENT` and `UI` byte-identical before/after the split (automated comparison script, throwaway).
|
||||||
|
- [ ] `pnpm build`, `pnpm validate:content`, `pnpm lint` (no new warnings), `pnpm build:resume-all` pass.
|
||||||
|
- [ ] `pnpm tsx scripts/smoke-draft.ts` passes against the new registry.
|
||||||
|
- [ ] Validator rejects: unknown entity, unresolvable field path, orphan content field, unknown ui group, missing manifest.
|
||||||
|
- [ ] Edit mode end-to-end (browser): edit one bio line + one project summary → EditBar shows two documents with page annotations → save produces two per-file commits on the target branch.
|
||||||
|
- [ ] Browser walkthrough unchanged for visitors: all 7 routes, both languages, identical rendering.
|
||||||
|
|
||||||
|
## 9. Progress Tracking
|
||||||
|
|
||||||
|
| # | Task | Status |
|
||||||
|
|---|---|---|
|
||||||
|
| 0 | Design agreed (D1–D5) | ✅ Done 2026-10-23 |
|
||||||
|
| 1–6 | Implementation steps §7 | ⬜ TODO |
|
||||||
|
| — | Acceptance §8 | ⬜ TODO |
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
# Specification — v4 Inline Editing (edit everything on the page; no JSON panel)
|
||||||
|
|
||||||
|
Status: **Design agreed 2026-10-23; implementation TODO.** Supersedes the JSON-panel parts of `spec-v4-live-edit.md` §5.1 ("Structural editing") and `spec-v4-data-organization.md` §6.4. The save pipeline (§5.4/§6 of live-edit), DraftStore semantics, conflict handling, branch targeting (D10), and the EditBar all stay as specified. Order decided 2026-10-23: this spec lands **before** `spec-v4-data-organization.md`.
|
||||||
|
|
||||||
|
## 1. Decisions
|
||||||
|
|
||||||
|
| # | Decision | Rationale |
|
||||||
|
|---|---|---|
|
||||||
|
| E1 | **No JSON editing in the app.** `JsonPanel.tsx` is deleted; every editable thing gets an affordance on the page where it renders. | Owner requirement. The panel was a workaround for data types without a natural UI control; this spec builds those controls instead. |
|
||||||
|
| E2 | Rare structural fields (`featured`, `variant`, `logo`) are edited in a **per-record settings popover** — form controls (toggle, select, text input), never JSON text. | These fields have no inline text to wrap; a small form attached to the record is the minimal honest control. |
|
||||||
|
| E3 | Record ids are **generated from the title slug and never editable** in the UI. | Ids are published in URLs and in the `src/types/index.ts` id unions; renaming them is rare and breaks external links. Slug generation: lowercase, ASCII-folded (diacritics stripped), non-alphanumeric → `-`, collision → `-2`, `-3`… The existing union-append pipeline in `draft.ts` continues to run after a document lands. |
|
||||||
|
| E4 | Social links: documents store **handles only**; all three profile URLs are derived in the loader (`profile.ts`): `github.com/{githubHandle}`, `linkedin.com/in/{linkedinHandle}`, `t.me/{telegramHandle}`. Editing happens on the contact card itself. | `profile.json` today holds `githubUrl` + `githubHandle` — two sources for one fact; the current `telegramUrl` literal is exactly `https://t.me/dongdn`, so deriving it loses nothing. The resolved record (`c.profile.githubUrl` …) keeps the same shape, so every consumer (Contact cards, Footer, resume generator, `social.ts`) is unchanged. |
|
||||||
|
| E5 | Reorder ships in this pass: **↑/↓ controls** on tag chips and on records (timeline entries, project cards, skill groups, philosophy points, project sections). | Removing the panel would otherwise leave no reorder path at all. Array order remains the display order; the move mutates the owning document (structure for `technologies`/record order, text for `metrics`/`interests`/`roles`/`keywords`). |
|
||||||
|
| E6 | Editing is triggered **only by the small icon**, never by clicking the text. | Text stays selectable and copyable; no accidental edit mode. |
|
||||||
|
| E7 | Every edit control shows the **field's storage location** on demand: tooltip on the pencil (`document → pointer`), and a monospace chip on the active editor (`locales/vi/content.json → profile.bio`); clicking the chip copies the full repo path + pointer to the clipboard. | The owner learns which field each text lives in, so a path seen in the app is exactly what to open in the editor/Gitea or search for in an EditBar diff. The info already exists in the draft registry (`documentId`, `path`) — this only renders it. |
|
||||||
|
|
||||||
|
## 2. Interaction model, by data type
|
||||||
|
|
||||||
|
### 2.1 Text fields (upgrade of `EditableText`)
|
||||||
|
|
||||||
|
- In edit mode each editable text renders inside a subtle wrapper zone (dashed 1px `--border` outline; hover/focus → `--accent`) with a pencil `<button>` at the zone's end corner, `aria-label` from `ui.edit.fields` (already complete). The glyph is 16px; the button's hit area is ≥28px at desktop and a 44px target on touch — same target-size discipline as the nav controls.
|
||||||
|
- Click the pencil → the element becomes the inline editor (input for single-line: titles, company, duration, role; auto-grow textarea for prose: bio, summary, section content, responsibilities item, quote). Clicking the text does nothing.
|
||||||
|
- Commit rules unchanged (live-edit §5.3): blur for multi-line (Vietnamese IME safe), Enter for single-line, Esc cancels, empty required values rejected at commit.
|
||||||
|
- Validation errors surface **inline**: red ring + message under the field. No panel status line.
|
||||||
|
- Mobile: the pencil is always visible in edit mode (low opacity), because hover does not exist.
|
||||||
|
|
||||||
|
### 2.2 Tag arrays — `technologies`, `metrics`, `currentInterests`, `roles`, `keywords`, tagline segments
|
||||||
|
|
||||||
|
Each chip is an edit unit: pencil per chip (inline text edit), `×` on hover to delete, a ghost `+` chip at the list end to add, ↑/↓ to move. Tagline segments additionally carry an emphasis toggle button (`emphasis: true` renders the bold/italic treatment Hero already applies). Empty tags are rejected at commit; tag add never requires a dialog.
|
||||||
|
|
||||||
|
### 2.3 Collections — add and delete records
|
||||||
|
|
||||||
|
- Add: a ghost affordance at the end of each collection, on the page where the collection renders — "+ Dự án mới" (end of the projects grid), "+ Kinh nghiệm mới" (end of the timeline), "+ Nhóm kỹ năng mới" (expertise grid), "+ Luận điểm mới" on /about + the home About section (where philosophy cards actually render), "+ Đoạn mới" on /philosophy (appends to the fixed `profile.philosophyQuotes` array — a title + paragraphs, not a philosophy card), "+ Section" in project detail with a mini type picker (text / diagram / metrics / code). Creation runs the existing `draft.ts` templates (structure + both text documents in one validated step; quotes need no structure leg); the new record appears in the live preview immediately.
|
||||||
|
- Delete: trash icon on the card/entry, confirm-gated, using the existing orphan-free delete (structure + text documents in one step).
|
||||||
|
- ids per E3 — project section ids included, slugged from the section title at creation.
|
||||||
|
|
||||||
|
### 2.4 Record settings popover (E2)
|
||||||
|
|
||||||
|
Gear icon on cards/entries opens a small popover anchored to the record:
|
||||||
|
- project card: `featured` toggle, sections list (type picker, move, delete — add lives inline at §2.3);
|
||||||
|
- timeline entry: `variant` select (none / current / gap), `logo` path text input;
|
||||||
|
- nothing else needs a popover — every other field has an inline home.
|
||||||
|
|
||||||
|
The popover edits the draft through the same validated path as inline text; invalid values never reach the preview.
|
||||||
|
|
||||||
|
### 2.5 Social links (E4)
|
||||||
|
|
||||||
|
Contact cards (home + /contact) show handle text as editable (pencil per §2.1 rules) and the URL as derived, read-only. `profile.json` keeps `githubHandle`, `linkedinHandle`, `telegramHandle`, `email`; `githubUrl`/`linkedinUrl`/`telegramUrl` are produced by `profile.ts` from the handles. `email` stays a plain editable field.
|
||||||
|
|
||||||
|
### 2.6 Reorder (E5)
|
||||||
|
|
||||||
|
↑/↓ buttons appear beside the pencil on chips and on record cards/entries in edit mode. Up/down swap the array element in the owning document; first/last disable the respective button. Semantics identical to a JSON array move.
|
||||||
|
|
||||||
|
### 2.7 Field provenance (E7)
|
||||||
|
|
||||||
|
Every edit control knows its storage location — `draft.ts` keys every accepted edit by `(documentId, path)`. E7 renders it:
|
||||||
|
|
||||||
|
- **Before editing**: the pencil's `title` (and `aria-describedby` tooltip) shows `<document> → <pointer>`, the document named by its real repo path in short form: `locales/vi/content.json → profile.bio`, `data/projects.json → iot-dws-integration.featured` (structure documents carry no language suffix — they are language-neutral).
|
||||||
|
- **While editing**: a monospace chip (12–14px chrome size per the typography rules) attached to the editor's top edge shows the same `document → pointer`. Clicking the chip copies the full repo path plus pointer (`src/i18n/locales/vi/content.json` + `profile.bio`) to the clipboard, with a brief "copied" confirmation.
|
||||||
|
- **Where it appears**: the active text editor (§2.1), every tag chip incl. its array index (`locales/vi/content.json → profile.currentInterests[3]` — the index also teaches that array order is display order), every settings-popover control next to its label, and inline validation errors (the same descriptor the `validate:content` CLI prints, so app errors and CLI errors name the same location).
|
||||||
|
- **Layout-agnostic**: the descriptor is computed from the draft document registry (document id → repo path). When `spec-v4-data-organization.md` lands, the same code renders `locales/vi/content/profile.json → bio` with no change here.
|
||||||
|
- The language shown is the document of the language being edited — editing the VI page writes `locales/vi/content.json`, the EN page writes `locales/en/content.json`. After `spec-v4-data-organization.md` lands these become `locales/vi/content/profile.json` etc. automatically (line 61).
|
||||||
|
|
||||||
|
Implementation: a `describeField(documentId, path)` helper in `draft.ts` (registry lookup + JSON-pointer formatting) consumed by `EditableText`, `TagListEditor`, `RecordSettings`, and the move controls. No new state, no new validation.
|
||||||
|
|
||||||
|
## 3. EditBar, save, conflicts — unchanged
|
||||||
|
|
||||||
|
The EditBar keeps its role: per-path diff with revert, conflict resolution, per-document save status, resume-after-partial-failure, exit confirm. With E1 the panel disappears from it (`openPanel`/`closePanel` labels drop from `ui.edit`); **hand-merge becomes per-field**: on a 412 conflict the EditBar lists the conflicting paths, each showing the working value beside the remote value with a keep-mine / keep-theirs choice per field — finer granularity than the document-level JSON merge it replaces, and raw JSON never appears. Save remains sequential-PUT per touched document. The cross-document validator still runs on every accepted edit and before save — its feedback now arrives inline at the field (and in the EditBar as a blocked-save reason), never as a JSON status line.
|
||||||
|
|
||||||
|
Page manifests (`spec-v4-data-organization.md` §5) are **read-only in the app**: they are developer documents; the orphan-field validation rule is the enforcement. Wildcard claims (`"*"`, `sections.*`) mean adding records or sections never requires a manifest edit.
|
||||||
|
|
||||||
|
## 4. Component inventory
|
||||||
|
|
||||||
|
| Work | Component | Nature |
|
||||||
|
|---|---|---|
|
||||||
|
| Upgrade | `EditableText.tsx` | wrapper zone + pencil trigger (icon-only editing), inline error display, provenance tooltip + chip (E7) |
|
||||||
|
| New | `TagListEditor.tsx` | per-chip edit/delete/move + ghost add; emphasis toggle for tagline |
|
||||||
|
| New | `RecordSettings.tsx` | popover form: featured, variant, logo, section list |
|
||||||
|
| New | `AddRecord.tsx` | ghost affordance + template trigger + (sections) type picker |
|
||||||
|
| New | move controls | ↑/↓ buttons shared by `TagListEditor` and record cards |
|
||||||
|
| Delete | `JsonPanel.tsx` | removed outright — no fallback drawer, no advanced mode |
|
||||||
|
| Keep + extend | `EditBar.tsx`, `edit-mode.ts`, validator | unchanged except panel references |
|
||||||
|
| Extend | `draft.ts` | id-slug helper (E3) + `describeField()` provenance helper (E7) |
|
||||||
|
| Data | `profile.json` + `profile.ts` | drop `githubUrl`/`linkedinUrl`/`telegramUrl`; derive all three in the loader |
|
||||||
|
|
||||||
|
`ui.edit` loses `panel`/`openPanel`/`closePanel`/`handMerge`; gains labels for the new controls (`addProject`, `addExperience`, `addSkillGroup`, `addPhilosophyPoint`, `addQuote`, `addSection`, `settings`, `moveUp`, `moveDown`, `remove`, `emphasis`, `editField` if not already present), for provenance (`copyPath` tooltip on the chip, `pathCopied` confirmation), and for per-field conflicts (`keepMine`, `keepTheirs`).
|
||||||
|
|
||||||
|
## 5. Implementation order
|
||||||
|
|
||||||
|
1. `EditableText` upgrade (zone + pencil + inline errors); remove text-click editing.
|
||||||
|
2. Provenance: `describeField()` in `draft.ts` (registry lookup + pointer formatting), tooltip + chip in `EditableText`, clipboard copy + `ui.edit` labels; reused by every later control.
|
||||||
|
3. `profile.json` handle-only + URL derivation in `profile.ts` (resolved record shape unchanged — verify consumers byte-identical).
|
||||||
|
4. `TagListEditor` for all six tag arrays incl. tagline emphasis, chips carrying indexed provenance.
|
||||||
|
5. Add/delete/move for records (`AddRecord`, trash, ↑/↓) over the existing templates and orphan-free delete.
|
||||||
|
6. `RecordSettings` popover (featured, variant, logo, section list with type picker), pointer shown beside each control.
|
||||||
|
7. id-slug generator + collision suffixes in `draft.ts` record creation.
|
||||||
|
8. Remove `JsonPanel.tsx` + its EditBar hooks + `ui.edit` panel labels.
|
||||||
|
9. Docs: live-edit §5.1 superseded note, data-organization §6.4 superseded note, AGENTS.md Live Edit Mode section.
|
||||||
|
|
||||||
|
## 6. Acceptance criteria
|
||||||
|
|
||||||
|
- [ ] Every field previously editable in the JSON panel is editable on a page: text, tags (incl. tagline emphasis), featured, variant, logo, technologies, record add/delete, section add with type, record order.
|
||||||
|
- [ ] Clicking editable text never opens an editor; the pencil always does; keyboard path Tab→Enter works for every control.
|
||||||
|
- [ ] Hovering any pencil shows `document → pointer`; the active editor carries the chip; clicking the chip copies the full repo path; the descriptor matches the EditBar diff line and the `validate:content` error for the same field.
|
||||||
|
- [ ] `profile.json` without URL fields renders identical Contact/Footer/resume output (derived URLs match the previous literals, `t.me/dongdn` included).
|
||||||
|
- [ ] Save flow: edit text + add a chip + move a tag → EditBar lists the touched files → save commits land on the target branch; a 412 conflict resolves without raw JSON: rebase / take-theirs / per-field keep-mine–keep-theirs in the EditBar.
|
||||||
|
- [ ] `pnpm build`, `pnpm validate:content`, `pnpm lint` (no new warnings), `pnpm tsx scripts/smoke-draft.ts`, `pnpm build:resume-all` pass.
|
||||||
|
- [ ] Visitor rendering unchanged on all 7 routes, both languages.
|
||||||
|
|
||||||
|
## 7. Progress Tracking
|
||||||
|
|
||||||
|
| # | Task | Status |
|
||||||
|
|---|---|---|
|
||||||
|
| 0 | Design agreed (E1–E7) | ✅ Done 2026-10-23 |
|
||||||
|
| 1–9 | Implementation §5 | ⬜ TODO |
|
||||||
|
| — | Acceptance §6 | ⬜ TODO |
|
||||||
@@ -332,8 +332,8 @@ The site itself gains an edit mode. There is no second preview machinery — the
|
|||||||
- **Draft initialization:** the draft is initialized from **live repository files fetched through the proxy** (`GET` per document + its `last_commit_sha`), not from the bundle — the bundle may be older than master if anyone edited via Gitea web since the last build, and a bundle-seeded draft would silently revert those edits. The static bundle is used only as an offline fallback, with a visible "stale" warning.
|
- **Draft initialization:** the draft is initialized from **live repository files fetched through the proxy** (`GET` per document + its `last_commit_sha`), not from the bundle — the bundle may be older than master if anyone edited via Gitea web since the last build, and a bundle-seeded draft would silently revert those edits. The static bundle is used only as an offline fallback, with a visible "stale" warning.
|
||||||
- **Mechanism:** edit mode wraps `<Layout>` in `<I18nProvider override={draft}>`. All pages, all components, both languages render the draft — text **and** structure.
|
- **Mechanism:** edit mode wraps `<Layout>` in `<I18nProvider override={draft}>`. All pages, all components, both languages render the draft — text **and** structure.
|
||||||
- **Inline text editing:** rendered text nodes bound to a text-document path become editable on focus (`contentEditable`); blur writes `{ path, value }` into the draft. Editing `projects['iot-dws-integration'].title` updates the card on `/projects`, the header on `/projects/:id`, and the featured block on the home page **simultaneously** — one draft, every consumer.
|
- **Inline text editing:** rendered text nodes bound to a text-document path become editable on focus (`contentEditable`); blur writes `{ path, value }` into the draft. Editing `projects['iot-dws-integration'].title` updates the card on `/projects`, the header on `/projects/:id`, and the featured block on the home page **simultaneously** — one draft, every consumer.
|
||||||
- **Editable surface (curated scope):** inline editing covers **text documents only** — profile bio and tagline (each tagline segment is an individually editable span; the `emphasis` toggle is edited in the JSON panel), profile subtitle / career TL;DR / philosophy quote titles+paragraphs (row 18), project titles/summaries/section content/role, experience titles/companies/durations/responsibilities (row 19), skill group titles, philosophy titles/descriptions. Tag arrays (`currentInterests`, `roles`, `keywords`, `metrics`) are JSON-panel-only — tag chips are not inline-edit targets. `ui.json` is **read-only** in v4 (labels/aria are low-frequency chrome). This bounds the wrapping work to the ~40 content render sites, not the 130+ UI-string sites. Adjacent tagline segments are separate edit targets — the caret does not cross a segment boundary; intended behavior (D9), not a bug.
|
- **Editable surface (curated scope):** inline editing covers **text documents only** — profile bio and tagline (each tagline segment is an individually editable span), profile subtitle / career TL;DR / philosophy quote titles+paragraphs (row 18), project titles/summaries/section content/role, experience titles/companies/durations/responsibilities (row 19), skill group titles, philosophy titles/descriptions. `ui.json` is **read-only** in v4 (labels/aria are low-frequency chrome). This bounds the wrapping work to the ~40 content render sites, not the 130+ UI-string sites. Adjacent tagline segments are separate edit targets — the caret does not cross a segment boundary; intended behavior (D9), not a bug. *Superseded 2026-10-23 by `spec-v4-inline-editing.md`: editing is triggered by a per-field pencil icon, never by text focus; tag arrays (`currentInterests`, `roles`, `keywords`, `metrics`, `technologies`, tagline segments + emphasis toggle) become chip-level edit units with add/delete/move.*
|
||||||
- **Structural editing:** add/remove/edit records in the structure documents and their text entries happens in a JSON panel docked beside the page (the panel edits the draft documents directly; the live page re-renders on every valid change). The panel validates against §3.2/§3.6 before accepting — an invalid draft never reaches the preview.
|
- **Structural editing:** *Original scope: add/remove/edit records in a JSON panel docked beside the page, validated against §3.2/§3.6 before accepting.* Superseded 2026-10-23 by `spec-v4-inline-editing.md` (E1): the panel is deleted; record add/delete/move and rare fields (`featured`, `variant`, `logo`) move to on-page affordances (ghost add controls, confirm-gated delete, per-record settings popover). Validation-before-accept semantics are unchanged.
|
||||||
- **Language/theme:** the existing language, theme, and palette controls work unchanged inside edit mode — the owner previews exactly what visitors will see.
|
- **Language/theme:** the existing language, theme, and palette controls work unchanged inside edit mode — the owner previews exactly what visitors will see.
|
||||||
- **Save:** a persistent save bar lists the diff (changed paths per document), runs the §3.6 validator on the full draft, then PUTs each touched document through the proxy (§6). Unsaved draft is invisible to visitors.
|
- **Save:** a persistent save bar lists the diff (changed paths per document), runs the §3.6 validator on the full draft, then PUTs each touched document through the proxy (§6). Unsaved draft is invisible to visitors.
|
||||||
|
|
||||||
@@ -372,6 +372,8 @@ stateDiagram-v2
|
|||||||
|
|
||||||
### 5.4 JSON panel (structural editing)
|
### 5.4 JSON panel (structural editing)
|
||||||
|
|
||||||
|
> **Superseded 2026-10-23** by `spec-v4-inline-editing.md` (E1): `JsonPanel.tsx` is deleted; everything this section described is edited on the page instead. Kept as the implementation record of what was built in 3b — the templates, orphan-free delete, and validation gating it used are reused by the inline controls.
|
||||||
|
|
||||||
- Docked sheet: 420px right side above 1024px, full-width bottom sheet below; toggled from the EditBar; the live page stays interactive beside it.
|
- Docked sheet: 420px right side above 1024px, full-width bottom sheet below; toggled from the EditBar; the live page stays interactive beside it.
|
||||||
- Tabs: `profile.json`, `skills.json`, `experience.json`, `projects.json`, `content.vi.json`, `content.en.json`; `ui.{vi,en}.json` shown read-only for reference.
|
- Tabs: `profile.json`, `skills.json`, `experience.json`, `projects.json`, `content.vi.json`, `content.en.json`; `ui.{vi,en}.json` shown read-only for reference.
|
||||||
- Editor: monospace textarea + parse/validation status bar; errors render JSON-pointer paths with line numbers. The preview keeps rendering the **last valid draft** — an invalid panel state never reaches the page or the save.
|
- Editor: monospace textarea + parse/validation status bar; errors render JSON-pointer paths with line numbers. The preview keeps rendering the **last valid draft** — an invalid panel state never reaches the page or the save.
|
||||||
@@ -402,7 +404,7 @@ stateDiagram-v2
|
|||||||
|
|
||||||
### 5.8 Layout knobs and the deferred layout designer
|
### 5.8 Layout knobs and the deferred layout designer
|
||||||
|
|
||||||
v4 exposes no new layout knobs. `featured` and `variant` already exist and are editable via the JSON panel. A `layout.ts` config (section order/visibility) and any WYSIWYG layout editing are recorded here as **deferred research**, explicitly out of v4 scope.
|
v4 exposes no new layout knobs. `featured` and `variant` already exist and are editable via the JSON panel (superseded 2026-10-23: the same fields are edited in the per-record settings popover, `spec-v4-inline-editing.md` §2.4). A `layout.ts` config (section order/visibility) and any WYSIWYG layout editing are recorded here as **deferred research**, explicitly out of v4 scope.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -590,7 +592,7 @@ Deferred (not v4):
|
|||||||
| 11 | Production nginx step (§6.3) | 2 | ⬜ TODO — server step + `GITEA_TOKEN` are owner-side; the Phase-1 JSON documents must also be pushed to the repository before the proxy answers 200 |
|
| 11 | Production nginx step (§6.3) | 2 | ⬜ TODO — server step + `GITEA_TOKEN` are owner-side; the Phase-1 JSON documents must also be pushed to the repository before the proxy answers 200 |
|
||||||
| 12 | Local proxy config + compose + auth | 2 | ✅ Done 2026-10-22 — `nginx.conf` template location, compose env/htpasswd mounts, `deploy/htpasswd`. Compose smoke: unauthenticated GET → 401 + `WWW-Authenticate: Basic realm="Editor"`; authenticated request passes htpasswd and reaches Gitea (answers 404 `rel_path` — the JSON documents are not yet pushed and `GITEA_TOKEN` is unset locally, so the 200/412 legs land with row 11). `vite.config.ts` dev proxy mirrors nginx exactly |
|
| 12 | Local proxy config + compose + auth | 2 | ✅ Done 2026-10-22 — `nginx.conf` template location, compose env/htpasswd mounts, `deploy/htpasswd`. Compose smoke: unauthenticated GET → 401 + `WWW-Authenticate: Basic realm="Editor"`; authenticated request passes htpasswd and reaches Gitea (answers 404 `rel_path` — the JSON documents are not yet pushed and `GITEA_TOKEN` is unset locally, so the 200/412 legs land with row 11). `vite.config.ts` dev proxy mirrors nginx exactly |
|
||||||
| 13 | Edit mode 3a: draft store, inline editing, save happy path | 3 | ✅ Done 2026-10-22 (automated) — `draft.ts` (copy-on-write, path diff, origin/base separation + three-way rebase, sessionStorage snapshot, sequential-PUT save, id-union append), `edit-mode.ts` (`?edit`, session flag, Basic probe, dirty guard), `EditableText.tsx` (§5.3 contract), `useEdit.ts` context split, `App.tsx` lazy `MaybeEditMode` gate; editable surface wrapped in Hero/About/AboutPage/Expertise/Experience/ExperiencePage/Projects/ProjectsListPage/ProjectDetailPage. Verified: `pnpm build` (EditModeShell is a separate 24 kB lazy chunk, entry unchanged), `pnpm lint` (no new warnings), `scripts/smoke-draft.ts` 7/7 (accept/reject, empty-required, orphan-free delete, template, snapshot round-trip, conflict detection, clean rebase). ⬜ Browser: IME dấu commit on blur, cross-page live preview, reload restores the draft |
|
| 13 | Edit mode 3a: draft store, inline editing, save happy path | 3 | ✅ Done 2026-10-22 (automated) — `draft.ts` (copy-on-write, path diff, origin/base separation + three-way rebase, sessionStorage snapshot, sequential-PUT save, id-union append), `edit-mode.ts` (`?edit`, session flag, Basic probe, dirty guard), `EditableText.tsx` (§5.3 contract), `useEdit.ts` context split, `App.tsx` lazy `MaybeEditMode` gate; editable surface wrapped in Hero/About/AboutPage/Expertise/Experience/ExperiencePage/Projects/ProjectsListPage/ProjectDetailPage. Verified: `pnpm build` (EditModeShell is a separate 24 kB lazy chunk, entry unchanged), `pnpm lint` (no new warnings), `scripts/smoke-draft.ts` 7/7 (accept/reject, empty-required, orphan-free delete, template, snapshot round-trip, conflict detection, clean rebase). ⬜ Browser: IME dấu commit on blur, cross-page live preview, reload restores the draft |
|
||||||
| 14 | Edit mode 3b: JSON panel + record templates | 3 | ✅ Done 2026-10-22 (automated) — `JsonPanel.tsx`: per-document tabs + read-only `ui` tabs, shape hints, templates (project / experience / skill-group / philosophy / section-with-project-picker), record list + confirm-gated delete (structure + both text documents in one validated step), side-by-side hand-merge for conflicted documents, parse + validator status line. Verified via an SSR wiring smoke (`react-dom/server`, vi markup: tabs, templates, delete controls, status) — deleted after the run. ⬜ Browser: add/delete → live preview + validator behavior |
|
| 14 | Edit mode 3b: JSON panel + record templates | 3 | ✅ Done 2026-10-22 (automated) — `JsonPanel.tsx`: per-document tabs + read-only `ui` tabs, shape hints, templates (project / experience / skill-group / philosophy / section-with-project-picker), record list + confirm-gated delete (structure + both text documents in one validated step), side-by-side hand-merge for conflicted documents, parse + validator status line. Verified via an SSR wiring smoke (`react-dom/server`, vi markup: tabs, templates, delete controls, status) — deleted after the run. **Superseded 2026-10-23 by `spec-v4-inline-editing.md` E1**: the panel will be deleted; templates and orphan-free delete are reused by on-page controls. ⬜ Browser: add/delete → live preview + validator behavior (re-targeted to the inline controls) |
|
||||||
| 15 | Edit mode 3c: save bar, conflicts, failure recovery | 3 | ✅ Done 2026-10-22 (automated) — `EditBar.tsx`: changed-path diff with per-path revert and per-document discard, validate-before-save, sequential-PUT progress lines (written / conflict / failed), resume after partial failure, conflict actions (rebase / take-theirs / hand-merge), exit confirm when dirty. Verified via the same (now deleted) SSR smoke — vi markup carried the conflict controls, save statuses, and the resume button. ⬜ Browser + Gitea: save → commit → queued CI deploy → live change; full 412 flow against a real stale sha |
|
| 15 | Edit mode 3c: save bar, conflicts, failure recovery | 3 | ✅ Done 2026-10-22 (automated) — `EditBar.tsx`: changed-path diff with per-path revert and per-document discard, validate-before-save, sequential-PUT progress lines (written / conflict / failed), resume after partial failure, conflict actions (rebase / take-theirs / hand-merge), exit confirm when dirty. Verified via the same (now deleted) SSR smoke — vi markup carried the conflict controls, save statuses, and the resume button. ⬜ Browser + Gitea: save → commit → queued CI deploy → live change; full 412 flow against a real stale sha |
|
||||||
| 16 | Layout designer research (WYSIWYG / layout config) | deferred | ⬜ Out of v4 scope |
|
| 16 | Layout designer research (WYSIWYG / layout config) | deferred | ⬜ Out of v4 scope |
|
||||||
| 17 | Target-branch editing (D10): `?edit=<branch>`, `?ref=` on GET, `branch` on PUT, branch chip + merge hint | 3 | ✅ Done 2026-10-22 (automated) — tri-state URL parsing with git-ref validation (`edit-mode.ts`), `?ref=` on every document GET and `branch` in every PUT body (`draft.ts`, incl. the 412-refresh and id-union legs), branch persisted beside the session flag, EditBar branch chip + merge hint on non-default branches (`ui.json` `branchLabel`/`mergeHint`). Verified: `pnpm build`, `pnpm lint` (no new warnings), `scripts/smoke-draft.ts` 7/7, throwaway wiring smoke (URL tri-state, ref/branch transport, EditBar render for branch vs master) — deleted after the run. ⬜ Browser + Gitea: edit on a non-master branch → commits land there; merge → deploy |
|
| 17 | Target-branch editing (D10): `?edit=<branch>`, `?ref=` on GET, `branch` on PUT, branch chip + merge hint | 3 | ✅ Done 2026-10-22 (automated) — tri-state URL parsing with git-ref validation (`edit-mode.ts`), `?ref=` on every document GET and `branch` in every PUT body (`draft.ts`, incl. the 412-refresh and id-union legs), branch persisted beside the session flag, EditBar branch chip + merge hint on non-default branches (`ui.json` `branchLabel`/`mergeHint`). Verified: `pnpm build`, `pnpm lint` (no new warnings), `scripts/smoke-draft.ts` 7/7, throwaway wiring smoke (URL tri-state, ref/branch transport, EditBar render for branch vs master) — deleted after the run. ⬜ Browser + Gitea: edit on a non-master branch → commits land there; merge → deploy |
|
||||||
|
|||||||
Reference in new issue
Block a user