Skip to content

fix(plugin-grid): the import preview reads dates, rating/slider/progress/toggle and email as the server does (objectui#11889) - #11911

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-11889-import-cell-check
Oct 8, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-11889-import-cell-check

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #11889
Clause-②: no

What this changes

The Import Wizard preview's cell check (checkImportCell in packages/plugin-grid/src/ImportWizard.tsx) now marks a cell exactly where the server's import refuses it on the three legs the card names, so the import button (which counts the rows nobody flagged) counts what the import will write.

  • Dates (was looser). A date / datetime cell is judged by isImportableDateCell in importCoercionContract.ts, a mirror of @objectstack/core's parseDateCell grammar (readIsoTemporalCell, then readYearFirstCell, with namesRealCalendarDay and the clock ranges) plus core's supported years, which the engine's write validation applies to the stored value. 07/15/2026, July 15, 2026 and 1/2/26 are now marked invalid_date; 2026-07-15 and 2026/7/15 are taken. The spec publishes neither the grammar nor the years, so both are restated beside the boolean tokens, with a paired inventory in importCoercionContract.test.ts as the tripwire. A zone-bearing ISO cell is judged with the UTC setters, never with the browser's own date parser.
  • rating, slider, progress, toggle (were unchecked). The boolean and numeric arms key on the spec's BOOLEAN_VALUE_TYPES and NUMERIC_VALUE_TYPES from @objectstack/spec/data, the sets the server's coerceFieldValue reads, instead of literal case lists. The arms run in the server's order (boolean, numeric, date, then the rest).
  • Email (was stricter). An email cell is judged by isRecordEmail, a one-pass restatement of the record validator's EMAIL_RE, which takes 735431496@柴仟.com and still refuses a@b. isPlausibleEmail (the identity rule, not a package export) is removed: see the measurement below.

No export, prop, accepted input or sentence changes; cellRefusalMessage is untouched. Changeset: .changeset/11889-import-cell-check.md (@object-ui/plugin-grid patch).

What was measured

All server sources read at the tag @objectstack/core@17.7.0 (the same commit as @objectstack/objectql@17.7.0 and @objectstack/spec@17.7.0, 4e4e8814).

  • The pinned spec exports both sets. objectui's lockfile resolves @objectstack/spec 17.7.0: NUMERIC_VALUE_TYPES = number, currency, percent, rating, slider, progress, summary; BOOLEAN_VALUE_TYPES = boolean, toggle. The range floor ^17.5.0 exports both as well (the 17.5.0 tarball's data entry), and check:spec-floors judged the built plugin-grid with no finding.
  • H1 (the date grammar): confirmed, with one correction. For date / datetime, parseDateCell takes readIsoTemporalCell(s) ?? readYearFirstCell(s) and nothing else. The supported years (date 0001 to 9999, datetime 1000 to 9999) are refused in two places, both with invalid_date: at coercion only for a cell the reader already refuses (outsideYears changes the sentence, not the verdict), and at the engine's write validation for a cell the reader takes (0500-07-15 into a datetime). The mirror carries both. A time cell has its own reader, and the preview does reach time: see "Not in this PR".
  • The date mirror against the published server. A one-off probe compared isImportableDateCell with the published @objectstack/core 17.7.0 coerceFieldValue followed by the write door's temporal rule, over 43,212 (cell, kind) pairs (the server takes 3,395 of them). Disagreements: 0, under three host zones (UTC, Asia/Shanghai, America/New_York). Control: the old Date.parse rule disagrees on 16,107 of the same pairs, so the comparison can fail. The probe is not committed; the inventory is.
  • H2 (summary): harmless. Neither host offers a summary target: importTargetFields drops formula / summary, and ExcelImportBar drops formula / summary / autonumber. The server's coercion reads the same set, so a host that did pass one would get the server's answer.
  • H3 (the email rule): confirmed. record-validator.ts declares EMAIL_RE = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/ and an email cell passes coercion untouched. The mirror is a single pass (no pattern, no backtracking), and importEmailValidation.test.ts compares it with that literal and keeps the adversarial-input timing pin.
  • Can this wizard import into an identity object? Yes, and the strict rule never reached it. ObjectView wires sys_user to /api/v1/auth/admin/import-users for an admin. But that target's email column reaches the wizard typed text (identityImportFields), so checkImportCell's email arm never ran on it, before or after this PR. The identity endpoint applies isLikelyEmail in its own dry run (its identity pre-validation runs for dryRun). So the record validator's rule applies alone in the email arm, and isPlausibleEmail had no caller left.

Tests

On 2867a40 (this branch merged with origin/main 9844bbf):

  • pnpm --workspace-concurrency=2 --filter "@object-ui/plugin-grid..." build: exit 0 (15 of 47 projects).
  • pnpm --filter @object-ui/plugin-grid type-check: exit 0. The test program (tsconfig.test.json) lists all three edited test files.
  • pnpm exec vitest run packages/plugin-grid/: 193 files, 1818 tests passed. This includes every ImportWizard*, importCoercionContract*, importParsers* and importEmailValidation* suite. There is no *.guard.test.* in the package.
  • check:control-bytes, check:new-line-citations (0 new), check:changeset-claims, check:pending-changeset-literals, check:spec-symbols, check:installed-pin-claims, check:phantom-deps, check:test-path-roots, check-changeset-presence, check-changeset-no-major: all exit 0.
  • check:spec-floors: exit 1, NOT MEASURED for the workspace. All 13 findings are no-artifact, for packages outside this build closure. plugin-grid was built and judged, with no finding.
  • ESLint on the five edited files: 0 errors. 9 warnings, all outside the diff hunks.

New pins (ImportWizard.cellCheck-11889.test.tsx): each spelling the card names, with a control per leg. The preview marks the cells and the import button reads Import 1 Row for each leg.

Reverse check per leg. Each fix was committed first, then mutated through ablation-replace.mjs (anchor hit 1 to 0 on disk, blob changed) and restored (blob equals HEAD, git diff HEAD empty):

Leg Mutation Result Direction
Dates arm back to Date.parse 2 failed, 7 passed: date 07/15/2026: expected undefined to deeply equal { code: 'invalid_date' …}, and the preview's row 2 date not marked unmarked, so overcount (predicted)
Types literal boolean and number/currency/percent case lists 3 failed, 6 passed: rating/slider/progress, toggle, preview count unmarked, so overcount (predicted)
Email the old identity rule inline 2 failed, 7 passed: expected { code: 'invalid_email' … } to be undefined, and the preview's non-ASCII row marked marked, so undercount (predicted)

The first email run never acquired the shared verify lock (queue timeout, exit 99, tree restored), so it measured nothing. The second run is the one above.

Acceptance notes (not changed here)

  • The supported-years sentence. A cell refused only for its year (0500-07-15 in a datetime) reads "is not a valid date" in the preview, where the server names the range. A range sentence needs a new grid.import.* key, and packages/i18n is outside this card's fence. Handover: none.
  • A zone-naive datetime is read as UTC. The server reads it in the importing user's business timezone, which the wizard does not know. The two disagree only within a day of year 1000 or 9999.
  • The boolean tokens are published now. @objectstack/spec exports IMPORT_BOOLEAN_TRUE_TOKENS / IMPORT_BOOLEAN_FALSE_TOKENS (at 17.5.0 and 17.7.0) and IMPORT_REFERENCE_TYPES. importCoercionContract.ts still mirrors the tokens under a "not published yet" note. The contents are identical today, so nothing is wrong yet. Handover: none.
  • Numeric bounds. A field's own min / max are not judged by the preview for any numeric type, as before, because the wizard's field shape does not carry them. The dry run judges them.

Not in this PR (reported to the seat)

  • A time column is not checked. importTargetFields passes time fields through. The preview takes every cell (25:00, abc, 10:00Z, 9am all measured as taken), while the published 17.7.0 server refuses those four with invalid_time. A fix needs core's time rule mirrored and an invalid_time refusal with a sentence, which is outside this card's fence.
  • The user import's preview checks no email. Its columns are typed text, so before Validate the button counts a row the identity endpoint refuses (INVALID_EMAIL).

Session: https://claude.ai/code/session_01DrKzdPdyLLBW3qpZ4vtk7z


Generated by Claude Code

claude added 3 commits October 8, 2026 05:43
…olean types, and email as the server does

The cell check now marks a cell exactly where the server's import refuses it:
- a date / datetime cell is read by a mirror of core's parseDateCell grammar
  and supported years, so 07/15/2026, July 15, 2026 and 1/2/26 are marked;
- the boolean and numeric arms key on the spec's BOOLEAN_VALUE_TYPES and
  NUMERIC_VALUE_TYPES, so toggle, rating, slider and progress are checked;
- an email cell is read by the record validator's EMAIL_RE, so a non-ASCII
  domain is no longer marked.

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

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

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 334 chunks) 3298.7 KB 3307.0 KB
Main entry chunk (gzip) 71.3 KB 350 KB
Entry file index-_k3W9wyS.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.82KB 6.58KB
app-shell (runtime-config.js) 22.59KB 7.89KB
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.15KB 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) 586.28KB 141.14KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 240.39KB 67.09KB
fields (index.js) 266.92KB 67.47KB
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) 38.37KB 10.31KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.50KB 11.82KB
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.39KB 15.52KB
plugin-charts (index.js) 84.71KB 23.25KB
plugin-chatbot (index.js) 199.63KB 47.46KB
plugin-dashboard (index.js) 144.82KB 39.17KB
plugin-designer (index.js) 231.46KB 48.87KB
plugin-detail (index.js) 248.57KB 65.47KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 176.62KB 45.75KB
plugin-gantt (index.js) 179.17KB 45.07KB
plugin-grid (index.js) 248.06KB 68.77KB
plugin-kanban (index.js) 52.17KB 16.37KB
plugin-list (index.js) 117.45KB 29.33KB
plugin-map (index.js) 27.24KB 9.03KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 39.10KB 11.81KB
plugin-tree (index.js) 15.07KB 5.33KB
plugin-view (index.js) 91.07KB 22.93KB
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) 7.30KB 3.12KB
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) 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 (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

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 8, 2026 06:33
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 8, 2026 06:33
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit 9fc6ad7 Oct 8, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-11889-import-cell-check branch October 8, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants