Repository navigation
Commit 9f352e8
feat(studio): the main area adapts when the Studio right slot opens (#35128)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8EYLLcfPhnAg83bCHa7wckF)_
Fixes #35061
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Studio 右栏打开时主区域自适应——左侧对象 / 流程 / 导航 /
权限集列表在中间区域(列表加内容,右栏与控制台框架之间)不足 900 时收成 52
宽窄栏(每项一个字、悬停显示全名、顶部「»」浮层展开);权限矩阵窗格不足 1000 时只平铺新建 / 查看 / 编辑 / 删除,其余 6
项收进每行「更多权限」(已开 N 项),批量按钮收成「批量」菜单;记录表横向滚动条常显,选中的列自动滚进可见区;右栏可在 320–560
间拖宽,「属性」「AI 助手」各记宽度(默认 360 / 420)。
- 为什么改:右栏打开时主区域被挤到不能用(#35061,方向「挤压但让主区域自适应、不用浮层」已获「同意」)。
- 风险与回滚:只动 Studio 界面与浏览器本地偏好,不碰元数据与接口;收窄全靠 CSS
容器查询,右栏关闭或窗口够宽即恢复原样;旧的共用右栏宽度作废,每栏回到默认一次;回滚即还原本 PR。
- 先看:`StudioRail.tsx` 与
`studio-tokens.ts`(窄栏与浮层,四个栏共用)、`PermissionMatrixEditor.tsx`(矩阵折叠)、`studioRightSlotState.ts`(每栏宽度与
320–560 夹取)。
- 两分钟验证:1280×800 打开 Studio 并打开 AI 助手(420):左侧列表成窄栏,点「»」浮出完整列表、Esc 收回;1440
宽同样打开 AI 助手,列表保持完整;权限页一屏内可勾两个对象的增删改查、「更多权限」点开可改;关掉右栏,列表与 10 列矩阵恢复。
- 需要你做的:无,席位落地。
## What changes
One draft PR for the four items of #35061, on one branch. Items 4 and 1
are this dev's; items 2 and 3 came from a second dev and were merged in
with a real merge commit (`0be07d82`). After the merge: `c18a8193` moves
item 1's threshold to the pillars host (rail and content together) under
900 px, per the seat's reading of 「中间内容区」, and `d4174efd` brings the
permission field-panel e2e in line with item 2's fold (the red `Build &
E2E UI` at `0be07d82`).
| Item | What | Commit(s) | Tests |
|:--|:--|:--|:--|
| 1 · left rails narrow | the four rails draw 52 px while the slot is
open and the middle region (rail + content) is under 900 px; 「»」 floats
the full rail | `007014ce`, `50fedf06`, `6eaa56dc`, `f422b0d4`,
`c18a8193` | `StudioRail.noMatches-26733.test.tsx` → describe `the
rails' narrow form (objectstack#35061)`;
`StudioDesignSurface.rightSlot-12725.test.tsx` → describe `…the rails
read whether it squeezes the pillars (objectstack#35061)` |
| 2 · permission matrix | under a 1000 px matrix pane: four CRUD columns
flat, six behind 「更多权限」, one 「批量」 menu | `b90c8c6e`, `c65c7a66`,
`3712d751`, `d4174efd` | `PermissionMatrixEditor.fold-35061.test.tsx` (6
tests); `ui/e2e/permission-field-panel-scroll.spec.ts` Studio 720 px
case reads the folded form |
| 3 · records table | scrollbar at rest; a selected field's column
scrolls into view | `279f7c4c`, `7d6da261` |
`DataPillar.recordsScroll-35061.test.tsx` (8 tests) |
| 4 · right slot resizable | 320–560 range; properties and copilot each
remember their own width (defaults 360 / 420) | `22185a4f`, `1be92568`,
`18f0da4f` | `studioRightSlot-12725.test.tsx` → describe
`StudioRightSlot pane widths (objectstack#35061)` |
**Item 1** (`ui/packages/app-shell/src/views/studio-design/`): while the
right slot shows beside the pillars and the middle region it leaves
them, the pillars host (rail and content together, between the console
chrome and the slot), is under 900 px, every Studio rail (Data,
Automations, Interfaces, Access) draws 52 px wide. Each row shows one
character of its name (`railAbbreviation`, a whole grapheme, upper-cased
in the display locale) as generated content, so the row's text and
accessible name are unchanged; the full name is the row's hover. Groups
show as a rule; anything that is not a row or a group (empty notes, the
nav editor) leaves the narrow list. A 「»」 bar floats the full rail over
the content column until a row is picked, Escape (focus back on 「»」) or
a click outside. The rule is the `dataTabsFold.ts` way: a CSS container
query on the pillars' host (`STUDIO_PILLARS_HOST`, `@max-[900px]`,
`STUDIO_RAIL_NARROW_HOST_WIDTH`), plus the host's `data-studio-slot`
marker, which the surface sets only while the slot squeezes the pillars
(not under `md`). No JS width read, nothing reads an edit mode, and the
rail keeps `STUDIO_RAIL_WIDTH` in every pillar and mode
(objectui#12519). Phones keep the rail's own overlay.
**Item 2** (`views/metadata-admin/PermissionMatrixEditor.tsx`,
`permissionMatrixFold.ts`): below a 1000 px matrix pane each
Access-pillar object row keeps Create / Read / Edit / Delete flat; the
other six (Export, Transfer, View all, Modify all, read and write scope)
move behind the row's 「更多权限」 button, which shows 「已开 N 项」 and opens them
in a row beneath; the All · Read only · None · Read & write strip
becomes one 「批量」 menu. At 1000 px and wider the matrix is the full flat
grid. Setup's permission page is a different table and does not fold.
**Item 3** (`views/studio-design/recordsGridChrome.ts`, the Data
pillar's Records tab): the grid's horizontal scrollbar shows at rest,
and a field selected by its column header or from the field list scrolls
its column into view, clear of the frozen name column. Column widths,
the frozen column and the 400 px long-text ceiling are the runtime
grid's, unchanged.
**Item 4**: `clampStudioSlotWidth` keeps the slot within 320–560 px and,
as before, never so wide that the canvas drops under
`DOCK_CONTENT_MIN_WIDTH` (520); the console drawer's `clampDockWidth` is
untouched. `useStudioSlotWidth(mode)` keeps one width per pane under
`studio-right-slot-width-props` / `studio-right-slot-width-copilot`. The
width both panes used to share (`studio-right-slot-width`) is removed on
first read, not migrated: carrying it into either pane would override
the default the card names for it. The copilot's in-place widen keeps
its own width outside the range, and the phone overlay keeps its own
fixed width with no handle (card: 「不改手机端」).
## Tests
New pins go into each component's existing harness file as a new
top-level describe where one exists (the repository rule for a component
with a shared harness), and into new files named for #35061 where none
does. Existing pins my change made false were updated in place: the
slot's old width pin moved to a 1000 px viewport (a 643 px slot is now
outside the range), and the Objects rail's row collector in
`DataPillar.draftObjectLabel-11843.test.tsx` skips the new 「»」 control.
## Acceptance notes
- objectui#12519 read as left-rail only; per-pane widths per #35061 item
4 (maintainer 「同意」 2026-11-17)
- Item 1 threshold, the seat's reading: 「中间内容区」 is the middle region
between the console chrome and the right slot, the pillars host (rail +
content). The rail narrows while the slot is open and that host is under
900 px: with the copilot at 420 px, 1280 narrows (host 860) and 1440
keeps the full rail (host 1020), as the card's acceptance lines read.
With the properties pane at its 360 px default a 1280 px window leaves a
920 px host, so the rail stays 240 px there. The slot-open marker stays
an input, so a narrow window with the slot closed keeps the full rail.
- `Build & E2E UI` was red at `0be07d82` (run 44264198825):
`permission-field-panel-scroll.spec.ts`, Studio rendering at a 720 px
pane, expected the matrix to scroll past its 1304 px floor and read 720.
Root cause is this PR: item 2 drops that floor for the Studio rendering
under 1000 px (`PERM_MATRIX_TABLE_FLOOR =
'@min-[1000px]:min-w-[1304px]'`), so nothing scrolls there by design.
That one case now asserts the folded form (the row's More permissions
toggle shows, the matrix fits the pane, every Read and Edit box answers
at its centre); the Studio 1000 px and both metadata-admin cases keep
the sideways sweep. No test skipped or quarantined.
- Item 1: the pillars' host is now a size container, so an unnamed
container query inside a pillar with no nearer container answers the
host's width (before, it matched nothing). The Studio's own unnamed
queries all sit under a nearer container (the item header row, the Data
content column, the form designer sections, the matrix pane).
- Item 1: the narrow rows' character is generated content with an empty
alternative, so a screen reader keeps the row's own name (checked in
Chromium: the narrow rail's accessibility tree names each row by its
full label).
- Clause-② measured no: the `studio` namespace's built declarations type
each catalogue as `Record<string, string>`, so no key is published in a
type.
## Verification
<details><summary>Head d4174ef: the threshold rework and the e2e
fix</summary>
- Affected tests (`StudioRail.noMatches-26733`,
`StudioDesignSurface.rightSlot-12725`,
`InterfacesPillar.editRailWidth-12519`, `studioRightSlot-12725`,
`DataPillar.draftObjectLabel-11843`): Test Files 5 passed (5), Tests 66
passed (66). `pnpm --filter @object-ui/app-shell type-check`: VERDICT
command-exit 0. `tsc -p ui/tsconfig.e2e.json`: exit 0.
- `permission-field-panel-scroll.spec.ts` (chromium): at `c18a8193` 1
failed, 5 passed, with CI's reading (`Expected: >= 1304`, `Received:
720`); at `d4174efd` 6 passed, studio-720 reading `scrollWidth 720 /
clientWidth 720, covered []`. One-time mutation:
`PERM_MATRIX_TABLE_FLOOR` made unconditional (`ablation-replace` anchor
1 to 0) turns the new case red (`Expected length: 1, Received length:
9`, the pane scrolls 720/1304); restored, blob `f11c748f` matches HEAD,
`git diff HEAD` empty. The spec bundles from source, so no build was in
the path.
- `dispatch-gates --commands` at d4174ef: the same 39 families, each
run in the foreground with its exit code recorded, all 0; `--ran`: 39
derived, 39 run, 0 NOT-MEASURED, 0 UNRUN. `overlap-check` against
origin/main `99a0e4fb`: VERDICT clean exit 0.
</details>
<details><summary>Merged head 0be07d8: type-check, tests,
gates</summary>
- `pnpm --filter @object-ui/i18n run type-check && pnpm --filter
@object-ui/app-shell run type-check`: VERDICT command-exit 0.
- The four items' 35061 files, the slot and rail harnesses,
`PermissionMatrixEditor.*`, `StudioDesignSurface.access*`: Test Files 62
passed (62), Tests 451 passed (451).
- `DataPillar.*`, `StudioDesignSurface.grid*`: Test Files 42 passed
(42), Tests 213 passed (213).
- Rail-reading suites (`railLabels`, `flowRegistration-12349`,
`flowStatusTruth-11779`, `oneSurface-28572`, `railUnboundReason-11281`,
`InterfacesPillar.offNav*`), `packages/i18n/`, the product-neutral
ratchet: Test Files 112 passed (112), Tests 2109 passed, 13 skipped.
- Before the merge, at `6eaa56dc`: all of `views/studio-design/` plus
`packages/i18n/`: Test Files 452 passed (452), Tests 4695 passed, 13
skipped.
- `dispatch-gates --commands` at 0be07d8: 39 families, each run with
its exit code recorded, all 0; `--ran` reconciliation: 39 derived, 39
run, 0 NOT-MEASURED, 0 UNRUN. `check:new-line-citations`: 0 new.
</details>
<details><summary>Item 1 in Chromium (the real StudioRail,
server-rendered, its Tailwind classes compiled)</summary>
Host width / rail / content, at `c18a8193` (narrow below a 900 px host):
1280 with slot 420 → 860 / 52 / 808; 1280 with slot 360 → 920 / 240 /
680; 1280 slot closed → 1280 / 240 / 1040; 1440 with slot 420 → 1020 /
240 / 780; 1600 with slot 420 → 1180 / 240 / 940; 1024 slot closed →
1024 / 240 / 784. In the narrow form the heading, search, footer, group
headers and non-row notes are not displayed and each row's generated
content is its first character; floating (1280/420), the panel is 240 px
over the content with everything shown.
</details>
NOT MEASURED: the full console at 1280×800 against a running backend
(all four items), reason: no dev stack was started in this container;
the layout readings above are from the real rail markup and its compiled
CSS, and the matrix and grid layouts from jsdom pins only.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbXYKPekZAeSQcgVzBN
<!-- signed: repo:objectstack#1 · os-warren ·
session_01JQwxbXYKPekZAeSQcgVzBN -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent d053c7d commit 9f352e8
20 files changed
Lines changed: 1423 additions & 126 deletions
File tree
- .changeset
- ui
- e2e
- packages
- app-shell/src/views
- metadata-admin
- studio-design
- __tests__
- i18n/src/namespaces/studio
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
412 | 418 | | |
413 | 419 | | |
414 | 420 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
430 | 440 | | |
431 | 441 | | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
432 | 455 | | |
433 | 456 | | |
434 | 457 | | |
| |||
| 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 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 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 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
0 commit comments