Repository navigation
fix(plugin-dashboard,app-shell): a served dashboard and a served list view are drawn as served, not re-translated by the packaged bundle (objectui#11295) - #11303
Conversation
…, description and sub-caption as given (objectui#11295) DashboardRenderer gains a `localized` prop: the host says the document was read from the server's `/meta` route, already translated for the request's locale with a published edit kept over the packaged catalog. The widget title, description and sub-caption, and the renderer's own header label and description, then skip the client bundle lookup; an inline per-locale map is still collapsed. Without the prop the bundle composition is unchanged. Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
…s served (objectui#11295) DashboardView draws the served dashboard's label and description as given and passes `localized` to DashboardRenderer. The view switcher tabs (desktop and mobile), the record page's way-back label and the breadcrumb draw a view's label as given when the `/meta/view` read served that view (`useServedViewItems`, by identity); a view embedded in the object document or derived client-side keeps the bundle, its only translation. The breadcrumb matches the URL's view through `resolveViewId`, so a bare `/view/<key>` finds the qualified served view instead of the slug. Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
…translated once (objectui#11295) Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
… and label, not the view object (objectui#11295) The two way-back sites list those three members as their hook dependencies; passing the whole object made `react-hooks/exhaustive-deps` ask for it. The warning count on ObjectView.tsx is back to the base's. Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Inputs: card objectui#11295 (body, claim ① Derived judgments
② Semver level
③ Boundary flagsEvery dev flag (
Implemented-by: VERDICT: PASS |
…shboardRenderer gains the public `localized` prop (objectui#11295) Patch round 1: the contract review read the new prop (and the same flag on `useWidgetSubCaption`) as new public API of a published package, so the plugin-dashboard changeset moves from patch to minor. app-shell stays patch. Claude-Session: https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ Co-authored-by: Claude <noreply@anthropic.com>
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Delta record on PR #11303 at ① Derived judgments
② Semver level
③ Boundary flagsEvery dev flag (
Implemented-by: VERDICT: PASS |
Fixes #11295
Clause-②: yes
A served document is translated once, by the server. When the console draws a dashboard or a list view that came from the
/metaread, it now draws the served title and description as given. That read already resolved them for the request's locale, with a published edit kept over the packaged catalog. The client bundle stays the one translation pass for documents the server did not translate: inline blocks, previews, design surfaces, views embedded in an object document, and client-derived tabs. ⛔ No client copy of the server's override rule, and ⛔ no string comparison.What changed
@object-ui/plugin-dashboardDashboardRenderergains alocalizedprop. With it, these texts skip the bundle lookup: the widgettitle,descriptionand sub-caption (options.description), and the renderer's own headerlabelanddescription. An inline per-locale map is still collapsed.useWidgetSubCaption(dashName, localized)takes the same flag.translateDashboarddoes not translate them.@object-ui/app-shellDashboardViewsetslocalized, and draws the served dashboardlabelanddescriptionin its page header as given.hooks/useServedViewItems.tsanswers one question: did the/meta/viewread serve a document under this view's identity?ObjectViewdraws such a view's label as given, through one helper (viewTabLabel). That covers the desktop tab bar, the mobile switcher and the record page's way-back label. Every other view still goes throughviewLabel.AppHeader's breadcrumb matches the URL's view withresolveViewId, the matcher the object page opens it with, and names a served view and a served dashboard as given.packages/plugin-dashboard) andcontent/docs/plugins/plugin-dashboard.mdxdocument the prop. There is one patch changeset per released package.The signal (dispatch Zone 2, item 2)
Nothing existed to read. The served document carries no marker:
translateMetaDocument/translateMetaListreturn the translated document only. There is also no per-document context:MetadataProvideris a type cache, and a provider-wide context would wrongly cover inline and preview documents rendered under it. So the signal has two carriers.localized, set where the served document is handed to the renderer (DashboardView, whose document isuseMetadata().dashboards).@object-ui/plugin-dashboardcannot see where its document came from./meta/viewread's own cache (useServedViewItems+isServedView). A per-view answer is needed, because one tab list mixes three sources:/meta/view;/meta/object;Premises, measured
origin/main5f6b63a6fd,translateMetaList/translateMetaDocument(packages/rest/src/meta-item-read-gate.ts) runtranslateDashboard/translateView, withpackagedBasefor both.translateDashboardcoverslabel,description,globalFilters, and per widgettitle/description/ sub-caption. It does not coverheader.actions.5908785750(browser,enandzh-CN).translateObjectdoes not translate an object's embeddedlistViews. That object-document channel is not the view document the card names. The platform's own objects use it, for examplesys_account'smineview, with_viewskeys inen.objects.generated.ts.origin/main:translateObjecthas nolistViewsread, and nothing on the server turns an object'slistViewsinto view items.@objectstack/spec17.5.0translateMetadataDocumentunderzh-CNtranslated an object'slabel(Accountbecame账户) and a view item'slabel(In Progressbecame进行中). It left the object's embeddedlistViews.mine.labelasMy Links.ObjectViewhandedview.labeltoviewLabelas the fallback, and the packaged_views.KEY.labelwon (thezh-CNreading)./view/in_progressmissed the qualifiedshowcase_task.in_progressand drew the humanized slug,In Progress, whatever was served (theenreading). Second, the bundle (thezh-CNreading).packages/i18n/src/useObjectLabel.tsand nothing inpackages/layout.widgetSubCaption.ts's header claimed a served document "never reaches limb 2". That was false, because limb 2 ran on every widget with an id. It is now true, throughlocalized.Tests (at
5c84eb4b5bunless noted)enandzh-CN:DashboardRenderer.servedLocalized-11295.test.tsx(6)DashboardView.servedLocalized-11295.test.tsx(4)ObjectView.servedViewLabel-11295.test.tsx(6, realViewTabBar)AppHeader.servedLabels-11295.test.tsx(10)e3782d26ec(no fix) gave 2 failed / 4 passed. The 2 red cells are the published-edit cells; the unedited and inline cells stay green.e3782d26ec. The on-disk proof:localized/servedViewsoccurrence counts were 0 in all five. The 4 pin files then gave 12 failed / 14 passed of 26, the predicted split: 2 + 2 + 6 + 2 red, every unedited and control cell green. The files were restored withgit checkout HEAD --.git diff HEADwas empty, and all 5 blob hashes equalHEAD.DashboardView,localizedwas swapped for an unknown prop.tsc --noEmitin app-shell then failed with TS2322 againstDashboardRendererProps, so the app-shell type-check holds the rebuilt prop type. Restored, blob equalsHEAD.pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build: exit 0. The rebuiltdist/DashboardRenderer.d.tsanddist/widgetSubCaption.d.tscarrylocalized.pnpm --filter @object-ui/plugin-dashboard type-checkandpnpm --filter @object-ui/app-shell type-check: exit 0. Both chaintsconfig.test.json, so the new tests are compiled.pnpm exec vitest run packages/plugin-dashboard/: 156 files, 1426 passed, 6 skipped, at27fa9a0f1b. The later commit touches onlypackages/app-shell/src/views/ObjectView.tsx, which no plugin-dashboard test can import.ObjectView*,DashboardView*andlayout/;git grepfortWidgetTitle,widgetTitle(,viewLabel(oruseWidgetSubCaptionfinds;apps/console,examples/schema-catalog,collaboration,data-objectstack,plugin-grid,plugin-view,sdui-parser,types,i18nandscripts/__tests__.5c84eb4b5b:check-changeset-presence: 2 released packages, 2 changesets;changeset:check;check:new-line-citations: 0 new;check:control-bytes,check:doc-fences,check-doc-links;check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:test-path-roots;check:unreferenced-sources,check:changeset-claims,check:pending-changeset-literals,check:phantom-deps,check:self-import.eslint.config.jsscopes its rules to**/*.{ts,tsx}, so all 10 changed TS files are in it.eslint --format jsonover them gave 10 files, 0 errors.parserOptions/projectService, so no type-aware rule exists and untouched files cannot move.check:doc-snippets: PREREQUISITE NOT MET. It needs 34 built packages, and this run built the app-shell closure. The docs edits are prose, with no code fence added. CI runs it.check:readme-exports: the same reason. No README fence or export changed.pnpm lint: owned by CI.Acceptance notes
Recorded here; nothing filed from this run.
listViewsare not translated by the server.translateObject(objectstackpackages/spec/src/system/i18n-resolver.ts) never reads them.os i18n extractwrites_viewskeys for them.spec:translateObject (objects[].listViews.*.label)→runtime: /meta/object→renderer: ObjectView tab. The HTTP door is not measured.useObjectLabel(useNavTargetLabel,UnifiedSidebar,nav-menu-renderer). That is the same second pass over a served view or dashboard label. Not measured, and not touched here: the nav label path is objectui#11201's area.objectLabel(objectDef)re-resolves a served object label through the bundle. The server keeps an explicit objectlabeledit since objectstack#8284. This is the same class, not measured, and not in this card's scope.PACKAGED_BASE_ACCESSORSis object, dashboard and view), so nothing differs visibly yet.Same-day churn
mainmoved 4 commits past base (d79f525d9e). None of them touches a file here,useObjectLabel.tsorMetadataProvider.tsx, so the branch was not merged.Session:
https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ(domain:ui seat 1, dispatched os-dev run).Generated by Claude Code