feat(projects): navigate to adjacent project immediately on deletion - #551
Conversation
Instead of waiting for the backend deletion to complete before navigating away, immediately select the next project in the list (or previous if deleting the last one, or home if no projects remain). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…etion When choosing which project to navigate to after deletion, filter out projects that are already mid-deletion (tracked in deletingProjectNames) so the user lands on a live project. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 668e7d8ec3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| 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); |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
Test plan
🤖 Generated with Claude Code