Repository navigation
Commit ee2aaf0
feat(app-shell): a Studio rail search that matches nothing names the query and offers to clear it (#26959)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8CbVK4eWbzTwqdFcwRSZgVo)_
Fixes #26733
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:Studio
的数据、自动化、权限三个侧栏共用一个「搜索无结果」状态:写出搜不到的关键词,并给一个「清除搜索」按钮,点了清空搜索框、列表恢复。
- 为什么改:之前数据和权限侧栏搜不到时整列空白,看起来像加载失败;自动化侧栏有一句提示但没有退路。
- 风险与回滚:只动侧栏的显示,不改任何过滤或排序;回滚即 revert 本 PR,i18n 包只多一个文案键。
- 先看:`StudioRail.tsx`(新状态与 `matchCount`
判定),`StudioDesignSurface.tsx`(三处侧栏只传匹配数;数据侧栏的过滤原样上提成常量),新测试文件。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/StudioRail.noMatches-26733.test.tsx`,预期
13 条全绿。
- 需要你做的:无,席位落地。
## What changes
- `StudioRail` (shared by every Studio pillar) gains
`search.matchCount`: how many rows the pillar's own filter left. When
the query is non-blank, `matchCount` is 0 and the list was not empty
before searching (`count !== 0`), the rail shows one state under the
list: the existing `engine.list.emptyQuery` sentence naming the trimmed
query, and a **Clear search** button that calls `search.onChange('')`
and focuses the box again.
- Data rail: the object filter is hoisted, unchanged, into
`shownObjects` so its length can be handed to the rail; Automations
passes `shownFlows.length`; Access passes `filtered.length`. No rail
filters or sorts differently.
- The Automations rail's own copy of the no-matches sentence is removed:
the rail now says it, once, for all three.
- `@object-ui/i18n` `studio` namespace: new row
`engine.studio.rail.clearSearch` (en "Clear search", zh "清除搜索"); patch
changeset.
- A blank query, or an empty package, never shows the line: each
pillar's existing empty sentence keeps speaking there.
## Why
A builder who mistyped a rail search saw an empty column on Data and
Access and could not tell a failed load from no matches (card #26733,
from the studio-qa-2026-10-27 batch).
## Tests
New `StudioRail.noMatches-26733.test.tsx` renders the real Data,
Automations and Access pillars. Per rail: a query that matches nothing
shows the state naming the query and no row; Clear search empties and
focuses the box and restores every row; a matching query shows no state;
an empty package keeps its own sentence with no no-matches line, with or
without a query. Plus a zh case (the state's sentence and the button
read in Chinese).
<details><summary>Readings at head 66aa3c5</summary>
- New file: Test Files 1 passed, Tests 13 passed.
- `pnpm --dir ui exec vitest run
packages/app-shell/src/views/studio-design/` (includes the existing
Automations rail search pin): Test Files 234 passed, Tests 1703 passed.
- `pnpm --dir ui exec vitest run packages/i18n/`: 89 files passed, 1373
passed, 13 skipped.
- `pnpm --filter @object-ui/app-shell run type-check` and `pnpm --filter
@object-ui/i18n run type-check`: exit 0.
- Ablation: the rail's `noMatches` branch replaced with `false` through
`scripts/ablation-replace.mjs` (anchor 1 to 0, blob 805acee to
a4f216f0): 7 failed, 6 passed. The 7 are every positive case (three
rails times two, plus zh); the 6 green are the matching-query controls
and the empty-package cases, as expected. Restored: blob equals HEAD,
`git diff HEAD` empty.
</details>
## Acceptance notes
- Measured before the fix on `origin/main` 5ec398d: Data and Access
rendered nothing under a non-matching query; Automations already printed
`engine.list.emptyQuery` but had no clear action. The card's premise
holds for Data and Access and half-holds for Automations.
- The sentence reuses the existing `engine.list.emptyQuery` row
(straight quotes around the query), so no new sentence row was added and
the existing Automations pin still reads the same text.
## Verification
<details><summary>Derived gates (34) at head 66aa3c5</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 34 families; all 34 ran with exit 0,
and `--ran` reconciled 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN. Also
run: `check:i18n-designer-parity` exit 0, `check:new-line-citations`
exit 0 (0 new citations), eslint on the five touched source files exit 0
(0 errors; 16 warnings, all on untouched lines of
`StudioDesignSurface.tsx`).
</details>
## 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.
- [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran; eslint
is clean on the touched files, and the repo-wide `pnpm lint` is CI's
run.)
- [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_01JQwxbZPJiXo3QSt3ShH9c1
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JQwxbZPJiXo3QSt3ShH9c1)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5bd3d2f commit ee2aaf0
6 files changed
Lines changed: 337 additions & 34 deletions
File tree
- .changeset
- ui/packages
- app-shell/src/views/studio-design
- i18n/src/namespaces/studio
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6327 | 6327 | | |
6328 | 6328 | | |
6329 | 6329 | | |
| 6330 | + | |
| 6331 | + | |
| 6332 | + | |
| 6333 | + | |
| 6334 | + | |
6330 | 6335 | | |
6331 | 6336 | | |
6332 | 6337 | | |
| |||
6345 | 6350 | | |
6346 | 6351 | | |
6347 | 6352 | | |
6348 | | - | |
| 6353 | + | |
| 6354 | + | |
| 6355 | + | |
| 6356 | + | |
| 6357 | + | |
| 6358 | + | |
6349 | 6359 | | |
6350 | 6360 | | |
6351 | 6361 | | |
| |||
6354 | 6364 | | |
6355 | 6365 | | |
6356 | 6366 | | |
6357 | | - | |
6358 | | - | |
6359 | | - | |
6360 | | - | |
6361 | | - | |
6362 | | - | |
6363 | | - | |
6364 | | - | |
6365 | | - | |
6366 | | - | |
6367 | | - | |
6368 | | - | |
6369 | | - | |
6370 | | - | |
6371 | | - | |
6372 | | - | |
6373 | | - | |
6374 | | - | |
6375 | | - | |
6376 | | - | |
6377 | | - | |
6378 | | - | |
6379 | | - | |
6380 | | - | |
6381 | | - | |
6382 | | - | |
| 6367 | + | |
| 6368 | + | |
| 6369 | + | |
| 6370 | + | |
| 6371 | + | |
| 6372 | + | |
| 6373 | + | |
| 6374 | + | |
| 6375 | + | |
| 6376 | + | |
| 6377 | + | |
| 6378 | + | |
| 6379 | + | |
| 6380 | + | |
| 6381 | + | |
| 6382 | + | |
| 6383 | + | |
| 6384 | + | |
| 6385 | + | |
6383 | 6386 | | |
6384 | 6387 | | |
6385 | 6388 | | |
| |||
7978 | 7981 | | |
7979 | 7982 | | |
7980 | 7983 | | |
| 7984 | + | |
7981 | 7985 | | |
7982 | 7986 | | |
7983 | 7987 | | |
| |||
8039 | 8043 | | |
8040 | 8044 | | |
8041 | 8045 | | |
8042 | | - | |
8043 | | - | |
8044 | | - | |
8045 | | - | |
8046 | | - | |
8047 | 8046 | | |
8048 | 8047 | | |
8049 | 8048 | | |
| |||
8896 | 8895 | | |
8897 | 8896 | | |
8898 | 8897 | | |
8899 | | - | |
| 8898 | + | |
| 8899 | + | |
| 8900 | + | |
| 8901 | + | |
| 8902 | + | |
| 8903 | + | |
8900 | 8904 | | |
8901 | 8905 | | |
8902 | 8906 | | |
| |||
| 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 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
0 commit comments