mirror of
https://github.com/dong-nz/cv.git
synced 2026-11-22 16:10:40 +07:00
feat(i18n): per-entity content, per-group UI, page manifests (spec-v4-data-organization)
- split content.json -> content/{profile,skills,experience,projects}.json and
ui.json -> 14 feature-group files (vi+en); index.ts merges both trees and
asserts the merge against the group lists; merged CONTENT verified
byte-identical against pre-split baseline dumps
- src/data/pages/*.json: 8 per-route manifests + pages.ts loader +
PageId/PageManifestClaim/PageManifest types; validate.ts rules 1-4 (unknown
entity, unknown ui group, unresolvable field path, orphan text field,
missing manifest) - all five rejects verified by a throwaway harness
- draft.ts: data-driven registry of the 12 writable documents (4 structure +
8 text); describeField() names the per-entity file; smoke-draft fixtures
follow the new registry (8/8)
- EditBar: 'appears on' page annotations computed from the manifests
- remove JsonPanel.tsx + panel labels (inline-editing task 8); docs: AGENTS.md
Data Layer / Live Edit Mode / Component Structure, v4 spec progress tables
This commit is contained in:
1 parent
dad5f3edd7
commit
939260e4fb
69 files changed
+1816
-1596
No files matched your search
@@ -173,7 +173,6 @@ export default function EditModeShell({ children }: { children: ReactNode }) {
|
||||
() =>
|
||||
store && (phase === 'ready' || phase === 'offline')
|
||||
? {
|
||||
textDoc: lang === 'en' ? 'content.en' : 'content.vi',
|
||||
commit: (path, value) => {
|
||||
const rejected = store.setValue(lang, path, value);
|
||||
setIssues(rejected ?? []);
|
||||
@@ -183,13 +182,26 @@ export default function EditModeShell({ children }: { children: ReactNode }) {
|
||||
refresh(store);
|
||||
return null;
|
||||
},
|
||||
revert: (path) => {
|
||||
const rejected = store.revertPath(path);
|
||||
describeText: (path) => store.describeText(lang, path),
|
||||
isTextDirty: (path) => store.isTextDirty(lang, path),
|
||||
setText: (path, value) => {
|
||||
const rejected = store.setText(lang, path, value);
|
||||
setIssues(rejected ?? []);
|
||||
if (!rejected) refresh(store);
|
||||
return rejected;
|
||||
},
|
||||
isPathDirty: (path) => store.isPathDirty(path),
|
||||
deleteText: (path) => {
|
||||
const rejected = store.deleteText(lang, path);
|
||||
setIssues(rejected ?? []);
|
||||
if (!rejected) refresh(store);
|
||||
return rejected;
|
||||
},
|
||||
moveText: (path, from, to) => {
|
||||
const rejected = store.moveText(lang, path, from, to);
|
||||
if (rejected) setIssues(rejected);
|
||||
else refresh(store);
|
||||
return rejected;
|
||||
},
|
||||
describe: (doc, path) => store.describeField(doc, path),
|
||||
apply: (doc, next) => {
|
||||
const rejected = store.apply(doc, next);
|
||||
@@ -342,10 +354,10 @@ export default function EditModeShell({ children }: { children: ReactNode }) {
|
||||
[store, refresh],
|
||||
);
|
||||
|
||||
const revertPath = useCallback(
|
||||
(path: string) => {
|
||||
const revertField = useCallback(
|
||||
(id: DraftDocId, path: string) => {
|
||||
if (!store) return;
|
||||
const rejected = store.revertPath(path);
|
||||
const rejected = store.revertIn(id, path);
|
||||
setIssues(rejected ?? []);
|
||||
if (!rejected) refresh(store);
|
||||
},
|
||||
@@ -391,7 +403,7 @@ export default function EditModeShell({ children }: { children: ReactNode }) {
|
||||
onTakeTheirs={resolveTakeTheirs}
|
||||
onResolveField={(id, path, side) => void resolveConflictField(id, path, side)}
|
||||
onDiscardDoc={discardDoc}
|
||||
onRevertPath={revertPath}
|
||||
onRevertPath={revertField}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user