Repository navigation
Put each form's actions in one menu, with Copy link and safe archive and delete - #245
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into feat/bits-254-row-actions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chive and delete Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 66bc8d8, no must. Two shoulds: one inline, one question.
Question: Restore puts an archived published form back online, because archiving keeps its publish date. Before, the dashboard could only archive unpublished forms. Should the restore message say it's live again, or should archiving unpublish?
The 12 new tests fail on the old row. HTML in a name shows as text. A second Archive click while saving does nothing, and a failed action keeps the row as it was.
| const copyLink = async () => { | ||
| await copy(window.route("forms.show", { uuid: props.form.uuid })); | ||
| emit("announce", { text: "Link copied" }); | ||
| }; |
There was a problem hiding this comment.
Should: without https there's no clipboard API, so legacy: true copies through a hidden textarea. Its select() moves focus there, and removing it drops focus to the page, so a keyboard user lands back at the top after Copy link. Maybe:
| const copyLink = async () => { | |
| await copy(window.route("forms.show", { uuid: props.form.uuid })); | |
| emit("announce", { text: "Link copied" }); | |
| }; | |
| const copyLink = async () => { | |
| // without https the fallback copy moves focus to a hidden field | |
| const focused = document.activeElement as HTMLElement | null; | |
| await copy(window.route("forms.show", { uuid: props.form.uuid })); | |
| const target = focused?.isConnected | |
| ? focused | |
| : row.value?.querySelector<HTMLElement>("[aria-haspopup=menu]"); | |
| target?.focus(); | |
| emit("announce", { text: "Link copied" }); | |
| }; |
There was a problem hiding this comment.
Fixed in 468f056, a bit different: focus goes back to the copy button only when it started in the row. From the menu or the toast it goes to the row's menu button, since both go away (the menu item stays 100 ms in the DOM while it fades, so refocusing it lost focus again).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nly links that work Copy link only on published rows, no submissions link on archived rows, 44 px menu items on phones, Unpublish without a question when nothing is lost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 468f056, CI green. The Copy link focus fix holds.
The menu items and the message sit outside the row, so focus goes back to the copy button only when it started there, else to the row's menu. The 9 new and changed tests fail on 66bc8d8 and pass here (Vitest 170/170, lint, vue-tsc). The restore message still waits for a decision.
…ack unpublished Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at a68f6bb, CI green.
Restore reads is_published from the server's answer, which always has it, so the row follows whatever Okko's change decides. The new archive text is only true once that change is on main, so this PR has to merge after it. The 2 new and changed tests fail on 468f056 and pass here.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each form row gets one actions menu, a Copy link button on published rows, and a question before unpublish (with submissions), archive and delete. Rows change in place, without a reload.
Fixes BITS-254
Heads-up: stacked on #244.
Tested: Vitest (the new tests fail on the old row), lint, vue-tsc, build. By hand at 1440 and 390 px: every action, keyboard focus, a real delete.
Not tested: a real screen reader, Firefox, Safari.
Screenshots: on BITS-254.
🤖 Generated with Claude Code