@object-ui/fields 14.0.0 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,167 @@
1
1
  # @object-ui/fields
2
2
 
3
+ ## 14.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 579b24d: feat(fields+form+detail): file/image uploads in inline line-item grids (#2360)
8
+
9
+ `Field.file` in a master-detail inline grid previously degraded to a plain text
10
+ input (no `input[type=file]` on the page → no way to upload from the grid), and
11
+ auto-derived subform / related-list columns silently dropped file fields.
12
+
13
+ - **fields**: new `FileCell` — a compact upload control for grid cells (upload
14
+ button + removable chips, image thumbnails), sharing the `UploadProvider`
15
+ pipeline with the full-size `FileField` via an extracted `useFileUploads`
16
+ hook. `GridField` supports `type: 'file'` columns (with `accept` /
17
+ `multiple`), renders file names in list/readonly modes, and no longer falls
18
+ back to a text `<Input>` for file columns.
19
+ - **plugin-form**: `deriveColumns` / `hydrateColumns` no longer exclude
20
+ `file`/`image`/`avatar` fields — they map to `file` columns and carry the
21
+ field's `multiple` + `accept` (image fields default to `['image/*']`).
22
+ - **plugin-detail**: auto-derived related-list columns no longer skip
23
+ `file`/`image` fields — they render through the existing FileCellRenderer /
24
+ ImageCellRenderer (file-name chip / thumbnail).
25
+
26
+ ### Patch Changes
27
+
28
+ - 2efa9fd: Detail-page UX follow-ups from the ADR-0085 PR4 real-backend browser pass (framework#2548):
29
+
30
+ - **Highlight strip no longer repeats the record title.** A declared
31
+ `highlightFields` list containing the title field rendered it as the first
32
+ chip — truncated — directly under the identical page H1. `deriveHighlightFields`
33
+ now resolves the title (`primaryField` / `nameField` / deprecated
34
+ `displayNameField`, else the conventional display-field names) via the new
35
+ exported `resolveTitleField` and filters it from declared lists before the
36
+ 4-chip cap, matching what the heuristic branch always did. app-shell's
37
+ `RecordDetailView` synthParts (which pre-computes the list and bypasses the
38
+ derivation) applies the same filter.
39
+ - **Per-field currency reaches the renderers.** The spec channel
40
+ (`currencyConfig.defaultCurrency`) was dropped by the highlight-strip and
41
+ detail-section field enrichment, so a spec-authored currency field could
42
+ never show its symbol ("25,000,000" instead of "$25,000,000");
43
+ `resolveFieldCurrency` reads it second after the designer-only bare
44
+ `currency` key.
45
+ - **app-shell approvals fetches send the Bearer token.** The header badge
46
+ poll, home-inbox count, and record-page approvals panel were cookie-only
47
+ (new shared `bearerAuthHeaders()` util) — same split-origin failure mode as
48
+ the console `approvalsApi` fix below.
49
+ - **`fieldGroups[].icon` / `description` reach detail pages.** The shared
50
+ derivation (ADR-0085 §5) already passed them through; the detail synth
51
+ dropped them. Sections now carry both, and `DetailSection` renders a real
52
+ Lucide icon for identifier-shaped names (emoji/text values keep the
53
+ historical text rendering).
54
+ - **Record meta footer stops dangling without an actor.** Seeded/system rows
55
+ with `created_by: null` rendered "Created by · 10m ago"; the footer now
56
+ falls back to actor-less labels ("Created / Updated"), with new i18n keys in
57
+ all six locales (and the zh `createdBy`/`updatedBy` mistranslation fixed:
58
+ 创建人/更新人, not 创建于/更新于).
59
+ - **Select badges ellipsize instead of clipping mid-glyph.** In bounded
60
+ containers (highlight-strip columns, grid cells) an overlong option label
61
+ used to be cut at the container edge ("Technolog…"); badges now shrink with
62
+ an inner truncate and expose the full label as a hover title. The highlight
63
+ strip's hover title also prefers the option label over the raw stored value.
64
+
65
+ Console app (unversioned): `approvalsApi` now sends the stored Bearer token
66
+ like every other console call — cookie-only auth silently lost the approvals
67
+ surface on split-origin deployments where the SameSite cookie doesn't flow.
68
+
69
+ - 2b30583: fix(fields): LookupCellRenderer honors the target object's configured `display_field` (framework#2926 ⑧). ObjectGrid already forwarded `display_field` on the column meta, but the read cell ignored it and always ran the hardcoded heuristics (`name` first), so lookup columns showed the raw API name instead of the configured display/label field. The preferred field now threads through every render path (expanded objects, arrays, JSON strings, and the on-demand `useLookupName` fetch, whose cache key includes the display field to prevent cross-column stale names).
70
+ - 3e8bf07: fix(fields): PeoplePicker keyboard cursor no longer resets on identity-only
71
+ result re-emissions
72
+
73
+ The cursor-reset effect keyed on the records array identity, so a background
74
+ refetch returning the same records (StrictMode double-effect, refetch-on-focus)
75
+ yanked the active row back to none mid-navigation — surfacing as a flaky
76
+ ArrowDown→Enter CI test and a real (if rare) keyboard UX glitch. The reset is
77
+ now keyed on the record-id signature, so the cursor only resets when the
78
+ results actually change.
79
+
80
+ - 4afb251: Record-level inline edit polish (objectui#2572, follow-up to #2407) — the five
81
+ rough edges from the live showcase verification pass:
82
+
83
+ - **Expanded reference values pass through to the picker.** `InlineFieldInput`
84
+ no longer collapses an `$expand`-ed record object to a bare id before
85
+ handing it to `LookupField` / `UserField` — the picker resolves the display
86
+ name it already carries instead of re-fetching the referenced record via
87
+ `findOne` (or sticking on the placeholder when it can't). `LookupField`
88
+ still hands its Level-2 pickers (PeoplePicker / RecordPickerDialog) bare
89
+ ids, collapsed via the existing `normalizeId`.
90
+ - **Approval-lock preflight.** The record page now re-reads the approval
91
+ state whenever the record is invalidated (a save can _trigger_ an approval
92
+ flow that locks the record), derives one `approvalLocked` signal
93
+ (`approval_status` pending/in_approval OR an open pending request), gates
94
+ the inline-edit session's `canEdit` with it — hiding the pencil affordances
95
+ and no-op'ing `enter()` on a locked record — and drives the save bar's
96
+ `locked`/`lockedHint` so users can't type into a draft that Save would
97
+ reject with `RECORD_LOCKED`.
98
+ - **Numeric field types edit with the real numeric widgets.** `number` /
99
+ `currency` / `percent` route to `NumberField` / `CurrencyField` /
100
+ `PercentField` (the same widgets the form uses) instead of a free-text
101
+ input: numeric keyboard, symbol adornment, fraction↔percent display
102
+ conversion, and numbers (not strings) into the draft. `NumberField` and
103
+ `CurrencyField` now surface metadata `min`/`max` on the input, `NumberField`
104
+ honors an explicit `step` and steps by 1 for `scale: 0` (previously fell
105
+ back to `any`).
106
+ - **Header Edit CTA stands down during an inline session.** The synthesized
107
+ `sys_edit` action carries `disableDuringInlineEdit`, and the `page:header`
108
+ renderer greys such actions out while `InlineEditContext.editing` — the
109
+ classic form-edit surface can no longer be stacked on top of a live inline
110
+ draft.
111
+ - **Keyboard shortcuts for the shared edit session.** `InlineEditSaveBar`
112
+ binds **Esc → cancel** (deferring to any open Radix layer — popover /
113
+ select / dialog — which owns Escape for "close") and **Cmd/Ctrl+Enter →
114
+ save**, both respecting `saving`/`locked`.
115
+
116
+ - 2712fc1: fix(fields+detail): resolve the pre-existing rules-of-hooks violations in the cell renderers
117
+
118
+ - `CurrencyCellRenderer` / `EmailCellRenderer` / `PhoneCellRenderer` called
119
+ hooks (`useLocalization`, `useFieldLabel`, `useState`) **after** their
120
+ empty-value early return — a value flipping between null and set changed
121
+ the hook count between renders (latent "Rendered more hooks than during
122
+ the previous render" crash). Hooks now run unconditionally before the
123
+ early return.
124
+ - `useFieldLabel` wrapped `useObjectTranslation()` in try/catch; a throw
125
+ after other hooks ran would desync hook order. The underlying hook is
126
+ provider-safe (optional context + global i18n fallback), so the guard is
127
+ removed.
128
+ - `ReferenceCellRenderer` no longer constructs JSX inside try/catch (the
129
+ try can't catch render errors anyway) — the display string is computed in
130
+ the try, rendered outside.
131
+ - `RecordMetaFooter`'s UserRef renders the registry cell renderer via
132
+ `React.createElement` instead of a locally-assigned capitalized JSX tag
133
+ (flagged as component-creation-during-render; the registry reference is
134
+ stable).
135
+
136
+ No behavior change intended; eslint react-hooks errors on these files drop
137
+ to zero.
138
+
139
+ - Updated dependencies [82441e4]
140
+ - Updated dependencies [2efa9fd]
141
+ - Updated dependencies [0890fa7]
142
+ - Updated dependencies [2ded18c]
143
+ - Updated dependencies [e628d1f]
144
+ - Updated dependencies [5523fc4]
145
+ - Updated dependencies [887062c]
146
+ - Updated dependencies [23d65c3]
147
+ - Updated dependencies [055e1d2]
148
+ - Updated dependencies [9e2d58f]
149
+ - Updated dependencies [dea65f7]
150
+ - Updated dependencies [f30ff68]
151
+ - Updated dependencies [073e7aa]
152
+ - Updated dependencies [6c0135c]
153
+ - Updated dependencies [5b52624]
154
+ - Updated dependencies [4afb251]
155
+ - Updated dependencies [d5b1bc0]
156
+ - Updated dependencies [f94905d]
157
+ - Updated dependencies [f0f10f5]
158
+ - @object-ui/i18n@14.1.0
159
+ - @object-ui/core@14.1.0
160
+ - @object-ui/types@14.1.0
161
+ - @object-ui/react@14.1.0
162
+ - @object-ui/components@14.1.0
163
+ - @object-ui/providers@14.1.0
164
+
3
165
  ## 14.0.0
4
166
 
5
167
  ### Minor Changes
package/README.md CHANGED
@@ -55,6 +55,17 @@ Supported types out of the box:
55
55
  - **Media**: `file`, `image`
56
56
  - **System**: `formula`, `summary`, `auto_number`
57
57
 
58
+ ### File uploads in line-item grids
59
+
60
+ `GridField` (the master-detail line-items grid) supports `type: 'file'` columns:
61
+ the cell renders a compact upload button plus removable file chips (thumbnails
62
+ for images) instead of degrading to a text input, so users can attach a receipt
63
+ or photo per row without opening the row form (objectui#2360). Columns accept
64
+ `accept?: string[]` and `multiple?: boolean`; uploads run through the same
65
+ `UploadProvider` pipeline as the full-size `FileField` (the compact control is
66
+ exported as `FileCell`). Auto-derived subform columns map `file`/`image`/
67
+ `avatar` fields to file columns instead of dropping them.
68
+
58
69
  ### Cascading & role-gated select options
59
70
 
60
71
  `select` options support a per-option `visibleWhen` CEL predicate (offered only
File without changes