Skip to content

Put each form's actions in one menu, with Copy link and safe archive and delete - #245

Merged
PhilReinking merged 11 commits into
mainfrom
feat/bits-254-row-actions
Oct 12, 2026
Merged

PhilReinking merged 11 commits into
mainfrom
feat/bits-254-row-actions

Conversation

@PhilReinking

@PhilReinking PhilReinking commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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

  • The status badge is a plain label. Publish and Unpublish… are in the menu.
  • A restored row takes its published state from the server's answer (archive unpublishes, in the backend PR).
  • Archived rows offer only Restore and a red Delete permanently…. Deleting hides the row and focuses the next row's menu.
  • A toast at the bottom is also the live region: "Link copied", "{name} is live." with Copy link, and each action's result.
  • The D9 menu button hides its outline, so the row rings the icon on keyboard focus.
  • The DangerButton is shaped like the D9 Cancel next to it, as in the prototype.
  • ConfirmationModal gets the alertdialog role and names, on every page.

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

PhilReinking and others added 5 commits October 12, 2026 02:30
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +294 to +297
const copyLink = async () => {
await copy(window.route("forms.show", { uuid: props.form.uuid }));
emit("announce", { text: "Link copied" });
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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" });
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

PhilReinking and others added 3 commits October 12, 2026 09:25
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
PhilReinking changed the base branch from feat/bits-253-form-list-layout to main October 12, 2026 07:26
@PhilReinking PhilReinking reopened this Oct 12, 2026

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

PhilReinking and others added 2 commits October 12, 2026 09:34
…ack unpublished

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK at 5ddb63b, CI green.

Only the merge of main is new. Both conflicts keep both sides: the list takes #248's card, without its own white background, and keeps each row's announce. The #244, #245 and #247 lines all stay under Changed. Against main, every file changes exactly as it did at a68f6bb.

@PhilReinking
PhilReinking merged commit 7969156 into main Oct 12, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the feat/bits-254-row-actions branch October 12, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant