Repository navigation
Commit 6090bb7
fix(app-shell): a Studio selection unfolds a hidden right panel at every width (#26824)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbJb35KmECWS5ewFYWdLwfje)_
Fixes #26737
Clause-②: no
Metadata-protocol: none
## 维护者速读
- **改了什么**:Studio
里右侧面板被隐藏时,选中一个元素(自动化里的流程节点、界面里的区块、数据里的字段)现在会把右侧面板展开,并直接显示该元素的属性。以前只有手机宽度会自动展开,桌面宽度下选中后配置哪里都不显示。
- **为什么改**:QA 实测 900×850 下隐藏右栏后点节点,没有抽屉也没有侧栏,用户必须重新找到右上角的切换按钮才能编辑选中的步骤。
- **风险与回滚**:低。只改了右栏宿主的 `showProps` 一处行为,不动任何元数据和
spec。注意它推翻了旧测试钉住的「隐藏的右栏在选中时保持隐藏」,三个设计面板一起生效。回滚即 revert 本 PR。
- **先看**:`StudioDesignSurface.tsx` 里 `showSlotProps`
的新定义;`StudioDesignSurface.pillarsClaimSlot-12725.test.tsx` 里替换掉的那条用例。
- **两分钟验证**:在 Studio 打开一个流程,点右上角图标隐藏右栏,再点任意节点,预期右栏展开并显示该节点的配置。
- **需要你做的**:无,席位落地。
## What changes
The Studio right slot's handle (`StudioRightSlotHandle`) documents
`showProps` as "An element was selected: show its properties". The host
implemented it as "switch the slot to properties, and open it only on a
phone" (`if (isMobile) setSlotOpenMobile(true)`), so at a desktop width
a selection made while the builder had hidden the panel set the mode and
drew the properties nowhere. In Automations the classic folded-row
drawer is the other path, and it is drawn only outside the slot
(`configFolded && !inSlot`), so neither path showed the node's
configuration.
`showSlotProps` now unfolds the slot at every width, through the same
`setSlotOpen` that the top-bar toggle and the slot shortcut use, so the
shown state is remembered under the Studio key as a click on the toggle
remembers it. On a phone nothing changes.
The function is now held in `useState` for the surface's life, reading
the latest `setSlotOpen` through a ref, instead of a `useCallback` keyed
on `isMobile`. The three pillars that call it run their effect on the
selection key and on this function. With the old memo, a re-created
callback (a breakpoint change, or React discarding the memo,
ui/AGENTS.md #10) re-ran those effects, and with this change that would
reopen a panel the builder had just hidden over the same selection. Now
a pillar asks again only on a new selection.
## Why
A builder who hides the right panel on a mid-size screen could not edit
the selected step without finding the toggle again (QA run
studio-qa-2026-10-27, id U9).
## Tests
- `StudioDesignSurface.pillarsClaimSlot-12725.test.tsx` (Automations):
the case "a hidden slot stays hidden on a selection, as on Interfaces"
is replaced. At a desktop width (no `md` match), the builder hides the
slot from the toggle, selects a node, and the slot is visible in
properties mode with that node's inspector, the toggle pressed and the
Studio key `1`, with no drawer. A second case: hidden again over the
same selection, the slot stays hidden, also when the same node is picked
again, and another node unfolds it.
- `StudioDesignSurface.rightSlot-12725.test.tsx` (Interfaces): hiding
the slot and selecting a block unfolds it on the block's properties.
- Ablation (one-off, not kept): with the fix committed, `node
scripts/ablation-replace.mjs` deleted `setSlotOpenRef.current(true);`
(anchor 1 → 0, blob `15f41dcf` → `dd54dbc7`). The two files ran red:
Tests 3 failed, 25 passed (28), exactly the three new cases. Restored:
blob equals HEAD, `git diff HEAD` empty.
## Acceptance notes
- **This reverses a pinned behaviour.** objectui#12725 phase 2 pinned "a
hidden slot stays hidden on a selection, as on Interfaces". The card,
its triage and the claim ask for the opposite (a selection shows its
configuration at every width), so this PR replaces that case rather than
keeping both. The maintainer's words that header quotes for phase 2
(「属性好需要考虑选中每个元素的时候也要显示」) ask for properties to show on every selection.
- **All three slot pillars change together.** The fix is in the slot
host, not in the Automations pillar, so a block selected in Interfaces
and a field selected in Data unfold a hidden panel too. A flow-only fix
would need either a second handle method or a drawer inside the slot
layout, and the slot layout deliberately draws no drawer (the pinned
case "a row too narrow for the classic aside opens no drawer"). The
classic layout's folded-row drawer is unchanged.
- **The unfold is remembered**, as the toggle and the shortcut remember
it: after a selection unfolds the panel, a reload shows it.
## Verification
All readings at head `367db7d0` (base `c8583f80`), under
`scripts/pm/os-verify-lock.sh`.
<details><summary>Touched package: @object-ui/app-shell</summary>
- Dependency closure and type-check: `pnpm exec turbo run type-check
--filter=@object-ui/app-shell --concurrency=2`, 64 tasks successful,
VERDICT command-exit 0. Re-run at `367db7d0`: `pnpm --filter
@object-ui/app-shell type-check` (`tsc --noEmit` and `tsc -p
tsconfig.test.json`), VERDICT command-exit 0.
- The two touched test files: Test Files 2 passed (2), Tests 28 passed
(28).
- Narrowed app-shell run: every test file naming `StudioDesignSurface`,
`useStudioRightSlot` or `StudioRightSlot` (169 files,
`StudioDesignSurface.flowCanvasChip-11665` left out: seat 1 holds it on
#26692): Test Files 169 passed (169), Tests 1333 passed (1333), VERDICT
command-exit 0. The rest of app-shell is left to CI's Test UI shards.
- ESLint with `ui/eslint.config.js` on the three touched files: 0
errors, and no warning on the changed lines.
</details>
<details><summary>Derived gates</summary>
- `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 34 commands for the 4 changed paths;
all 34 exit 0, each code captured before any pipe, among them
`check:nul-bytes`, `check:test-source-alias`,
`check:cross-package-test-inputs`, `check:type-check-coverage`,
`check:type-check-debt`, `check-sdui-manifest`, `check-empty-changeset`
and `check-changeset-no-major`. `pnpm --dir ui exec vitest run
scripts/`: Test Files 178 passed, 2 skipped (180), Tests 5065 passed, 2
skipped.
- `--ran` reconciled: "34 derived famil(ies) accounted for — 34 run, 0
NOT-MEASURED". `pnpm check:changeset-fixed` (roster under `.changeset`)
also ran, exit 0.
- `pnpm --dir ui run check:new-line-citations`: 0 new cross-file
line-address citations.
- Families CI runs over the whole tree (type-check lanes, lint, artifact
rosters) are CI's; the PR's check-runs are the reading.
</details>
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(not touched)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes. (lint is CI's)
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed. (not touched)
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QsR2jRkRJ1Po9y5UgWCsns
---
_Generated by [Claude
Code](https://claude.ai/code/session_01QsR2jRkRJ1Po9y5UgWCsns)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c4a4aef commit 6090bb7
4 files changed
Lines changed: 71 additions & 11 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views/studio-design
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
386 | | - | |
387 | | - | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
388 | 390 | | |
| 391 | + | |
389 | 392 | | |
| 393 | + | |
390 | 394 | | |
391 | 395 | | |
392 | | - | |
393 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
394 | 401 | | |
395 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
396 | 409 | | |
397 | | - | |
398 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
399 | 420 | | |
400 | 421 | | |
401 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
270 | 283 | | |
271 | 284 | | |
272 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1807 | 1807 | | |
1808 | 1808 | | |
1809 | 1809 | | |
1810 | | - | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
1811 | 1820 | | |
1812 | | - | |
1813 | | - | |
| 1821 | + | |
| 1822 | + | |
1814 | 1823 | | |
1815 | 1824 | | |
1816 | 1825 | | |
| |||
0 commit comments