[WEB-4547]fix: archived work item redirection#7471
Conversation
WalkthroughThe changes update the post-archive behavior for issues in both the issue detail quick actions and the peek overview header components. Instead of always redirecting to an archive or issues page after archiving, the code now either navigates to the active issues list or conditionally removes the peeked issue from the route, with consistent event tracking and error handling. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI_Component
participant ArchiveService
participant Router
participant PeekState
User->>UI_Component: Click "Archive Issue"
UI_Component->>ArchiveService: archiveIssue(issueId)
ArchiveService-->>UI_Component: Success/Failure
alt In Issue Detail Quick Actions
UI_Component->>Router: Navigate to /issues
else In Peek Overview Header
UI_Component->>PeekState: getIsIssuePeeked(issueId)
alt Issue is peeked
UI_Component->>PeekState: removeRoutePeekId()
end
end
UI_Component->>UI_Component: captureSuccess()
Estimated code review effort🎯 2 (Simple) | ⏱️ ~6 minutes Suggested labels
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Pull Request Linked with Plane Work Items Comment Automatically Generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/web/core/components/issues/peek-overview/header.tsx (1)
28-28: Remove unused import.The
useAppRouterimport is no longer used in this component after removing the navigation logic fromhandleArchiveIssue.-import { useAppRouter } from "@/hooks/use-app-router";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx(1 hunks)apps/web/core/components/issues/peek-overview/header.tsx(2 hunks)
🧰 Additional context used
🧠 Learnings (2)
apps/web/core/components/issues/peek-overview/header.tsx (1)
Learnt from: vamsikrishnamathala
PR: #7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx (1)
Learnt from: vamsikrishnamathala
PR: #7214
File: web/core/store/issue/helpers/base-issues.store.ts:117-117
Timestamp: 2025-06-16T07:23:39.497Z
Learning: In the updateIssueDates method of BaseIssuesStore (web/core/store/issue/helpers/base-issues.store.ts), the projectId parameter is intentionally made optional to support override implementations in subclasses. The base implementation requires projectId and includes an early return check, but making it optional allows derived classes to override the method with different parameter requirements.
🔇 Additional comments (3)
apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx (1)
109-110: LGTM! Cleaner async handling and improved post-archive navigation.The changes improve the code by:
- Replacing promise chaining with cleaner async/await pattern
- Redirecting to the active issues list instead of the archived issues page, which provides better UX flow after archiving an item
apps/web/core/components/issues/peek-overview/header.tsx (2)
97-97: Good addition of peek state checking functionality.Adding
getIsIssuePeekedto the destructured values enables the conditional peek cleanup logic in the archive handler.
157-161: Excellent approach for peek overview context.The updated post-archive behavior is well-suited for the peek overview component:
- Avoids unwanted navigation that would disrupt the user's current view
- Properly cleans up the peeked issue state when needed
- Maintains consistent event tracking
Description
This update fixes the work item redirection after archiving.
Type of Change
Summary by CodeRabbit