Repository navigation
fix(app-shell): resolve inline locale-map view and page labels; a map view label no longer blanks the Console - #25997
Merged
Conversation
… drawing them viewTabLabel resolves the view's I18nLabel in the viewer's language before either branch, so a map label never reaches the header, tab bar, mobile switcher or record back-link as an object. InterfaceListPage resolves its page label and description the same way. Claude-Session: https://claude.ai/code/session_01WVwANq56oyBZtcDWbWGfva Co-authored-by: Claude <noreply@anthropic.com>
…geset Claude-Session: https://claude.ai/code/session_01WVwANq56oyBZtcDWbWGfva Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · seat
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
Fixes #25901
Clause-②: no
Metadata-protocol: none
What was wrong
@objectstack/spectypes a list view'slabel, and a page'slabel/description, asI18nLabel: a string or an inline locale map. Two Console readers did not handle the map.viewTabLabelreturnedview.labeluntouched. On the served branch it was drawn as given. On the other branch it was handed to the bundle'sviewLabelas the fallback, and the bundle returns the fallback unchanged on a miss. The server does not stop a map from reaching it:translateObjectListViews/translateViewonly overlay catalog text, so a map with no_views.KEY.labelentry is served as authored. On a/view/NAMEroute the app header rendered that object as a React child and threwObjects are not valid as a React child (found: object with keys {en, zh-CN}).AppHeaderis mounted byConsoleLayout, outside the only routeErrorBoundaryinAppContent, so the throw unmounted the whole Console. That held for a served view and for a client-derived one alike. Measurement posted on the card before any code: console: a page or list view whose label is an inline locale map shows a machine name (InterfaceListPage) or reaches viewTabLabel raw (AppHeader view branch, ObjectView tab bar) #25901 (comment) The same value also fed the object page's tab bar, the mobile view switcher and the record page's way back.typeof page.label === 'string' ? page.label : page.name, so a map label showed the machine name. A mapdescriptionwas dropped.The fix (producer side)
viewTabLabel(ui/packages/app-shell/src/views/viewTabLabel.ts) takes the viewer'slanguageand resolves the label withmetadataTextbefore either branch. This is the app-shell helper fix(app-shell,components): resolve a page's inline locale label and description to the viewer's language (objectui#13488) objectui#13501 used. The served/derived split is unchanged: a served view's resolved text is drawn as given, and any other view's resolved text becomesviewLabel's fallback, so a catalog entry still wins there. A map that resolves to no text counts as nolabeland is drawn as the object's plural label, like a label-less view.languagefromuseObjectTranslation(), the same channel the header's othermetadataTexttitles use, so the header and the tab agree. Four are inObjectView.tsx, in the view-tab regions only (mobile switcher, record way back twice, tab bar), plus the hook destructure. The fifth is theAppHeader.tsxview-route title.InterfaceListPageresolvespage.labelandpage.descriptionwithmetadataText. The machine name is the heading, andcfg.source || 'Record'the drawer title, only when no label resolves.plugin-view'sViewTabBaris not changed. ItsViewTabItem.labelis typedstring, and the producer now honours that type.Tests
AppHeader.inlineViewLabel-25901.test.tsx: a served map view and a derived map view, each inenandzh-CN, plus an empty map, with an empty bundle so no catalog entry can stand in for the map.viewTabLabel.inlineLabel-25901.test.ts: the served branch never asks the bundle; the derived branch hands the bundle the resolved text; a catalog entry still wins; an empty or blank map gives the unlabelled text; string controls.InterfaceListPage.inlineLabel-25901.test.tsx: the realMetadataProviderunder a realI18nProvider. Map heading and description inenandzh-CN, an empty map falls back to the machine name, and a string control.viewTabLabel.tsandInterfaceListPage.tsxrestored to base0c372288, with a trap restoring fromHEAD):12 failed | 4 passed (16). The 4 that stayed green are the controls (catalog wins, string control, empty-map machine-name fallback, string page). Restore was proven by an emptygit diff HEAD.16 passed (16). At head615a9c05, the 119 app-shell test files whose names matchObjectView/AppHeader/InterfaceListPage/viewTabLabel/ServedView/servedLabels:Test Files 119 passed (119),Tests 995 passed (995). Declared narrowing: the whole app-shell suite (1725 files) did not finish in 40 minutes under the shared verify lock and was stopped, so it is left to CI (Test Core).pnpm --filter @object-ui/app-shell type-check(bothtscprojects) exit 0.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 34 families at615a9c05. All 34 ran locally with exit 0.--ranreconciliation: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN (a derived zero, with every exit code recorded). Everything else is CI's.Acceptance notes
ObjectView's delete-view confirmation interpolatestargetView?.label || vidinto its prompt. A map label there would read[object Object]. It is reachable only for saved (sys_view-backed) views, whose labels come from the Console's own add and rename inputs as strings. This is outside the view-tab regions and was left alone. Carrier: none.AppHeadersits outside every error boundary, so any render throw in the header blanks the whole Console, not just the route. This PR removes the trigger that was measured. The boundary placement itself is unchanged. Noted, not filed. Carrier: none.Generated by Claude Code