Repository navigation
fix(editor): keep the saved-block delete confirm on one line and keyboard focus in place - #898
Merged
Merged
Conversation
In a crowded saved-block card (five type icons plus a "+N" count) the full confirm question wrapped onto two lines, grew the card and squeezed the icons, and the longer locales made it worse. The confirm now shows a short label (savedBlocks.deleteConfirmShort) and keeps the full question as its accessible name, and only the timestamp gives way in the row.
Arming a delete, confirming it and closing an inline rename each unmounted the focused control, dropping focus to the page, and Escape on an armed confirm closed the whole browser. Focus now moves to the confirm when it appears; a delete hands it to the entry that took the deleted one's place (else the previous one, else the search box); Enter or Escape in a rename returns it to Rename; and Escape on the confirm disarms back to Delete with the browser left open.
orkhanahmadov
enabled auto-merge (squash)
October 9, 2026 20:46
Deploying templatical-docs with
|
| Latest commit: |
ca7cf75
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ed12dc7a.templatical-docs.pages.dev |
| Branch Preview URL: | https://claude-saved-block-confirm-w.templatical-docs.pages.dev |
Deploying templatical-playground with
|
| Latest commit: |
ca7cf75
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://642514b9.templatical-playground.pages.dev |
| Branch Preview URL: | https://claude-saved-block-confirm-w.templatical-playground.pages.dev |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Summary
This PR fixes two problems with the card actions in the saved-blocks browser, both in the card's bottom row of
SavedBlocksBrowserModal.vue.The delete confirm wrapped in crowded cards. A card's bottom row holds up to five 14px type icons, a "+N" count, the timestamp and the actions. On an entry with seven block types, the armed confirm ("Delete this saved block?") wrapped onto two lines: 108×36px instead of 21px tall. That grew the card by 20px and squeezed the icons to 11px, and de/fr/es/ca/nl/ja were worse.
whitespace-nowrapalone can't fix it. With five icons and "+2", the fixed items take 113.8px of the 242px row, and the full question needs 133–199px. So even with the timestamp at 0, the row would overflow the card by 4.9px in en and up to 70px in ja.The confirm now shows a short label from a new key,
savedBlocks.deleteConfirmShort: "Delete?" · "Löschen?" · "¿Eliminar?" · "Supprimer ?" · "Excluir?" · "Eliminar?" · "Verwijderen?" · "削除しますか?". It keeps the full question as itsaria-label. That means:Everything in the row except the timestamp is
shrink-0, so only the timestamp truncates. Its tooltip still shows the full date.Keyboard focus fell to the page. Arming a delete, confirming it and closing an inline rename each unmounted the focused control, which dropped focus to
<body>. Escape on an armed confirm closed the whole browser. Now:Mouse users see no change. Programmatic focus after a click doesn't match
:focus-visible, so no ring appears (checked in light and shadow DOM).Linked issues
n/a
Type of change
Affected packages
@templatical/editor: the component and all 8 locale files.apps/playground: e2e only.Checklist
saved-blocks.spec.tspasses locally in both projects (58/58).savedBlocks.deleteConfirmShortin all 8)patch, one per fixScreenshots / recordings
All measurements are on a 7-type card at the browser's 300px list width:
The +5px is the nudge an uncrowded card already gets when armed. The rest state is byte-identical to main (2× screenshots, light and shadow DOM).
Notes for reviewers
remove/updateis pending, focus still moves when it completes. That case is rare and not guarded.