Skip to content

fix(app-shell): overlay recovery strips a half-filled between (#5025) - #5657

Merged
os-sales merged 1 commit into
mainfrom
claude/issue-5025-objectview-filter-completeness
Aug 22, 2026
Merged

fix(app-shell): overlay recovery strips a half-filled between (#5025)#5657
os-sales merged 1 commit into
mainfrom
claude/issue-5025-objectview-filter-completeness

Conversation

@os-sales

@os-salesos-sales commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Fixes#5025

sanitizeViewOverride in packages/app-shell/src/views/ObjectView.tsx carried the shape-blind emptiness predicate that objectstack#8815 / PR #4962 retired on the two builder write paths:

value==null||value===''||(Array.isArray(value)&&value.length===0)

Correct for scalar and list, blind to pair. Both branches now delegate to the builder's arity-aware isFilterValueComplete.

Reachability of the reuse target — the card's first question

Verdict: reachable as a plain import, no widening. Nothing was exported to make this work.

The chain, verified on the built type surface rather than on source (an unbuilt or stale dist lies in both directions):

stepevidence
declaredpackages/components/src/custom/filter-builder.tsx:840export function isFilterValueComplete
barrelpackages/components/src/custom/index.ts:10packages/components/src/index.ts:75 (export * from './custom')
built .d.tspackages/components/dist/custom/filter-builder.d.ts:399export declare function isFilterValueComplete(...), reached from dist/index.d.ts via custom/index.d.ts:10
dependency edge@object-ui/components is already workspace:* in packages/app-shell/package.json
precedentpackages/app-shell/src/views/viewFilterFold.ts:34 — a sibling file in the same directory already imports the same symbol from the same entry

So the import costs nothing new: no export added to a published entry, no new dependency edge, no local re-implementation. The added binding rides on the @object-ui/components import block ObjectView.tsx already had.

Reachability of the defect shape — the issue's own open question

The issue asked to measure this first, and explicitly refused to call it a live bug until someone did. Measured: live, not dead-but-misleading code. Two producers, neither of them the converted builder:

  1. This pass is the recovery half for exactly this class of row. Its own docstring says so: "an install already carrying a poisoned row self-heals on the next load rather than needing a sys_metadata delete plus a service restart." Pre-conversion builds persisted half-filled ranges through foldFilterGroupToSpecRules; the recovery pass self-healed every arity except the one the sibling issue was about.

  2. The spec accepts the shape, so any non-builder producer — hand-authored view JSON, an AI-authored metadata app, an import, a migration — can mint it and pass authoring validation. Measured against ViewFilterRuleSchema from @objectstack/spec17.1.0 (the version this tip resolves; the sibling docstrings still say 17.0.0):

    true between ['2024-01-01', ''] half-filled: ACCEPTED
    true between ['', '']
    true between ['2024-01-01', '2024-03-01']
    false between '2024-01-01' scalar: refused
    false between ['2024-01-01'] one element: refused
    

    It counts the two slots and does not ask what is in them. Authoring validation is green on precisely the shape that dies at query time, which leaves this read-path pass as the last guard standing.

Both branches of the pass are converted, because both at-rest shapes reach it: the spec ViewFilterRule object and the legacy runtime triple [field, operator, value] that persistViewPatch copies into an overlay along with the rest of the view.

The cited line numbers, re-verified on the current tip

main @ 7e811687a. #4962's two sites are still converted; one of the issue's three citations had drifted:

siteissue saysactuallystate
packages/plugin-list/src/ListView.tsx:414:477converted ✅
packages/app-shell/src/views/viewFilterFold.ts:109:109converted ✅
packages/app-shell/src/views/ObjectView.tsx:330–342:351 and :357 (pre-patch)this PR

After this change the only occurrence of the retired expression in those three files is the one quoted inside the new doc comment.

One premise of the card corrected

The issue's ⭐ note — "it also uses VALUELESS_FILTER_OPERATORS, not the builder's VALUELESS_FILTER_BUILDER_OPERATORS … so this surface already keeps its own copy of the operator vocabulary"is stale, and no reconciliation was needed.viewFilterFold.ts:84 builds that set from the shared import (...VALUELESS_FILTER_BUILDER_OPERATORS) plus the canonical spec spellings (is_null) that only this layer sees, and viewFilterFold.emptyValue.test.ts:143 already pins the parity. That is exactly the split isFilterValueComplete's own docstring prescribes — the helper answers the VALUE question, each caller keeps its own operator vocabulary — so the operator half is left untouched deliberately, not overlooked.

One shape newly stripped beyond the half-filled array

A between whose value is a bare scalar ('2024-01-01') used to survive the pass and now does not. That is the same judgement one layer earlier: ViewFilterRuleSchema refuses it outright (measured above), so the server would too. Pinned as its own case.

Measurement — four mutation legs, each restored by a trap

Every leg is mutate → assert the mutation landed on disk (injected text AND removed text counted, with pristine counts asserted first) → run → restore. The restore is armed before the mutation, as

trap'git checkout HEAD -- "$FILE"' EXIT INT TERM

so a SIGTERM at the foreground cap cannot leave a mutated tree behind for later measurements to silently read. git status --porcelain was empty after each leg.

(Written that way on purpose: an earlier revision of this body spelled the trap's payload inside angle brackets and GitHub's body sanitizer ate the fragment even inside backticks, leaving a line that read as an empty trap.)

No rebuild step participates: vitest.config.mts:264 aliases @object-ui/components to packages/components/src, and the mutated file is app-shell source, so every leg measures source directly.

Predicted before running, then measured — the two agreed:

legmutationresultreds
Arestore the retired predicate verbatim, both branches6 failed / 9 passedexactly the pair block
B1value predicate always false6 failed / 9 passedthe four "complete range survives" controls, "keeps a filled scalar and a non-empty list", the mixed case
B2value predicate always true7 failed / 8 passedthe pair-drop block and "still drops an empty scalar and an empty list"
Cremove the two VALUELESS_FILTER_OPERATORS early returns1 failed / 14 passedexactly "still keeps a value-less operator whose value slot is empty"

Leg A is the one the card asked for. Its six reds are the discriminating cases, and they fail on a VALUE rather than on an import — e.g.

AssertionError: expected [ { field: 'stage', …(2) }, …(1) ] to deeply equal [ { field: 'stage', …(2) } ]

Its nine greens are the point: the retired predicate is correct for scalar and list, so the whole arities this change must not touch block passing under leg A is what proves the conversion stayed scoped to pair. An assertion that discriminated there would mean the change had reached further.

Legs B1/B2/C exist because a control that passes in every world proves nothing. Each is scoped to the same function and turns a different control red, so every one of the 13 assertions about our code is measured capable of failing under at least one leg — and legs A and B1 fail in disjoint directions, which is what separates the pair pin from the controls. The two remaining assertions are facts about @objectstack/spec, green in every world; they are labelled non-discriminating in the test file itself so nobody later reads them as a pin on our code.

Verification

All Vitest runs from the repo root (#3378).

  • New pinpackages/app-shell/src/views/ObjectView.overlayPairValue.test.ts: 15 passed (15).
  • Provable superset, 58 files, 587 tests, both runs exit 0.Principle: the diff changes exactly one runtime decision, inside sanitizeViewOverride in ObjectView.tsx; a test can observe it only if that module is in its graph. So a reverse-import BFS from that file over all 3,328 first-party sources (relative specifiers resolved to files, @object-ui/* to the package's src barrel) yields a 109-module closure containing 58 test files — 19 in packages/app-shell, 39 in apps/console reached through the barrel. Anything outside cannot load the changed module.
    • packages/… half: Test Files 19 passed (19) · Tests 222 passed (222)
    • apps/console half: Test Files 39 passed (39) · Tests 365 passed (365)
    • Each file confirmed executed, by diffing reporter file names against the derived list: comm in both directions is empty for both halves. Worth noting for the next person: the apps/console project does report paths relative to its own root (src/…, not apps/console/src/…), so the comparison normalizes that before diffing.
  • Type-checkpnpm --filter @object-ui/app-shell type-check → exit 0, script echoed (tsc --noEmit && tsc -p tsconfig.test.json, so the new test file is type-checked too). The dependency closure was built first (pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' build, exit 0) — a fresh-tree type-check without it fails on the unbuilt closure, not on the diff.
  • Lintpnpm --filter @object-ui/app-shell lint (eslint . over the whole affected package): 0 errors, exit 0 (2,551 pre-existing warnings, unchanged baseline). No narrowing was applied here; the repo-wide turbo run lint across 46 packages is CI's run.
  • Targeted gates, each quoting its own verdict line, exit codes captured before any pipe:
    • check-control-bytes✅ OK (scanned 4705 tracked text file(s); skipped 85 binary)
    • check-changeset-presence✅ 2 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)
    • check-changeset-no-major✅ No changeset declares a 'major' bump.
    • check-phantom-dependencies → exit 0 (the added import is on an already-declared dependency)
    • check-package-self-import → exit 0
    • check-lint-coverage✅ 46/46 packages linted, 0 with outstanding errors (a coverage gate — it validates that every package is reached by turbo run lint, it does not itself run ESLint repo-wide)
    • check-type-check-coverage✅ 45/46 via type-check, 0 errors outstanding
    • Independent self-scan for raw control bytes over the changed files: no matches.
  • Not run locally, by design: the repo-wide pnpm check farm and pnpm lint, which CI runs exactly once either way. Noted, untouched: check-eager-closure-budget (exits 2 locally), check-doc-snippet-types (exits 1), check-published-dist-tooling (belongs to CI).

Changeset: patch for @object-ui/app-shell.

Generated by Claude Code

`sanitizeViewOverride` carried the shape-blind emptiness predicate that
objectstack#8815 retired on the two builder write paths. It is correct for
`scalar` and `list` and blind to `pair`: a `between` with one bound typed is
`['2024-01-01', '']`, an array of length 2, so the recovery pass read it as a
real condition and handed it back to the `{ ...source, ...override }` merge.
The server refuses that range outright (`400 INVALID_FILTER`), and because the
row is stored the refusal returned on every later read of the view, for every
user of it.
Both branches now delegate to the builder's arity-aware
`isFilterValueComplete` — the same helper `plugin-list`'s `ListView` and
app-shell's own `viewFilterFold` already read, imported from the same public
entry, so no export was widened to reach it.
Adds `ObjectView.overlayPairValue.test.ts`, whose `pair` cases are measured red
against a leg restoring the old expression while the `scalar` / `list` block
stays green.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

MetricValueBudget
Eager closure (gzip, 52 chunks)3912.0 KB3990.2 KB
Main entry chunk (gzip)151.6 KB350 KB
Entry fileindex-EuaU_U5k.js
StatusPASS

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

PackageSizeGzipped
app-shell (index.js)10.04KB3.72KB
app-shell (runtime-config.js)11.22KB3.78KB
app-shell (types.js)0.01KB0.04KB
app-shell (urlParams.js)10.06KB3.86KB
auth (AuthContext.js)0.31KB0.24KB
auth (AuthGuard.js)1.17KB0.53KB
auth (AuthProvider.js)29.34KB7.05KB
auth (AuthShell.js)3.49KB1.40KB
auth (ForgotPasswordForm.js)12.21KB3.45KB
auth (LoginForm.js)18.15KB5.39KB
auth (PreviewBanner.js)0.90KB0.50KB
auth (RegisterForm.js)6.65KB2.22KB
auth (SocialSignInButtons.js)9.61KB3.89KB
auth (UserMenu.js)3.41KB1.23KB
auth (auth-gate-events.js)1.29KB0.66KB
auth (authStyles.js)5.04KB1.72KB
auth (createAuthClient.js)40.21KB10.80KB
auth (createAuthenticatedFetch.js)6.35KB2.43KB
auth (index.js)2.77KB1.22KB
auth (invitation-status.js)1.22KB0.70KB
auth (org-roles.js)6.66KB2.78KB
auth (phone-identifier.js)1.11KB0.66KB
auth (types.js)0.59KB0.35KB
auth (useAuth.js)5.02KB0.89KB
auth (useIsWorkspaceAdmin.js)3.04KB1.45KB
collaboration (CommentThread.js)26.08KB7.56KB
collaboration (LiveCursors.js)3.17KB1.27KB
collaboration (PresenceAvatars.js)6.49KB2.64KB
collaboration (PresenceProvider.js)2.79KB1.13KB
collaboration (index.js)1.68KB0.73KB
collaboration (useCollaborationTranslation.js)6.05KB2.52KB
collaboration (useCommentSearch.js)1.98KB0.88KB
collaboration (useConflictResolution.js)7.75KB1.86KB
collaboration (useMentionNotifications.js)1.81KB0.68KB
collaboration (usePresence.js)6.33KB1.84KB
collaboration (useRealtimeSubscription.js)7.91KB2.01KB
components (index.js)507.00KB113.72KB
core (index.js)4.51KB1.80KB
create-plugin (index.js)10.08KB3.26KB
data-objectstack (index.js)160.38KB44.54KB
fields (index.js)238.85KB60.13KB
i18n (LocalizationContext.js)1.76KB0.96KB
i18n (currency.js)1.22KB0.64KB
i18n (i18n.js)4.28KB1.75KB
i18n (index.js)3.44KB1.39KB
i18n (pickLocalized.js)7.62KB3.26KB
i18n (provider.js)23.13KB7.63KB
i18n (useDisplayLocale.js)2.85KB1.45KB
i18n (useObjectLabel.js)33.40KB8.71KB
i18n (useSafeTranslation.js)7.77KB3.13KB
layout (index.js)38.95KB10.97KB
mobile (MobileProvider.js)0.92KB0.49KB
mobile (ResponsiveContainer.js)0.94KB0.38KB
mobile (breakpoints.js)1.51KB0.70KB
mobile (createOfflineDataSource.js)5.61KB1.75KB
mobile (index.js)1.55KB0.62KB
mobile (offlineQueue.js)3.91KB1.35KB
mobile (pwa.js)0.97KB0.49KB
mobile (serviceWorker.js)1.48KB0.62KB
mobile (serviceWorkerSource.js)3.41KB1.48KB
mobile (useBreakpoint.js)1.54KB0.65KB
mobile (useGesture.js)6.96KB1.98KB
mobile (useOfflineSync.js)1.99KB0.72KB
mobile (usePullToRefresh.js)2.53KB0.85KB
mobile (useResponsive.js)0.72KB0.42KB
mobile (useResponsiveConfig.js)1.37KB0.63KB
mobile (useSpecGesture.js)4.32KB1.64KB
mobile (useTouchTarget.js)1.01KB0.54KB
permissions (MePermissionsProvider.js)9.35KB3.31KB
permissions (PermissionContext.js)0.31KB0.25KB
permissions (PermissionGuard.js)0.89KB0.45KB
permissions (PermissionProvider.js)4.42KB1.42KB
permissions (evaluator.js)5.12KB1.74KB
permissions (index.js)0.93KB0.41KB
permissions (store.js)0.91KB0.42KB
permissions (useFieldPermissions.js)1.28KB0.53KB
permissions (usePermissions.js)1.81KB0.83KB
plugin-ai (index.js)15.75KB3.80KB
plugin-calendar (index.js)46.62KB12.83KB
plugin-charts (index.js)64.65KB18.32KB
plugin-chatbot (index.js)181.41KB43.22KB
plugin-dashboard (index.js)128.33KB32.93KB
plugin-designer (index.js)212.30KB42.80KB
plugin-detail (index.js)242.16KB60.90KB
plugin-editor (index.js)2.46KB1.10KB
plugin-form (index.js)125.07KB30.43KB
plugin-gantt (index.js)164.10KB39.87KB
plugin-grid (index.js)200.79KB54.26KB
plugin-kanban (index.js)52.93KB14.60KB
plugin-list (index.js)111.74KB27.18KB
plugin-map (index.js)20.06KB6.62KB
plugin-markdown (index.js)13.72KB4.69KB
plugin-report (index.js)43.49KB11.93KB
plugin-timeline (index.js)26.68KB7.66KB
plugin-tree (index.js)8.50KB2.88KB
plugin-view (index.js)84.54KB20.69KB
providers (DataSourceProvider.js)0.75KB0.39KB
providers (MetadataProvider.js)1.37KB0.59KB
providers (ThemeProvider.js)1.90KB0.85KB
providers (UploadProvider.js)11.66KB3.50KB
providers (index.js)0.45KB0.23KB
providers (types.js)0.01KB0.04KB
react-runtime (index.js)5.62KB2.34KB
react (LazyPluginLoader.js)3.77KB1.33KB
react (SchemaRenderer.js)43.66KB14.77KB
react (data-invalidation.js)5.05KB2.08KB
react (index.js)1.33KB0.69KB
react (schema-input.js)2.32KB1.24KB
react (spec-input.js)0.20KB0.18KB
sdui-parser (codegen.js)5.41KB2.34KB
sdui-parser (index.js)4.77KB2.16KB
sdui-parser (input-type.js)2.84KB1.40KB
sdui-parser (parse.js)10.76KB3.17KB
sdui-parser (provenance.js)3.66KB1.82KB
sdui-parser (types.js)0.29KB0.24KB
sdui-parser (validate.js)6.92KB2.40KB
types (ai.js)0.20KB0.17KB
types (api-types.js)0.20KB0.18KB
types (app.js)2.87KB0.99KB
types (base.js)0.20KB0.18KB
types (blocks.js)0.20KB0.18KB
types (complex.js)0.20KB0.18KB
types (crud.js)0.20KB0.18KB
types (dashboard-filter-alias.js)6.23KB2.74KB
types (data-display.js)0.20KB0.18KB
types (data-protocol.js)0.20KB0.19KB
types (data.js)0.20KB0.18KB
types (designer.js)1.87KB0.85KB
types (disclosure.js)0.20KB0.18KB
types (error-code.js)1.54KB0.88KB
types (feedback.js)0.20KB0.18KB
types (field-types.js)0.20KB0.18KB
types (form.js)0.20KB0.18KB
types (http-retry.js)4.32KB2.02KB
types (index.js)3.08KB1.53KB
types (layout.js)0.20KB0.18KB
types (managed-by.js)0.19KB0.18KB
types (mobile.js)2.59KB1.31KB
types (navigation.js)0.20KB0.18KB
types (objectql.js)0.20KB0.18KB
types (overlay.js)0.20KB0.18KB
types (permissions.js)0.20KB0.18KB
types (plugin-scope.js)0.20KB0.18KB
types (record-components.js)0.20KB0.19KB
types (record-semantics.js)1.28KB0.67KB
types (registry.js)0.20KB0.18KB
types (reports.js)0.20KB0.18KB
types (spec-report.js)5.05KB1.93KB
types (system-fields.js)3.33KB1.54KB
types (theme.js)0.20KB0.18KB
types (ui-action.js)3.40KB1.71KB
types (views.js)0.20KB0.18KB
types (widget.js)0.20KB0.18KB

Size Limits

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

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

Labels

Projects

None yet

2 participants

@os-sales@claude