Landing text for the chat bubble: proposal

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.

SP-894 · For review by Toan (frontend lead) · 29 Nov 2026

Status as of 29 Nov 2026

Stage
Proposal. Waiting for Toan's answers. No code change yet for this design.
PR
#796 is open with the earlier design (DB text and admin editor). It would be reworked if this proposal is accepted.
Ticket
SP-894, In Progress

The one decision we need from Toan

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).

What exists today

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.

PieceOwnerState (29 Nov)Touches the homepage?
PR #796 SP-894: store landing text in the DB, admin Text tab, sync to chatbotKhai HoanOpen, Claude review approved, 1 merge conflict with mainYes: lays DB text over landing-v2 at runtime
lms-ragflow#12 chatbot scopes a document to one LMS environmentKhai HoanMerged 25 NovNo
PR #787 SP-903: landing header and footer (adds landingChrome namespace)ToanOpenYes
PR #739 SP-903: build-time HTML for / from bundled JSONToanOpen, waits for D1Yes: renders hero and headings at build
PR #746, #767 design locks (legal pages, header and footer)ToanOpen, docs onlyNo

The landing text today:

Where PR #796 collides with the homepage work

PR #796 works, but it creates a second copy of the landing text. That copy fights with how Toan's team ships the homepage.

#ProblemConcrete exampleSeverity
1JSON 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
2Key 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
3Text 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
4SEO 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
5Only 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
6Global 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
7Merge 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.

Options

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 isB. JSON stays the source; build exports knowledge (recommended)C. DB stores only overrides
Who edits textAdmin in the app, or a PR (DB wins)PR only, as todayPR, plus admin overrides per string
JSON edits still showNo, after the first saveYesYes, unless that string has an override
Landing page runtime changeExtra API call, text swap after paintNoneExtra API call, text swap after paint
Works with #739 static HTMLPartly (hero mismatch)YesPartly
Covers FAQ, competitions, instructorsNoYes, by configOnly what the editor covers
Beta and production each get their own textYes, per DBYes: each reads its own buildYes
Work leftRebase, fix conflictSmall build step, reuse most of the #796 backendOverride model, stale marking, editor changes
Main riskSilent loss of Toan's editsText changes still need a deployMore 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.

Proposed design (Option B)

The only new frontend piece is one build output. Everything after it is backend work that PR #796 already has.

The bubble learns the landing text from each build Frontend · Toan reviews Backend · reuses PR #796 Chatbot · lms-ragflow, no change Edit landing JSON landing-v2, FAQ, competitions through a normal PR Merge and deploy beta on merge to main production on release Build exports the text writes landing-knowledge.json skips pricing, _placeholders Backend fetches the file from its own frontend URL on startup and every hour Hash changed? yes no: stop, nothing is embedded Upload to the chatbot Markdown, stable id per tenant and language Replace the old document old chunks stay if it fails scoped to beta or production Bubble answers new text signed-in chat, vi and en no manual upload

How it works, step by step:

Questions for Toan

  1. Source of truth. Do you agree the i18n JSON stays the only place to edit landing copy (Option B)? Or do you expect a non-developer editor soon (Option C)?
  2. Which namespaces. Proposed set: landing-v2, FAQ, competitions, and the shared instructors data. Leave out landingChrome (header and footer labels), hallOfFame (names of children), legalHelp. Is this right?
  3. What is not approved. We will skip _placeholders and pricing. Are there other keys that hold draft or fake text today?
  4. Copy inside components. Some text is written in section components, not in JSON. Is any of it a fact a visitor would ask about (dates, contacts, prices)? If yes, can it move to JSON?
  5. Build step owner. The knowledge file would be written by a Vite plugin next to build/staticPagesPlugin.ts. Are you fine with that location, and do you want to review that file?
  6. Flag. With the single landing flag (#774), does production show v2 today? We plan to export the v2 text only.
  7. Key names. The bubble document uses key paths as context, for example roadmap.rules.title. Are your key names stable and meaningful enough, or should the config add a readable label per section?

Plan, PR #796, and verification

What happens to PR #796. We keep its backend sync work and drop the editing parts.

Keep

  • Chatbot upload client and the X-LMS-Environment header
  • Markdown builder and hash; skip pricing and _placeholders
  • Sync service, daily cron, Discord alert on repeated failure
  • Table as sync state only: locale, hash, synced at, last error (no text column)

Drop

  • Admin Text tab and its hooks
  • Public landing content endpoint and the useLandingContent overlay
  • bindI18nStore: "added" in the i18n setup
  • Admin save endpoint and the full-text content column

Steps

  1. Toan answers the questions above.
  2. Frontend PR: the Vite plugin writes landing-knowledge.json, plus a config file of included namespaces and skipped keys. Toan reviews.
  3. Backend PR: rework #796 so the sync fetches that file instead of reading the DB text. New Alembic revision for the slimmer table.
  4. Merge to beta. Check one real upload. Then production with the next release.

Risks

Verification (from the ticket)