Skip to content

fix(app-shell): count an object document's served listViews as served views (objectui#11336) - #11620

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-11336-served-listviews
Oct 4, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-11336-served-listviews

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11336
Clause-②: no

What changed

@objectstack/spec 17.6.0 (objectstack-ai/objectstack#21072, c27404f0a9) translates the listViews an object document embeds on the server, from objects.OBJECT._views.KEY and with a published edit kept over the packaged catalog. The console still ran its own catalog over those labels a second time. This PR counts such a view as served, so the switcher tab and the breadcrumb draw its label as given.

  • packages/app-shell/src/hooks/useServedViewItems.ts
    • isServedView(served, objectName, viewId) answers true for a /meta/view document named viewId, as before. It now also answers true when viewId is a key of the served objectName document's own listViews.
    • That document is read before the merge, from useMetadata().getItemsByType('object'). The merged listViews the label sites hold mixes the document's own entries with view documents and a container's expansion, and only the document's own entries were translated by translateObject.
    • Only the canonical listViews key is read, and the entry must be a record. The server translates no other spelling, so a view a stored document embeds under the legacy list_views keeps the bundle. The probe below measures this.
    • useServedViewItems() returns both reads as one record. It is held in a module-level WeakMap keyed on the two cache arrays, so its identity depends on the payloads, never on a React memo (AGENTS.md [WIP] Enhance every detail of the designer #10).
    • The docblock bullet "The server's translateObject does not translate those" is corrected.
  • packages/app-shell/src/views/ObjectView.tsx (viewTabLabel, viewOriginLabel) and packages/app-shell/src/layout/AppHeader.tsx (the crumb) now pass the object name to the predicate. Their comments now name both reads.
  • Tests:
  • .changeset/11336-served-embedded-listviews.md: @object-ui/app-shell patch.

No export, prop, type member or i18n key is added to any package entry. useServedViewItems and isServedView are not reachable from @object-ui/app-shell's entry: exports maps only . and ./styles.css, and both names are absent from src/index.ts and src/hooks/index.ts. The control useRecentItems has 2 hits in src/index.ts.

Premise check (measured on origin/main, not taken from the card)

  • The label sites read the served object. ObjectView and AppHeader receive objects from useMetadata().objects (AppContent). That getter is mergeViewsIntoObjects(readType('object'), readType('view')). getItemsByType('object') returns the cache's own /meta/object items, mutated only by normalizeSchemaReferenceKeys, which touches field reference keys. The merge copies the served document's own listViews entries under their record keys, and those keys win collisions. So an embedded tab's id is the key the served document carries.

  • The server translates them. A probe ran against the installed @objectstack/spec 17.6.0 (system.translateObject, locale zh-CN, a catalog with objects.sys_account._views.mine.label):

    Case Served label
    listViews.mine 我的链接
    sibling other, no catalog entry Other
    mine carrying an org edit (Links I own), with packagedBase Links I own (the catalog loses)
    legacy list_views.mine My Links (untranslated)
  • Not translated by any server: a stack container's expansion. translateView does not walk a container's nested listViews, so that kind still goes through the bundle.

Evidence (head 0a2c2af)

  • pnpm exec vitest run on the three touched test files (repo-root spelling), before the merge at 5b212d6: Test Files 3 passed (3), Tests 35 passed (35). The full-package run below covers them again on the merged head.
  • Reverse verification, run after commit through ablation-replace.mjs (anchor hit 1 time; blob changed, then restored equal to HEAD; git diff HEAD empty afterwards). The object-document branch was cut (if (!objectName) return false; became return false;), and the predicted cells went red: Tests 7 failed | 28 passed (35).
  • pnpm --filter @object-ui/app-shell type-check (tsc --noEmit && tsc -p tsconfig.test.json): exit 0 on the merged head, after the @object-ui/app-shell^... dependency closure was built. tsc -p tsconfig.test.json --listFiles lists all three touched test files.
  • pnpm exec vitest run packages/app-shell/ on the merged head: Test Files 1000 passed | 1 skipped (1001), Tests 9930 passed | 9 skipped (9939), exit 0. The run held the shared verify lock; wall-clock figures are omitted because the box is shared.
  • ESLint on the six touched source and test files: 0 errors. Per-file warning counts equal fd060f0767's (ObjectView 174, AppHeader 22, the two plugin-dashboard: a served, already-translated widget title (and a view tab) is re-translated by the packaged bundle, so a published edit shows the shipped string: objectui half of objectstack-ai/objectstack#20680 #11295 suites 3 and 17, the hook 0). The new unit file has 0 warnings.
  • Root gates run locally, each exit 0: check-changeset-presence, check-changeset-no-major, check:changeset-claims (with the changeset committed), check:pending-changeset-literals, check:new-line-citations (0 new), check:control-bytes, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:test-path-roots, check:unreferenced-sources. CI runs the rest.

Acceptance notes

  • Older servers. A console with this change, talking to a server whose spec predates c27404f0a9 (17.0 to 17.5), draws embedded views' labels as authored. Today the console's second pass translates them. I found no version gate in app-shell: the only server-capability signals it reads are the runtime config's features.* flags, and none of them says "embedded listViews are served translated". The CLI-shipped pairing is unaffected, because @objectstack/console is built at the objectui SHA pinned per framework release. The exposed pairing is @object-ui/console run on its own cadence against an older 17.x server. No gate is added here; the question is in the report.
  • Observation, out of this card's surface and not filed: useNavTargetLabel (nav-entry labels) passes a view's label through viewLabel without asking isServedView, for both channels. No reproduction was run, and no carrier is known.
  • objectui#11303 kept the console path for embedded listViews because the server did not translate them then. That reason is gone with 17.6.0, which pnpm-lock.yaml resolves.

Implemented by the dispatched os-dev agent, session https://claude.ai/code/session_015W8GBu6sBiqus2L2xjMsAL.


Generated by Claude Code

claude added 5 commits October 4, 2026 14:29
… views (objectui#11336)

`@objectstack/spec` 17.6.0 (objectstack#21072) translates the listViews an
object document embeds on the server, keeping a published edit over the
packaged catalog. `isServedView` now also answers true for a tab id that is a
key of the served `/meta/object` document's own `listViews` (read pre-merge,
canonical key only), so the switcher tab and the breadcrumb draw that label as
given instead of running the client bundle over it a second time. The hook's
docblock bullet that said the server does not translate those is corrected.

Claude-Session: https://claude.ai/code/session_015W8GBu6sBiqus2L2xjMsAL
Co-authored-by: Claude <noreply@anthropic.com>
…he crumb (objectui#11336)

The tab and the crumb draw the label the `/meta/object` read served for a view
the object document embeds (zh-CN served string; a published edit over the
packaged string); a view with no catalogue entry keeps its authored label; a
view only the client derived (a stack container's expansion) is still named by
the bundle. The #11295 suites' worlds now serve the object document as well,
and their stale "the server does not translate listViews" prose is corrected.
A unit file pins the predicate's edges and the hook's identity.

Claude-Session: https://claude.ai/code/session_015W8GBu6sBiqus2L2xjMsAL
Co-authored-by: Claude <noreply@anthropic.com>
…s (objectui#11336)

Claude-Session: https://claude.ai/code/session_015W8GBu6sBiqus2L2xjMsAL
Co-authored-by: Claude <noreply@anthropic.com>
…f casting to any

Claude-Session: https://claude.ai/code/session_015W8GBu6sBiqus2L2xjMsAL
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 331 chunks) 3314.0 KB 3330.4 KB
Main entry chunk (gzip) 151.6 KB 350 KB
Entry file index-BHhhoMER.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 17.22KB 6.37KB
app-shell (runtime-config.js) 22.52KB 7.86KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.17KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.70KB 10.94KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.11KB 7.97KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.50KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 572.97KB 137.34KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 232.57KB 64.51KB
fields (index.js) 262.75KB 66.62KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.24KB 2.27KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 35.66KB 9.49KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 39.47KB 11.25KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.04KB 3.92KB
plugin-calendar (index.js) 53.17KB 15.46KB
plugin-charts (index.js) 84.26KB 23.05KB
plugin-chatbot (index.js) 198.22KB 46.97KB
plugin-dashboard (index.js) 143.54KB 38.79KB
plugin-designer (index.js) 231.41KB 48.84KB
plugin-detail (index.js) 245.74KB 64.59KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 176.65KB 45.50KB
plugin-gantt (index.js) 179.16KB 45.06KB
plugin-grid (index.js) 235.92KB 64.87KB
plugin-kanban (index.js) 50.06KB 15.74KB
plugin-list (index.js) 116.72KB 29.10KB
plugin-map (index.js) 25.60KB 8.62KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 38.80KB 11.71KB
plugin-tree (index.js) 14.51KB 5.15KB
plugin-view (index.js) 90.23KB 22.73KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.81KB 3.58KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 120.63KB 39.56KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.31KB 2.07KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 6.06KB 2.68KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 21.42KB 7.05KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.44KB 2.07KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 1.13KB 0.65KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 5.36KB 2.51KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.25KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants