Skip to content

fix(plugin-list, fields): no quick-search or picker type-ahead on an object whose search resolves to no field (objectui#12966) - #12974

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-12966-searchless-object
Oct 18, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-12966-searchless-object

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #12966
Clause-②: no

What

objectstack now answers a non-blank search over an object whose resolved search set is empty with 400 INVALID_FIELD (param: 'search'), where it used to answer every row (objectstack-ai/objectstack#24320, ec749fbb44). The console offered that search in three places. This PR stops offering it there, and shows the server's message where a box still shows and the search is refused.

  • List toolbar (@object-ui/plugin-list ListView). showSearch now also requires that the object's search resolves to at least one field. A term restored at mount (initialSearchTerm) is not applied on such an object, the same two-readers rule searchlessViewOnScreen already follows.
  • Record pickers (@object-ui/fields). RecordPickerDialog draws no search box on a searchless target, and still lists and pages the records. LookupField's inline dropdown draws no type-ahead box, and still offers the records. Its options are buttons, so they stay reachable by Tab without the combobox input.
  • Refusal message. ListView's load-error panel shows the server's sentence, which names the object and both remedies, when the failed request carried a term and the error's code is INVALID_FIELD. Before, it showed the generic "The server could not process this view's filter or query options" copy. The record pickers already rendered err.message, and so did ObjectGrid's load-error panel (loadError.message), so neither changed.

How "searchable" is decided

The decision uses the spec's own resolveSearchFieldResolution (@objectstack/spec/data) over the inputs the engine gives it in ObjectQL.expandSearchOnAst: the object's field map with every internal: true field left out, and the OBJECT's declared searchableFields. No list of searchable types lives in objectui. displayField is not passed, because it only orders the auto-default set and never changes who is in it. The call sits in two small helpers, objectResolvesSearch in packages/fields/src/widgets/searchOffer.ts (not re-exported from the barrel) and its twin in ListView.tsx. Each is about twelve lines and both call the same spec resolver. I did not add a shared export, to stay inside the claimed file surface and keep Clause-②: no.

Measured assumptions

  • A1. The installed @objectstack/spec is 18.0.0-next.3 (node_modules/@objectstack/spec/package.json). Its dist/data/index.d.ts declares resolveSearchFieldResolution(opts: Omit of SearchFieldResolutionOptions minus requestedFields) returning { allowed, source }, the signature the engine and the ingress gate call.
  • A2, per site, and what happens while the schema is unknown:
    • ListView: the object definition comes from dataSource.getObjectSchema in the "Fetch object definition" effect. While it is unread, and when the data source serves none, the box is drawn, as before the card. On a searchless object the box is withdrawn when the read lands. The list is in its loading state for that read anyway, because its data fetch waits on objectDefLoaded. I first gated the box on the read settling, so it would never draw and then withdraw. That made the box arrive asynchronously on every list, and it broke app-shell's listViewGroupedSearch-11021 test, which types into the box right after render. That file is outside the claimed surface, so I chose "keep today's behaviour until the schema is known". The cost is a possible brief box on a searchless object, only for the length of the definition read.
    • RecordPickerDialog: the objectSchema prop (from LookupField it is refObjectSchema). When it is absent the box is kept. That covers RelatedList, PositionHoldersSection, AccessExplainPanel and AssignedUsersSection, which pass no schema.
    • LookupField inline dropdown: refObjectSchema, read at mount. The dropdown opens on a click after that, so a flash is unlikely. Until the schema is known the box is kept.
  • A3. data-objectstack routes every request carrying $search through rawFindWithPopulate. On a non-OK answer that path throws an Error whose message is the envelope's error.message, with code (here INVALID_FIELD), status and httpStatus set. classifyLoadError reads that as rejected. The message therefore reaches ListView, ObjectGrid and useRecordQuery unchanged, and data-objectstack is not touched. The envelope's param is not carried, so ListView keys on "the request carried a term" plus code === 'INVALID_FIELD'.

Conflict with the order's pin (c), reported rather than chosen silently

The order says a VIEW-declared searchableFields naming a stored field should count, "exactly as the resolver says", and that such a view on an otherwise searchless object should draw the box. The engine does not do this. The view's list is sent as the $searchFields override. The ingress gate assertSearchFieldsAreSearchable (@objectstack/metadata-protocol) refuses any entry outside the object's resolved allowed set, and the linter's searchable-field-unsearchable refuses the same view at build time. Objectstack#24320's pins also show that an explicit searchFields does not rescue a searchless object. A box drawn there would therefore 400 on every term.

So this PR pins the resolver's declared branch at the OBJECT level instead: an object that declares searchableFields: ['book'], a lookup the auto-default skips, draws the box. A view-level list on a searchless object does not. The report carries this as an open question.

Pins

packages/plugin-list/src/__tests__/ListView.searchlessObject-12966.test.tsx:

  • (a) a junction object (two lookups and a formula title) draws no quick-search box;
  • (b) CONTROL: the same object with a text field draws it;
  • (c) an object declaring searchableFields naming a stored lookup draws it;
  • an internal: true text field does not count;
  • a view-level searchableFields does not rescue a searchless object;
  • a restored term reaches no fetch on a searchless object, with a CONTROL that it does on a searchable one;
  • (e) with no definition served the box stays, and a refused term renders the server's sentence in list-error-state (data-error-kind="rejected"), with the box still present to clear the term. CONTROL: a 400 with another code keeps the generic copy.

packages/fields/src/widgets/RecordPickerDialog.searchlessTarget-12966.test.tsx:

  • (d) the dialog on a searchless target has no record-picker-search, lists records, and pages them (page 2 asks for $skip: 5), with no $search sent;
  • CONTROL: the box is kept on a text target and when the schema is unknown;
  • (e) the dialog renders the refusal's message in its alert instead of rows;
  • the LookupField dropdown on a searchless target has no combobox and still offers options, with a CONTROL on a text target.

packages/fields/src/widgets/searchOffer.test.ts pins the helper: the junction, text and enum controls, the declared lookup against the declared formula, internal, the array field-map form, and undefined for an unknown schema.

Fixture triage. ListView.displayPopover-12423.test.tsx served fields: {}, an object with no field at all, so it now resolves as searchless. That test asserts the full toolbar, including Search. I fixed it by adding a declaration: the fixture now declares name: text. Its assertions are unchanged.

Ablation

The fix was committed first (3a00b9a653). Using node ../objectstack/scripts/ablation-replace.mjs, showSearch: ua?.search !== false && !searchlessViewOnScreen && !searchlessObject, became showSearch: ua?.search !== false && !searchlessViewOnScreen,, today's rule. The anchor count went from 1 to 0 and the replacement count from 0 to 1. The blob went from b59af0273ea0 to 265c67830b8a.

On the mutated source, ListView.searchlessObject-12966.test.tsx gave 3 failed / 6 passed: (a), the internal-only case and the view-level case went red. The controls, the restored-term pair (it rides searchTerm, not showSearch) and (e) stayed green, which is the expected direction.

Restore: the blob was b59af0273ea0 again, equal to HEAD, and git diff HEAD was empty. An independent git hash-object after the run matched HEAD's blob too. ListView is imported from source, so no build was involved.

Verification at 3a00b9a653

  • Closure build pnpm --filter '@object-ui/plugin-list^...' build: exit 0, 13 projects.
  • type-check (tsc --noEmit && tsc -p tsconfig.test.json) for @object-ui/fields and @object-ui/plugin-list: exit 0. Each package's tsconfig.test.json includes src/**/*.test.ts(x), so the new tests are type-checked.
  • vitest, new and edited files: 9/9 (list) and 13/13 (fields).
  • vitest, the search families: every test file in plugin-list, fields, plugin-grid and app-shell that names showSearch, search-icon-button, record-picker-search, searchableFields, $search, useRecordQuery or initialSearchTerm. Plugin-list, fields and app-shell: 22 files and 388 tests passed after the timing change. Plugin-grid and app-shell: 15 files, all plugin-grid files passed. The 2 app-shell failures there came from the first gating, which was reverted, and the rerun above includes that file.
  • vitest, the whole packages/fields/ directory: 270 files passed, 1 skipped; 4173 tests passed, 7 skipped.
  • vitest, the whole packages/plugin-list/ directory: 152 files and 1540 tests passed.
  • pnpm lint narrowed to the 8 changed .ts/.tsx files (eslint --no-inline-config --format json): 0 errors across 8 files. The population is the package eslint . config. The config enables no type-aware linting (no projectService or parserOptions.project in eslint.config.js), so this diff cannot move any untouched file's verdict.
  • Each of these exited 0: check:phantom-deps, self-import, unreferenced-sources, doc-example-readers, handler-key-reads, side-effects-array, element-data-source-declaration, spec-symbols, action-forward-parity, designer-field-key-parity, icon-record-names, i18n-keys, i18n-drift, i18n-designer-parity, control-bytes, check-hand-rolled-comment-mask, check-changeset-fixed, check-changeset-presence, check:new-line-citations (0 new) and check:test-path-roots.

Acceptance notes

  • PeoplePicker is not touched. Its target is sys_user, whose name and email are textual, so its set is never empty.
  • ObjectGrid standalone (a grid that owns its own toolbar search) still offers its box from the view, not from the resolver. The card scoped ObjectGrid to the refusal message only, and its error panel already renders loadError.message. From reading the code, that panel returns before the data-table that draws the grid-owned box, so a standalone grid with a refused term shows the message but has no box left to clear the term with. This is read, not measured. Carrier: none.
  • The changeset declares patch for both packages. No export, prop or type member is added.

Generated by Claude Code

…object whose search resolves to no field (objectui#12966)

objectstack answers a non-blank search over such an object with 400
INVALID_FIELD. The list toolbar and the record pickers now decide with the
spec's resolveSearchFieldResolution over the object definition (internal
fields left out, the object's own searchableFields), and a refused search
on a list shows the server's message.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB
…read; declare a searchable field on the 12423 toolbar fixture (objectui#12966)

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

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 75 chunks) 3162.0 KB 3744.1 KB
Main entry chunk (gzip) 80.5 KB 350 KB
Entry file index-Bp1M87wD.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) 21.41KB 7.88KB
app-shell (runtime-config.js) 24.52KB 8.48KB
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) 45.59KB 12.03KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 20.67KB 6.12KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.74KB 3.94KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.62KB 0.83KB
auth (authStyles.js) 5.27KB 1.86KB
auth (createAuthClient.js) 42.84KB 11.66KB
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.26KB 8.03KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (commentAuthorship.js) 1.39KB 0.78KB
collaboration (index.js) 1.93KB 0.85KB
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) 612.39KB 149.02KB
core (index.js) 10.18KB 4.04KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 248.83KB 69.44KB
fields (index.js) 292.36KB 74.70KB
i18n (LocalizationContext.js) 2.92KB 1.42KB
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.52KB 2.39KB
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) 36.87KB 9.88KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.33KB 11.96KB
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) 15.35KB 5.51KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.82KB 2.38KB
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) 55.04KB 16.10KB
plugin-charts (index.js) 85.06KB 23.39KB
plugin-chatbot (index.js) 230.81KB 54.29KB
plugin-dashboard (index.js) 147.53KB 39.95KB
plugin-designer (index.js) 233.95KB 50.08KB
plugin-detail (index.js) 266.04KB 70.50KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 181.16KB 46.84KB
plugin-gantt (index.js) 178.46KB 45.13KB
plugin-grid (index.js) 272.87KB 75.68KB
plugin-kanban (index.js) 63.37KB 19.51KB
plugin-list (index.js) 140.49KB 36.24KB
plugin-map (index.js) 27.17KB 9.00KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 46.66KB 13.13KB
plugin-timeline (index.js) 39.31KB 11.88KB
plugin-tree (index.js) 15.27KB 5.40KB
plugin-view (index.js) 94.68KB 24.36KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 12.07KB 3.68KB
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) 125.37KB 41.04KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.71KB 2.11KB
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.07KB 1.30KB
sdui-parser (index.js) 7.30KB 3.12KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.81KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.29KB 0.24KB
sdui-parser (validate.js) 23.87KB 7.83KB
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.78KB 2.70KB
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 (node-slots.js) 7.18KB 2.34KB
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 (product-blocks.js) 0.20KB 0.19KB
types (record-approval-decision.js) 0.20KB 0.20KB
types (record-components.js) 0.20KB 0.19KB
types (record-panels.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.26KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.48KB 3.50KB
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