Repository navigation
fix(service-settings): move the storage, knowledge and AI warnings into info_banner rows - #23958
Conversation
…to info_banner rows
Each of the four warnings that sat inside a namespace description or a
field's help string becomes an info_banner row with bannerSeverity
'warning', an id, a title and a body, placed in the section it concerns
directly under the field it warns about. The translations move with them
into settings.NAMESPACE.banners.BANNER_ID.{title,text} in every shipped
locale, and the feature-flags beta_notice banner gains its copies too.
The settings translation coverage test now covers banners in both
directions, and a sweep pins that no manifest or bundle description or
help string carries the warning glyph.
Claude-Session: https://claude.ai/code/session_018VqJPGA1NDNSCZsnecsChP
Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check4 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 97ce241e017115147b3ac624c7aef046a83a97cf && git checkout 97ce241e017115147b3ac624c7aef046a83a97cf
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7277c07f6883fbb5e8893cbe5ad91dd482f83723 c396797fd5ecedb4a59ba9284ee78f2f02f2e1f6 && git checkout -B drift-repro 7277c07f6883fbb5e8893cbe5ad91dd482f83723 && git merge --no-ff c396797fd5ecedb4a59ba9284ee78f2f02f2e1f6
node scripts/docs-audit/affected-docs.mjs --json 7277c07f6883fbb5e8893cbe5ad91dd482f83723 |
席位核对 · review · held for the land-after gate ·
|
Fixes #23839
Clause-②: no — the bundles fill a slot the spec already declares, and no setting's key, value, default or save behaviour changes. Measured: the package's built
dist/index.d.tsanddist/index.d.ctsare byte-identical at the base and at this head.Landing gate: keep this PR draft
This PR stays draft until objectstack's
.objectui-sha(nowdaeb77fc84) carries objectstack-ai/objectui#12671's banner reader, because until then the console draws each banner's English literal and zh-CN, ja-JP and es-ES admins would lose the translated warnings they read today.What changes
Four warnings were sentences inside ordinary strings, each starting with a hand-typed warning glyph, so the admin read them as one more sentence of the page subtitle or of a toggle's help. Each one is now an
info_bannerrow withbannerSeverity: 'warning', anid, a shortlabel(its title) andbannerText. It sits in the section it concerns, directly under the field it warns about:idstorageadapter_switch_warningdescriptionknowledgeadapter_switch_warningdescriptionknowledgeenforce_rls_warningenforce_rlshelp (description)ailog_prompts_warninglog_promptshelp (description)Each string keeps its non-warning text:
enforce_rlskeeps "Re-check every hit against the caller's record-level permissions via IDataEngine."log_promptskeeps "Include rendered prompts (not just metadata) in trace rows."feature-flags.manifest.tsis unchanged: itsbeta_noticebanner already had anid.Translations
In the
en,zh-CN,ja-JPandes-ESbundles, each warning sentence left the bundle'sdescription/helpcopy and now sits undersettings.NAMESPACE.banners.BANNER_ID.{title,text}, the slot PR #23886 declared. The translated sentences are the ones each bundle already carried, moved without the glyph and not re-translated. Each banner has a new short title in every locale:storage.adapter_switch_warningknowledge.adapter_switch_warningknowledge.enforce_rls_warningai.log_prompts_warningfeature_flags.beta_noticeThe Feature Flags
beta_noticebanner gained copies in all four bundles, since the coverage test now requires them.Pins
settings-translation-coverage.test.tscovers banners in both directions. Everyinfo_banneridneeds atitleand atextin zh-CN, ja-JP and es-ES. A banner with noidis reported, because no locale can address it. No locale (en included) may carry a banner id the manifest does not declare.description,helpTextand specifier help, and every locale'sdescription, groupdescriptionand keyhelp: none may contain the warning glyph. Each sweep also asserts it read more than 50 strings, so it cannot pass on an empty set.storage.manifest.test.ts,knowledge.manifest.test.tsandai.manifest.test.tseach pin three things: the exact set ofinfo_bannerids withbannerSeverity: 'warning'; that each banner has a label and a body and sits in its section directly under its field; and that the glyph appears nowhere in the serialized manifest.Evidence (head
c396797fd5)Package suite:
pnpm --filter @objectstack/service-settings exec vitest run --maxWorkers=2gaveTest Files 47 passed (47),Tests 845 passed (845).pnpm --filter @objectstack/service-settings typecheck(tsc --noEmit) exited 0, and--listFilesshows all four edited test files in the program.Runtime probe (one-off, not committed):
PlatformTranslationDataSchema.safeParseon each shipped bundle gavesuccess=truefor en, zh-CN, ja-JP and es-ES. Every pair of the 5 banners and 4 locales (20 in all) resolved throughresolveSettingsBannerTitle/resolveSettingsBannerTextfrom the bundle; none fell back to the manifest literal.Ablations were run through
scripts/ablation-replace.mjsin wrap mode, on the four test files (105 tests), with the tests readingsrcby relative import, so nodistwas involved. Each restore was proven: blob equals HEAD, andgit diff HEADwas empty.adapter_switch_warningtoadapter_switch_warninzh-CN covers settings.storage(missingbanner:adapter_switch_warning.title,.text) andzh-CN carries no copy for a group, key or banner no manifest declares(storage.banner:adapter_switch_warnin), 2 faileddescriptioncarries the warning glyph nowhereand the sweep (storage.description), 2 failedlog_prompts_warningtobannerSeverity: 'info'declares it as a warning-severity info_banner, 1 failedlog_promptshelpja-JP carries the warning glyph in no description or help copy(ai.keys.log_prompts.help), 1 failedDeclaration closure: the seven edited source files were put back to the base in the working tree only, the package was rebuilt, and then the files were restored to HEAD (blob proof) and rebuilt again.
dist/index.d.tsanddist/index.d.ctsare byte-identical (md568d6b431c4c7fe099f1fe841af3ac690both sides). Every edited export is declared with a named type (SettingsManifest,PlatformTranslationData,PlatformTranslationBundle).Local gates:
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 63 commands atc396797fd5. 62 exited 0.pnpm check:dual-build-cjs-loadsexited 3 withPREREQUISITE NOT MET(it needs every package'sdist), so it is NOT MEASURED locally and is left to CI.--ranreconciliation:63 derived famil(ies) accounted for — 62 run, 1 NOT-MEASURED, 0 unrun.Acceptance notes
entext is the manifest's full sentence, because theenbundle's header says it mirrors the manifest literals. The oldencopy carried shortened warnings ("Switching adapter does NOT migrate existing indices."; "Disabling skips the platform's unique safeguard."), so English admins now read the full sentence the manifest always had. ja-JP and es-ES had translated the shortened copies, and those moved as they were.enand translated knowledge descriptions omit "The embedder is configured separately under AI.", and theenforce_rlshelp in en, ja-JP and es-ES omits "via IDataEngine". Both differences predate this PR, and only the warning sentence was removed here.bannerSeverityis now the only warning marker. At the pindaeb77fc84, the console draws every non-errorseverity in the default Alert variant with an Info icon, and rendersbannerTextas plain text. Both renderer findings belong to Settings pages: no duplicated action labels, warnings out of the subtitle, Cloud Connection says its sentence once objectui#12610's owner and are not re-filed here. Until that change lands, these banners look like info callouts. Each is still its own titled callout under its field.origin/mainadvanced to8f4260fe66while this ran. None of those commits touchespackages/services/service-settingsorpackages/spec/src/system, so the branch was not merged again before opening.Generated by Claude Code