Repository navigation
fix(app-shell): keep the Tab visibility name input across keystrokes - #27025
Merged
Merged
Conversation
Each row was keyed by the tab name its input edits, so every keystroke remounted the row and the input lost focus after the first character. Rows are now keyed by position, and the name input buffers what is typed, writing the rename only while the name is no other row's (a name passing through another row's merged the two rows and dropped one). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxbXbEWQehrHjkZUViYN
Contributor
Author
席位核对ACCEPT · seat 席位意见:Tab 可见性的行改按位置做 key,输入框不再每敲一个字就重挂载、丢焦点;改名先存在行内缓冲里,只在不与别的行重名时写回,避免两行合并丢一行。
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Fixes #26748
维护者速读
PermissionAdvancedFacets.tsx的tabEntries.map与文件末尾的TabNameInput。pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/PermissionAdvancedFacets.tabName-26748.test.tsx。What changes
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.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 intabPermissionsand dropped one. While the typed name collides, the input carriesaria-invalid.FacetPickertestIdis unchanged (tab-visibility-${tab}).Why
Typing
showcase_appinto a new row stored{"s":"hidden"}: the row remounted after the first key.Verification
PermissionAdvancedFacets.tabName-26748.test.tsx:userEvent.typeofshowcase_appkey 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.key={tab}turns the typed-name test red.PermissionAdvancedFacets*+PermissionMatrixEditor*: 35 files, 256 tests pass. The 24 derived gates, app-shell type-check, uicheck:spec-symbolsand eslint on both files exit 0.1) moves to the front oftabPermissions, so its row moves too.Clause-②: no
Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.@object-ui/app-shellis private:skip-changeset.)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxbXbEWQehrHjkZUViYN