Keep the landing JSON files as the only source of the landing text. Let the chat bubble learn from them automatically after each deploy. Drop the admin text editor from PR #796.
Do you agree that the i18n JSON (landing-v2.json and friends) stays the single source of truth for landing copy?
If yes, the frontend build writes one small knowledge file, and the backend uploads it to the chatbot when it changes. Your homepage work does not change, and no runtime code is added to the landing page.
If you think non-developers must edit landing text without a PR soon, say so. Then we keep a database editor, but in a safer form (Option C below).
The chat bubble answers from a hand-written knowledge base, "accurate as of July 2026". Nobody updates it when the homepage changes. SP-894 asks that each homepage change updates the bubble's knowledge by itself.
| Piece | Owner | State (29 Nov) | Touches the homepage? |
|---|---|---|---|
| PR #796 SP-894: store landing text in the DB, admin Text tab, sync to chatbot | Khai Hoan | Open, Claude review approved, 1 merge conflict with main | Yes: lays DB text over landing-v2 at runtime |
| lms-ragflow#12 chatbot scopes a document to one LMS environment | Khai Hoan | Merged 25 Nov | No |
PR #787 SP-903: landing header and footer (adds landingChrome namespace) | Toan | Open | Yes |
PR #739 SP-903: build-time HTML for / from bundled JSON | Toan | Open, waits for D1 | Yes: renders hero and headings at build |
| PR #746, #767 design locks (legal pages, header and footer) | Toan | Open, docs only | No |
The landing text today:
landing-v2.json (vi and en): 282 text values in 16 top-level keys. pricing and _placeholders are not approved yet.FAQ, competitions, hallOfFame, and the shared instructors data.landing-v2.json, not only Toan. Example: SP-951 (Khang, #788) reworded 18 Vietnamese strings on 24 Nov.PR #796 works, but it creates a second copy of the landing text. That copy fights with how Toan's team ships the homepage.
| # | Problem | Concrete example | Severity |
|---|---|---|---|
| 1 | JSON edits stop showing. After the first admin save, the DB row holds the full text for that language. Each saved string wins over the JSON. | Toan fixes a typo in hero.title through a PR. It merges. The page still shows the old DB text, with no warning. | High |
| 2 | Key renames lose edits silently. The bundle decides the shape, so a renamed or moved key drops its saved text. | Toan splits roadmap into roadmap.rules and roadmap.drawing. Admin edits under the old keys disappear. | Medium |
| 3 | Text swap after first paint. The page paints the bundled text, then replaces it when the API answers. | Visitor sees the old hero line, then it changes. This also breaks the build-time HTML of #739, which renders the bundled hero. | Medium |
| 4 | SEO text does not follow. #796 notes the static head still uses bundled SEO text. | Admin edits seo.title; Google still sees the JSON title. | Low |
| 5 | Only part of the page. Only landing-v2 is covered. FAQ, competitions, instructors, and text inside components are not. | Bubble knows the hero but not the FAQ answers on /faq. | Medium |
| 6 | Global re-render. bindI18nStore: "added" re-renders every mounted useTranslation component when any bundle is added. | Extra renders across the app, also outside the landing. | Low |
| 7 | Merge conflict. A landing test file was deleted on main. | Easy to fix, but the PR must be rebased. | Low |
Problems 1 to 3 are the reason for this proposal. They come from having two writable copies of the same text.
We recommend Option B. It meets the ticket goal ("each time Toan updates the landing page, the bubble updates") with no change to how the homepage is built or shown.
| A. Merge PR #796 as is | B. JSON stays the source; build exports knowledge (recommended) | C. DB stores only overrides | |
|---|---|---|---|
| Who edits text | Admin in the app, or a PR (DB wins) | PR only, as today | PR, plus admin overrides per string |
| JSON edits still show | No, after the first save | Yes | Yes, unless that string has an override |
| Landing page runtime change | Extra API call, text swap after paint | None | Extra API call, text swap after paint |
| Works with #739 static HTML | Partly (hero mismatch) | Yes | Partly |
| Covers FAQ, competitions, instructors | No | Yes, by config | Only what the editor covers |
| Beta and production each get their own text | Yes, per DB | Yes: each reads its own build | Yes |
| Work left | Rebase, fix conflict | Small build step, reuse most of the #796 backend | Override model, stale marking, editor changes |
| Main risk | Silent loss of Toan's edits | Text changes still need a deploy | More moving parts; editor must show stale overrides |
About Option C. It is the path if marketing must edit without a PR. It stores only changed strings, each with a hash of the JSON text it replaced. When the JSON string changes later, the override is marked stale and the editor shows it. We suggest doing B now and C only when there is a real need.
The only new frontend piece is one build output. Everything after it is backend work that PR #796 already has.
How it works, step by step:
build/staticPagesPlugin.ts, reads the included namespaces for vi and en. It drops skipped keys, link-only values and image paths. It writes dist/landing-knowledge.json. A config file next to the landing lists what is included, so Toan controls it in review.chatbot.document_embed usage metered as today.landing-v2, FAQ, competitions, and the shared instructors data. Leave out landingChrome (header and footer labels), hallOfFame (names of children), legalHelp. Is this right?_placeholders and pricing. Are there other keys that hold draft or fake text today?build/staticPagesPlugin.ts. Are you fine with that location, and do you want to review that file?roadmap.rules.title. Are your key names stable and meaningful enough, or should the config add a readable label per section?What happens to PR #796. We keep its backend sync work and drop the editing parts.
X-LMS-Environment headerpricing and _placeholdersuseLandingContent overlaybindI18nStore: "added" in the i18n setuplanding-knowledge.json, plus a config file of included namespaces and skipped keys. Toan reviews.landing-v2.json string, deploy to beta, and show that the bubble answer changes with no manual step.chatbot.document_embed ledger rows.