perf(edit): read only the documents the current route needs

Edit-mode document scope comes from the page manifests (src/i18n/edit-scope.ts): an entity's structure document and its two text documents are read as one unit, the category labels only where a project renders. A route change fetches only the still-missing documents and adopts them through DraftStore.adoptBase, which refuses a document the draft has already changed. A bundle-seeded baseline is never PUT over the branch: saveDraft reads the branch first and reports a conflict. Every manifest now claims profile.name, which the footer renders on every route.
This commit is contained in:
dong.nguyen committed 2026-10-24 15:24:08 +07:00
1 parent ee1d524bd0
commit 5c71b52d81
13 files changed
+320 -71

No files matched your search

+4 -2
View File
@@ -1,8 +1,10 @@
// Typed loader for the page manifests (spec-v4-data-organization §5): which
// joined records and which page-owned UI groups each page consumes.
// Manifests are language-neutral, part of validation, and read-only in the
// app — they exist for provenance (EditBar grouping, orphan-field rule),
// never for rendering.
// app — they exist for provenance (EditBar grouping, orphan-field rule) and
// for the edit-mode fetch scope (spec-v4-live-edit §5.1), never for rendering.
// A manifest describes the whole page, chrome included: the footer renders
// `profile.name` on every route, so every manifest claims it.
import aboutJson from './pages/about.json';
import contactJson from './pages/contact.json';
import experienceJson from './pages/experience.json';
+2 -1
View File
@@ -11,7 +11,8 @@
"linkedinUrl",
"linkedinHandle",
"telegramUrl",
"telegramHandle"
"telegramHandle",
"name"
]
}
],
+1 -1
View File
@@ -2,7 +2,7 @@
"id": "experience",
"route": "/experience",
"content": [
{ "entity": "profile", "fields": ["tldr"] },
{ "entity": "profile", "fields": ["tldr", "name"] },
{ "entity": "experiences", "fields": ["*"] }
],
"ui": ["experience"]
+1 -1
View File
@@ -2,7 +2,7 @@
"id": "philosophy",
"route": "/philosophy",
"content": [
{ "entity": "profile", "fields": ["philosophyQuotes"] }
{ "entity": "profile", "fields": ["philosophyQuotes", "name"] }
],
"ui": ["philosophy"]
}
+2 -1
View File
@@ -5,7 +5,8 @@
{
"entity": "projects",
"fields": ["title", "summary", "role", "metrics", "technologies", "category", "sections.*"]
}
},
{ "entity": "profile", "fields": ["name"] }
],
"ui": ["projectDetail"]
}
+2 -1
View File
@@ -2,7 +2,8 @@
"id": "projects",
"route": "/projects",
"content": [
{ "entity": "projects", "fields": ["*"] }
{ "entity": "projects", "fields": ["*"] },
{ "entity": "profile", "fields": ["name"] }
],
"ui": ["projects"]
}