Repository navigation
Commit 3230bdb
fix(app-shell): keep the Tab visibility name input across keystrokes (#27025)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8HLVrp8SYSogdEQyNHRBNsf)_
Fixes #26748
## 维护者速读
- 改了什么:Studio Access › 标签页可见性的每一行改按位置作 React
key,名称输入框改为行内缓冲,只在新名称不与其它行重名时写回草稿。
- 为什么改:行 key 原是输入框正在编辑的标签名,每按一键整行重挂载,焦点丢失,只留下首字符。
- 风险与回滚:只动 Tab Visibility 区块与一个新测试文件;回滚即 revert 本 PR。
- 先看:`PermissionAdvancedFacets.tsx` 的 `tabEntries.map` 与文件末尾的
`TabNameInput`。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/metadata-admin/PermissionAdvancedFacets.tabName-26748.test.tsx`。
- 需要你做的:无,等待 seat 复核。
## What changes
- Each Tab Visibility row is keyed by its position in `tabEntries`, not
by the tab name its input edits. A rename keeps insertion order, so the
row and the input's focus survive each keystroke.
- The name input (`TabNameInput`) buffers what is typed and writes the
rename only while the name is no other row's. Before, a name that passed
through or ended at another row's name merged the two rows in
`tabPermissions` and dropped one. While the typed name collides, the
input carries `aria-invalid`.
- `FacetPicker` `testId` is unchanged (`tab-visibility-${tab}`).
## Why
Typing `showcase_app` into a new row stored `{"s":"hidden"}`: the row
remounted after the first key.
## Verification
- New `PermissionAdvancedFacets.tabName-26748.test.tsx`:
`userEvent.type` of `showcase_app` key by key keeps focus and stores `{
showcase_app: 'hidden' }`; renaming an existing row keeps the other row
and order; typing through another row's name merges nothing; remove
drops only its own row.
- Ablation: restoring `key={tab}` turns the typed-name test red.
- `PermissionAdvancedFacets*` + `PermissionMatrixEditor*`: 35 files, 256
tests pass. The 24 derived gates, app-shell type-check, ui
`check:spec-symbols` and eslint on both files exit 0.
- Known limit, unchanged: a tab name JS orders as an integer (e.g. `1`)
moves to the front of `tabPermissions`, so its row moves too.
Clause-②: no
Metadata-protocol: none
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [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.
(`@object-ui/app-shell` is private: `skip-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/`.
- [ ] 8. Title, body and comments are in English. (The dispatch order
asks for the Chinese 维护者速读 block.)
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JQwxbXbEWQehrHjkZUViYN
Co-authored-by: Claude <noreply@anthropic.com>1 parent cb8988e commit 3230bdb
2 files changed
Lines changed: 156 additions & 7 deletions
File tree
- ui/packages/app-shell/src/views/metadata-admin
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
784 | 787 | | |
785 | | - | |
786 | | - | |
| 788 | + | |
| 789 | + | |
787 | 790 | | |
788 | 791 | | |
789 | 792 | | |
790 | 793 | | |
791 | | - | |
792 | 794 | | |
793 | 795 | | |
794 | 796 | | |
| |||
967 | 969 | | |
968 | 970 | | |
969 | 971 | | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
0 commit comments