Skip to content

[WEB-4547]fix: archived work item redirection#7471

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
fix-archive_work_item_redirection
Jul 24, 2025
Merged

[WEB-4547]fix: archived work item redirection#7471
sriramveeraghanta merged 1 commit intopreviewfrom
fix-archive_work_item_redirection

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Jul 24, 2025

Description

This update fixes the work item redirection after archiving.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Summary by CodeRabbit

  • Refactor
    • Updated the issue archiving process to improve navigation and state handling after an issue is archived.
    • Navigation after archiving now directs to the active issues list or conditionally clears peeked issue state, providing a smoother user experience.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 24, 2025

Walkthrough

The 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

File(s) Change Summary
apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx Simplified async flow: after archiving, navigates to issues list instead of archived issues page.
apps/web/core/components/issues/peek-overview/header.tsx Removed navigation after archiving; conditionally removes peeked issue from route if necessary.

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()
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~6 minutes

Suggested labels

ready_to_merge

Suggested reviewers

  • prateekshourya29

Poem

A bunny hops through code so neat,
Archiving issues—no retreat!
Peeked or listed, routes now clear,
With every change, the end is near.
Success is tracked, the flow refined—
Another merge, with peace of mind!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-archive_work_item_redirection

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@makeplane
Copy link

makeplane bot commented Jul 24, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/web/core/components/issues/peek-overview/header.tsx (1)

28-28: Remove unused import.

The useAppRouter import is no longer used in this component after removing the navigation logic from handleArchiveIssue.

-import { useAppRouter } from "@/hooks/use-app-router";
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56e4d2c and 1337e25.

📒 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 getIsIssuePeeked to 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

@sriramveeraghanta sriramveeraghanta merged commit 008727d into preview Jul 24, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix-archive_work_item_redirection branch July 24, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working 🌐frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants