This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Repository navigation
Commit cb80001
fix(plugin-grid): the Import Wizard stops offering the two control opt-outs the import doors refuse (objectui#12985) (#12989)
Fixes #12985
Clause-②: no
The Import Wizard no longer offers "Run automations & triggers" or
"Import as historical data". Both import doors (`POST
/api/v1/data/:object/import` and `/import/jobs`) honour `runAutomations:
false` and `treatAsHistorical: true` for the system principal only and
refuse every other caller `403 PERMISSION_DENIED`
(objectstack-ai/objectstack#24348, PR objectstack-ai/objectstack#24379,
measured there by `import-control-opt-out-gate.test.ts`). A browser
request is never the system principal, so a user who unticked the first
box or ticked the second had the whole import refused.
## What changed
- `packages/plugin-grid/src/ImportWizard.tsx`: the two checkboxes, their
`useState` pairs, their props on `ImportOptions`, their entries in the
dependency lists and the reset, and the two fields
`assembleImportRequest` set are removed. The wizard's import, dry-run
and background-job requests (all three go through
`assembleImportRequest`) carry neither key. Omitting both is the
server's declared default (`readImportControlFlags`: `runAutomations` is
on unless the body sends `false`; `treatAsHistorical` is on only for a
literal `true`), so the default import is unchanged: automations run and
the state machine is walked. No capability or entitlement is added.
- `packages/i18n/src/locales/*.ts` (all ten packs) and the wizard's
English fallback map `IMPORT_DEFAULT_TRANSLATIONS`: the three keys only
those options read, `grid.import.optRunAutomations`,
`grid.import.optTreatHistorical`, `grid.import.optTreatHistoricalHint`,
are retired. A repo-wide `git grep` for the two leaf names is empty
after the change (control: `optCreateOptions` still hits every pack).
- Two comments (`en.ts` and `makerEmptyState-v1-scope-8329.test.ts`)
listed `dataImport.optRunAutomations` as a live manual automation
surface. That key is retired here, so the name is dropped from both
lists.
- `.changeset/12985-import-optouts.md`: `@object-ui/plugin-grid` and
`@object-ui/i18n`, patch.
**Contract note for the seat (Clause-② no, narrowing):**
`ImportWizardProps` and `ImportResult` are unchanged. The locale objects
exported under `@object-ui/i18n/locales/*` lose three members of
`grid.import`. The internal `__testables.assembleImportRequest` options
type loses `runAutomations` and `treatAsHistorical`.
`ImportRequestOptions` in `@object-ui/types` still declares both fields,
because the server still accepts them from the system principal.
## Pins
New file
`packages/plugin-grid/src/ImportWizard.controlOptOuts-12985.test.tsx`,
over the real wizard:
- (a) "draws neither the run-automations nor the treat-as-historical
option": in the preview step neither `import-opt-run-automations` nor
`import-opt-treat-historical` is drawn, and no text matches automations
or historical. CONTROL: the `import-options` panel and
`import-opt-create-options` are drawn.
- (b) + (c) "a completed default import sends neither opt-out and still
imports": the request handed to `importRecords` has neither property,
and equals the default import's request exactly (`format`, `rows`,
`writeMode: insert`, `createMissingOptions: false`, `skipBlankMatchKey:
false`) as the CONTROL that nothing else moved; `onComplete` receives 2
of 2 rows imported.
`importDryRun.test.ts` and `importSavedMapping.test.ts` drop the two
option inputs and the assertions that the fields were sent.
**Ablation (once):** with the fix committed, `ablation-replace.mjs` put
a `data-testid="import-opt-run-automations"` checkbox labelled "Run
automations & triggers" back into `ImportOptions` (anchor 1 to 0, blob
`3cdd0e998baf` to `37f2a414044c`), and pin (a) went red: `Tests 1 failed
| 1 passed (2)`, failing on
`queryByTestId('import-opt-run-automations')`. Restore: blob after
restore `3cdd0e998baf` equals the HEAD blob and `git diff HEAD` is
empty. A first attempt was a no-op: its replacement contained its own
anchor, so the tool refused it (anchor count 1 to 1) and the test never
ran. It was re-run with a new anchor, and that second run is the one
quoted here.
## Verification (at `ac0198b332`)
All of it ran on the committed tree at `ac0198b332`.
- Closure build `turbo run build --filter=@object-ui/plugin-grid^...`
(13 tasks): exit 0.
- `type-check` for `@object-ui/plugin-grid` and `@object-ui/i18n` (`tsc
--noEmit && tsc -p tsconfig.test.json`): exit 0. `--listFiles` confirms
the new and edited test files are in the test program.
- vitest `--maxWorkers=1`: the new and edited files plus the parity
test, 4 files and 20 tests, passed. Every test file that names
`ImportWizard`, `runAutomations` or `treatAsHistorical`, in plugin-grid
(21 files, 148 tests) and elsewhere, plus the i18n parity and
retired-key suites (20 files, 301 tests), passed.
- Declared to CI: the full `packages/plugin-grid/` and `packages/i18n/`
directories.
- The pre-tsc battery, all exit 0: `check:phantom-deps`,
`check:self-import`, `check:unreferenced-sources`,
`check:doc-example-readers`, `check:handler-key-reads`,
`check:side-effects-array`, `check:element-data-source-declaration`,
`check:spec-symbols`, `check:action-forward-parity`,
`check:designer-field-key-parity`, `check:icon-record-names`,
`check:i18n-keys`, `check:i18n-dead-keys`, `check:i18n-drift`,
`check:i18n-designer-parity` and `check:control-bytes`. Also exit 0:
`node scripts/check-hand-rolled-comment-mask.mjs`, `node
scripts/check-changeset-fixed.mjs`, `node
scripts/check-changeset-presence.mjs` and `check:new-line-citations` (0
new).
- Narrowed lint, run as `eslint --no-inline-config` over the 15 changed
`.ts` / `.tsx` files:
- Population: `eslint.config.js` scopes `**/*.{ts,tsx}`. The JSON output
counts 15 files linted, 0 errors and 9 warnings.
- The 9 warnings are all in `ImportWizard.tsx`. The same 9 rules fire on
the base blob of that file, so the change adds none.
- Invariance: the config sets no `parserOptions.project`, so linting is
not type-aware and this diff cannot move a verdict on an untouched file.
## Acceptance notes
- **Another caller of the fields:** no other objectui caller sends
`runAutomations` or `treatAsHistorical`. `git grep` hits only this file,
its tests and the type `ImportRequestOptions` in
`packages/types/src/data.ts`, which is outside this file surface and
still correct as a wire type. `data-objectstack` forwards the request
object and names neither field.
- **Doc drift, not filed (carrier: none):** the JSDoc on
`ImportRequestOptions.runAutomations` in `packages/types/src/data.ts`
reads "off by default for bulk". The spec and server default is on
(`ImportRequestSchema`, `runAutomations` declared default). No producer
reads it.
Session: `https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB`
---
_Generated by [Claude
Code](https://claude.ai/code/session_01XVp19E1MYUTFM3dnkwz8gB)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 736b9ce commit cb80001
16 files changed
Lines changed: 136 additions & 101 deletions
File tree
- .changeset
- packages
- i18n/src
- __tests__
- locales
- plugin-grid/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | 670 | | |
674 | 671 | | |
675 | 672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | 586 | | |
590 | 587 | | |
591 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | 867 | | |
871 | 868 | | |
872 | 869 | | |
| |||
2365 | 2362 | | |
2366 | 2363 | | |
2367 | 2364 | | |
2368 | | - | |
| 2365 | + | |
2369 | 2366 | | |
2370 | 2367 | | |
2371 | 2368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
609 | | - | |
610 | | - | |
611 | 608 | | |
612 | 609 | | |
613 | 610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | 604 | | |
608 | 605 | | |
609 | 606 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | 586 | | |
590 | 587 | | |
591 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | 586 | | |
590 | 587 | | |
591 | 588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 602 | | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | 603 | | |
607 | 604 | | |
608 | 605 | | |
| |||
0 commit comments