Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions apps/staged/src/lib/features/projects/ProjectHome.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,18 @@
})
);

// Navigate away immediately so the user doesn't have to wait for backend deletion.
// Skip projects that are already being deleted.
const currentIndex = projects.findIndex((p) => p.id === id);
const alive = projects.filter((p) => p.id !== id && !deletingProjectNames.has(p.id));
if (alive.length > 0) {
// Prefer the next project after the current one; fall back to the closest earlier one
const next = alive.find((p) => projects.indexOf(p) > currentIndex) ?? alive[alive.length - 1];
selectProject(next.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid forcing detail navigation when deleting on home view

confirmDeleteProject now unconditionally calls selectProject(next.id) whenever another project exists, which also runs when the user is on the all-projects home screen (selectedProjectId is null). In that context, deleting one project should keep the list view, but this change unexpectedly jumps into a single project and persists it as the last-viewed project, regressing the bulk-management flow. This redirect should be gated to cases where the deleted project is the actively selected detail view.

Useful? React with 👍 / 👎.

} else {
goHome();
}

try {
await commands.deleteProject(id);
projects = projects.filter((p) => p.id !== id);
Expand Down