Repository navigation
fix(array): add an edit button to list rows and make the edit dialog dismissable - #1645
Open
bacarndiaye wants to merge 1 commit into
Open
bacarndiaye wants to merge 1 commit into
bacarndiaye wants to merge 1 commit into
Conversation
…dismissable
- Each row of an array field now shows an "Edit" icon button next to "Delete".
Both icon-only buttons get an accessible name.
- The "Edit item" dialog can be closed with a close button or by clicking
outside. Editing is live ("Done" only closes the dialog), so nothing is lost.
- The "Add item" dialog is unchanged: it keeps its "Cancel" button and is not
dismissable, so a half-filled item is not discarded by accident.
Fixes Thinkmill#1644
Claude-Session: https://claude.ai/code/session_01QcoLHK1Y8FVsVZ8ayWSBwa
🦋 Changeset detectedLatest commit: 8e3862d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This branch has not been deployed
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.
Fixes #1644
What
Two small UX fixes for
fields.array()(andfields.blocks(), which reuses the same list view):aria-label), using the existingedit/deletel10n strings. No new strings.@keystar/ui'sDialogContaineralready supportsisDismissable; it was just never enabled here.Design notes
onClose. Dismissing the edit dialog is therefore equivalent to Done (and to pressing Esc, which already worked). Nothing is lost.isDismissableis onlytruewhilemodalState.state === 'edit'.array/ui.tsxchanges.blocks/ui.tsxgets the new row button for free through the sharedArrayFieldListView; its own dialogs are untouched (out of scope here).Testing
pnpm exec prettier --check,pnpm exec eslinton the changed file, andpnpm check:typesall pass.dev-projects/astro(temporarily switched tostorage: { kind: 'local' }, not committed), on the "Authors" array of the Posts collection:I have not added automated tests: I could not find existing component tests for the array UI to extend. Happy to add some if you point me to the preferred setup.
Not in this PR
localeonly covers 27 strings, so a translated UI comes out half-English #1578).fields.blocks()dialogs do not get the close button (related: fields.blocks: clicking a row no longer opens the edit dialog in 0.6.5 (works in 0.6.4) #1593).Claude-Session: https://claude.ai/code/session_01QcoLHK1Y8FVsVZ8ayWSBwa