feat(web): «Deshacer» after moving, reassigning or trashing a ticket

A toast offers to undo for seven seconds (or Ctrl/⌘ Z outside a field)
by running the opposite command: the card back to its column or the
ticket to its status (the workflow may refuse it), the previous
assignee, or the ticket back from the trash. The undo itself only says
«Deshecho». On the board, from the card's assignee; on the ticket page,
status, assignee and trash, which no longer asks for confirmation.

The toast is the app's own (UndoToastComponent): pi-snack-bar cannot
tell its button from the timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 11:43:54 +02:00
parent 70e4fbd399
commit 42a21412d9
13 changed files with 326 additions and 69 deletions

View File

@@ -26,10 +26,19 @@ export const boardPageEvents = eventGroup({
issueId: string;
to: string;
reason?: string | null;
/** Where it was: «Deshacer» takes it back. */
from?: string;
/** It is the «Deshacer» of a move: no undo for it. */
undoing?: boolean;
}>(),
issueCreateRequested: type<CreateIssueInput>(),
/** From the card: priority, estimate or assignee (the live update repaints it). */
issueEditRequested: type<{ issueId: string; change: CardChange }>(),
issueEditRequested: type<{
issueId: string;
change: CardChange;
/** It is the «Deshacer» of a change: no undo for it. */
undoing?: boolean;
}>(),
/** Save the current filter under a name. */
viewSaveRequested: type<{ name: string; shared: boolean }>(),
viewDeleteRequested: type<{ id: string }>(),

View File

@@ -15,8 +15,13 @@ export const issuePageEvents = eventGroup({
source: 'Issue Page',
events: {
opened: type<{ idOrKey: string }>(),
statusChangeRequested: type<ChangeStatusInput>(),
assignRequested: type<{ issueId: string; assigneeId: string | null }>(),
/** `undoing`: it is the «Deshacer» of a change, which offers none. */
statusChangeRequested: type<ChangeStatusInput & { undoing?: boolean }>(),
assignRequested: type<{
issueId: string;
assigneeId: string | null;
undoing?: boolean;
}>(),
updateRequested: type<UpdateIssueInput>(),
linkRequested: type<LinkIssuesInput>(),
/** Relate by the other ticket's key (e.g. BE-3), resolved to its id first. */
@@ -44,7 +49,11 @@ export const issuePageEvents = eventGroup({
}>(),
watchRequested: type<{ issueId: string; watching: boolean }>(),
pinRequested: type<{ issueId: string; pinned: boolean }>(),
trashRequested: type<{ issueId: string; trashed: boolean }>(),
trashRequested: type<{
issueId: string;
trashed: boolean;
undoing?: boolean;
}>(),
/** Place the ticket under another one by its key (e.g. WEB-3); null: out. */
parentRequested: type<{ issueId: string; parentKey: string | null }>(),
subtaskCreateRequested: type<{
@@ -90,6 +99,8 @@ export const issueApiEvents = eventGroup({
commandSucceeded: type<string>(),
/** A checklist step was saved (no toast for something so small). */
checklistSaved: type<void>(),
/** Changed, and «Deshacer» offered instead of a plain toast. */
undoOffered: type<void>(),
commandFailed: type<string>(),
},
});