Repository navigation
Commit d9aff15
Closes #13385
Clause-②: yes (widening: RecordContextValue gains optional
objectLabelNote; RecordTitleChip props gain optional objectLabelNote;
nothing is refused)
Closes #12614
This carries out the maintainer's ruling **B** on #13385 (comment
6369308948), which amends #12194 option a for Setup record pages only.
#12614's remaining item is item 2, and this is that change. Item 1 was
done in #23838.
## What changed
- **Setup record pages draw no floating `ManagedByBadge`.**
`RecordDetailView` leaves the badge out of `sharedChrome` (the floating
row and the print chrome row) when the page is inside Setup.
- **The header's object label carries the note instead.**
`RecordDetailView` hands the badge's note to `RecordContextProvider` as
the new host-injected `objectLabelNote`. `PageHeaderRenderer`
(`page:header`) forwards it to `RecordTitleChip`.
- **The chip shows it on hover and focus.** With a note,
`RecordTitleChip` makes its object-label span a focusable (`tabIndex=0`)
tooltip trigger, using the same `Tooltip` setup it already uses for
copy-id. The tooltip reads e.g. "Organization · Managed by the identity
provider" (zh: 「组织 · 由身份提供方管理」). The note is also the span's
`aria-describedby`, pointing at an `sr-only` sibling, so the description
is there whether or not the tooltip is open. Without a note, the label
draws exactly as before (pinned on its exact HTML).
- **`ManagedByBadge.tsx`** gains `useManagedByNote(managedBy)`, which
shares the variant lookup with the badge. Its docblock records the Setup
carve-out.
- **No other changes.** List headers (`ObjectView`) and every record
page outside Setup keep the badge unchanged. No shadcn file is touched,
and no locale key is added.
Both new members have doc comments saying they are host-injected and
what they show. `RecordContextValue` has no zod mirror. It does have a
type-level value-shape pin (`RecordContext.valueShape.pin.test.tsx`: the
`MEMO_DEP_KEYS` must equal `keyof RecordContextValue`), and that pin
went red under type-check until the new key was listed. The key is now
in the provider's memo dependency list and in that pin.
`RecordTitleChip` props have no mirror or snapshot. Docs:
`packages/components/README.md` gains a short section on the label's
host note.
## Judgment calls
1. **How Setup is detected: from the route.**
`isSetupAppSegment(appName)` matches both the package id
`com.objectstack.setup` and the name `setup`. It is the helper
`ObjectView` already uses for its Setup-only list shape. A `sys_*`
object opened in another app keeps the floating badge, as does a page
with no `:appName`.
2. **Note text: the badge's existing tooltip title**
(`managedByBadge.KEY.title`, e.g. `betterAuth.title`: 「由身份提供方管理」 /
"Managed by the identity provider"). The `body` strings are
paragraph-length. `platform` (and no value, or an unknown value) gives
no note, as the badge draws nothing for them. No new locale keys, so no
parity change.
3. **Gate kept.** The note sits behind the same `useCanAuthorMetadata()`
gate as the badge, so a caller who could not see the badge sees no note
either.
4. **Changeset levels:** `@object-ui/react` minor and
`@object-ui/components` minor, because each adds an optional member to a
published type. This follows the precedent of #13216, which scored
`RecordTitleChip`'s optional `titleNode` minor. `@object-ui/app-shell`
is patch. There is one changeset file and no `major`, and
`check-changeset-no-major` is green.
5. **Surface:** the seat approved widening the declared surface by three
files (`RecordContext.tsx`, `containers.tsx` (`PageHeaderRenderer`) and
`RecordTitleChip.tsx`), because the chip is drawn by `page:header` in
`@object-ui/components`, and `RecordDetailView` can only reach it
through the host-injected `RecordContext`. The README section and the
value-shape pin follow from those files.
## Tests
New:
-
`packages/components/src/__tests__/record-title-chip.objectLabelNote-13385.test.tsx`
(6): CONTROL, the label is byte-identical without a note (no focus stop,
no `aria-describedby`); with a note, the label is a focusable trigger
described by the note; focusing it opens a tooltip reading "Organization
· NOTE"; a note with no label draws nothing; `PageHeaderRenderer`
forwards the note from the context; CONTROL, a context with no note
gives the plain label.
-
`packages/app-shell/src/views/RecordDetailView.setupManagedByChip-13385.test.tsx`
(5), mounted on the real `/apps/:appName/:objectName/record/:recordId`
route: a Setup `sys_organization` page (`com.objectstack.setup`, and
`setup`) draws no floating badge and its header chip carries "Managed by
the identity provider"; CONTROL, a business-app (`crm`) record page
still draws the floating badge for an author, with no chip note;
CONTROL, an end user in Setup sees neither; CONTROL, a `platform` object
in Setup gives no note.
-
`packages/app-shell/src/views/ObjectView.setupListBadge-13385.test.tsx`
(2): CONTROL, the list header still draws the badge for an author in
Setup and in a business app. `ObjectView.tsx` itself is not in the diff.
Updated: `RecordContext.valueShape.pin.test.tsx` lists
`objectLabelNote`.
Results:
- **Every `RecordDetailView.*` test, every `*managedByBadge*` test
(ObjectView, RecordDetailView, RecordFormPage), `page-header*` and
`record-title-chip*`:** 98 files, 722 tests passed (`--maxWorkers=2`).
This run was on the first commit, which is the same code as HEAD; the
second commit changes only test files.
- **`packages/react/src/context/`:** 13 files, 139 tests passed.
- **Type-check** (`turbo run type-check --filter=@object-ui/react
--filter=@object-ui/components --filter=@object-ui/app-shell`): 32/32
tasks successful.
- **ESLint on touched files:** 0 errors (warnings only, all already in
the base files).
- **Gates:** `check:new-line-citations` reports 0 new;
`check-changeset-presence` and `check-changeset-no-major` are green.
**Ablation** (each restored from HEAD, and `git diff HEAD` empty
afterwards):
- With the Setup condition forced off in `RecordDetailView`, the 2 Setup
cases went red and the other 5 in those two files stayed green.
- With `RecordTitleChip` drawing the plain label whatever the note, 3 of
6 went red (the trigger, the tooltip and the header forward cases); the
two CONTROLs and the no-label case stayed green.
- With the forward removed from `PageHeaderRenderer`, only the forward
case went red (1 of 6).
**Screenshots:** not taken. Booting a Setup rig (objectstack dev server,
console and a seeded admin) did not fit the time box. The 1280 px light
and dark screenshots from the done-when are still owed.
- [x] Adds no product-specific widget, dialog, hook or string (see
AGENTS.md › Product-neutral renderer)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WJozybDmRH8z2c5SD7vJkj
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent ad74e98 commit d9aff15
11 files changed
Lines changed: 643 additions & 10 deletions
File tree
- .changeset
- packages
- app-shell/src
- components
- views
- components
- src
- __tests__
- custom
- renderers/layout
- react/src/context
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
62 | 72 | | |
63 | 73 | | |
64 | 74 | | |
| |||
156 | 166 | | |
157 | 167 | | |
158 | 168 | | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
159 | 198 | | |
160 | 199 | | |
161 | 200 | | |
162 | 201 | | |
163 | 202 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
| 203 | + | |
170 | 204 | | |
171 | 205 | | |
172 | 206 | | |
| |||
| 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 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
0 commit comments