This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit ebd20ec
fix(app-shell): readable option labels for unlabeled datasource enum selects (objectui#13353) (#13499)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01XWGTsmqrtrt1Zqh1ioWqsT
Fixes #13353
## What changed
- `DatasourceResourcePage.tsx` (Setup → Datasources editor): a
driver-config JSON Schema `enum` select rendered each raw value (`off`,
`safe`) as its option text. The driver-config schema declares no
per-option label (triage comment 6359343643: no carrier, no protocol
change), so each option's text is now built from its raw value with
Studio's existing `humanizeKey`
(`metadata-admin/inspectors/json-schema-to-fields.ts`), the same helper
`SchemaForm`'s enum selects already use. `off` → "Off", `safe` → "Safe",
`read_only` → "Read Only", `read-write` → "Read Write", `fullSync` →
"Full Sync". The `SelectItem` value, and therefore what the form saves,
stays the raw enum member. No new helper written.
- New test `DatasourceResourcePage.enumOptionLabels-13353.test.tsx`: an
`autoMigrate` enum (`off | safe`, no labels) shows "Off" / "Safe";
snake, kebab and camel members read as words; choosing "Safe" and "Full
Sync" then creating posts `config.autoMigrate: 'safe'` and
`config.syncMode: 'fullSync'`.
- `DatasourceResourcePage.selectPlaceholderLocale-11252.test.tsx`: its
CONTROL case expected the closed trigger to read `remote`; it now reads
`Remote`.
- `.changeset/13353-datasource-enum-option-labels.md`: patch for
`@object-ui/app-shell`. Clause-②: no. Metadata-protocol: none.
## What I ran
- Reproduced first: the new test file on unmodified code → 3 failed of 3
(`expected [ 'off', 'safe' ] to deeply equal [ 'Off', 'Safe' ]`,
likewise for the mixed-case enum).
- `pnpm exec vitest run
packages/app-shell/src/views/metadata-admin/datasource/
packages/app-shell/src/views/metadata-admin/inspectors/json-schema-to-fields.test.ts`
→ 8 files, 71 tests passed (all seven
`DatasourceResourcePage.*.test.tsx` files plus the `humanizeKey` tests).
- The other tests naming the page or its module:
`spec-symbol-parity.test.ts`,
`ResourceHistoryPage.rollbackConfirm-13333.test.tsx`,
`scripts/__tests__/spec-symbol-ledger-app-shell-7265.test.ts`, plus
`product-neutral-renderer.ratchet.test.ts` → 4 files, 99 tests passed.
- `pnpm turbo run type-check --filter=@object-ui/app-shell --continue` →
30 of 30 tasks successful.
- `eslint` on the three touched source/test files → 0 errors, 2
warnings, both on lines this PR does not touch (`no-explicit-any` in the
`api` helper, `set-state-in-effect` on the load effect).
- `node scripts/check-changeset-presence.mjs` → pass; `node
scripts/check-changeset-no-major.mjs` → pass; `pnpm
check:new-line-citations` → 0 new citations.
## NOT MEASURED
- The whole `@object-ui/app-shell` suite and the full `pnpm test`: left
to CI's sharded run. Locally only the test files that name the page or
the helper were run, so a test elsewhere that asserts a datasource enum
option's raw text would not have been seen locally.
- No browser check against a live backend; the option text is read from
the rendered Radix select in jsdom.
- A declared option label (a future `oneOf`/`const`/`title` or similar
carrier) is not read; that is a maintainer ruling, not this card.
- [x] Adds no product-specific widget, dialog, hook or string (see
AGENTS.md › Product-neutral renderer)
Co-authored-by: Claude <noreply@anthropic.com>1 parent bba96ce commit ebd20ec
4 files changed
Lines changed: 165 additions & 4 deletions
File tree
- .changeset
- packages/app-shell/src/views/metadata-admin/datasource
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
237 | 238 | | |
238 | 239 | | |
239 | 240 | | |
240 | | - | |
241 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
242 | 244 | | |
243 | 245 | | |
244 | 246 | | |
| |||
586 | 588 | | |
587 | 589 | | |
588 | 590 | | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
589 | 596 | | |
590 | 597 | | |
591 | 598 | | |
592 | 599 | | |
593 | 600 | | |
594 | 601 | | |
595 | | - | |
| 602 | + | |
596 | 603 | | |
597 | 604 | | |
598 | 605 | | |
| |||
0 commit comments