Skip to content

fix: hide "Mark as planned" for backlog tasks - #1675

Open
mohiuddin000 wants to merge 3 commits into
usekaneo:mainfrom
mohiuddin000:fix/1645-hide-mark-as-planned-v2
Open

fix: hide "Mark as planned" for backlog tasks#1675
mohiuddin000 wants to merge 3 commits into
usekaneo:mainfrom
mohiuddin000:fix/1645-hide-mark-as-planned-v2

Conversation

@mohiuddin000

@mohiuddin000 mohiuddin000 commented Aug 29, 2026

Copy link
Copy Markdown

Description

When I right-click a task that is already in the backlog, the "Mark as planned" option is still shown. Since the task is already planned, this option does nothing and is confusing.

I changed the context menu so that the "Mark as planned" option is hidden when the task status is planned.

Related Issue(s)

Fixes #1645

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test addition or update
  • Other (please describe):

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing
  • Other (please describe):

Screenshots (if applicable)

Not applicable.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I understand and take responsibility for every change, and I wrote this pull request description in my own words
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

I added a focused test for both cases: planned tasks do not show "Mark as planned", while tasks with another status still show the option.

Summary by CodeRabbit

  • Bug Fixes

    • The “Mark as planned” option is now hidden for tasks that are already planned, reducing redundant actions in the task menu.
  • Tests

    • Added coverage to verify the menu option appears only for tasks that are not yet planned.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Hide redundant “Mark as planned” action for backlog tasks

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Hides “Mark as planned” when a task already has planned status.
• Adds focused tests covering planned and non-planned context menu behavior.
Diagram

graph TD
  A["Task Card"] --> B["Context Menu"] --> C{"Status planned?"} -->|Yes| D["Hide action"]
  C -->|No| E["Show action"]
Loading
High-Level Assessment

Conditional rendering at the existing action boundary is the most direct approach. Disabling the action was considered but would preserve the confusing redundant option, while changing mutation behavior would not address its visibility.

Files changed (2) +166 / -5

Bug fix (1) +7 / -5
task-card-context-menu-content.tsxHide planning action for already planned tasks +7/-5

Hide planning action for already planned tasks

• Conditionally renders “Mark as planned” only when the current task status is not 'planned', removing a no-op action from backlog task menus.

apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx

Tests (1) +159 / -0
task-card-context-menu-content.test.tsxCover planning action visibility by task status +159/-0

Cover planning action visibility by task status

• Adds component tests proving planned tasks omit the “Mark as planned” action and non-planned tasks retain it. UI primitives, data hooks, mutations, permissions, project state, and translations are mocked to isolate rendering behavior.

apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.test.tsx

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Mock return types are redundant 📘 Rule violation ⚙ Maintainability
Description
The new context-menu mocks explicitly annotate React.JSX.Element even though each JSX return type
is directly inferable. This adds redundant TypeScript types contrary to the project's type-inference
convention.
Code

apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.test.tsx[16]

+  }): React.JSX.Element => <div>{children}</div>,
Evidence
Compliance rule 18 requires inferred TypeScript types where the type is clear. The added mock
functions return JSX expressions directly but repeatedly specify React.JSX.Element, as shown at
line 16 and throughout the same mock block.

AGENTS.md: Prefer Inferred TypeScript Types and Type Aliases
apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.test.tsx[11-42]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The newly added context-menu mocks explicitly declare `React.JSX.Element` return types that TypeScript can infer from their JSX expressions.

## Issue Context
PR Compliance ID 18 requires clear types to be inferred rather than redundantly annotated. Remove the explicit return annotations while preserving the mock behavior and necessary prop typing.

## Fix Focus Areas
- apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.test.tsx[11-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources

Grey Divider

Tip of the day
💡 Did you know, you can group findings by type and pick your Finding display, from Minimal to Full

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

children,
}: {
children: React.ReactNode;
}): React.JSX.Element => <div>{children}</div>,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Mock return types are redundant 📘 Rule violation ⚙ Maintainability

The new context-menu mocks explicitly annotate React.JSX.Element even though each JSX return type
is directly inferable. This adds redundant TypeScript types contrary to the project's type-inference
convention.
Agent Prompt
## Issue description
The newly added context-menu mocks explicitly declare `React.JSX.Element` return types that TypeScript can infer from their JSX expressions.

## Issue Context
PR Compliance ID 18 requires clear types to be inferred rather than redundantly annotated. Remove the explicit return annotations while preserving the mock behavior and necessary prop typing.

## Fix Focus Areas
- apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.test.tsx[11-42]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 80503b2f-4871-468b-83ad-bf02839cf148

📥 Commits

Reviewing files that changed from the base of the PR and between b760dce and 89ec202.

📒 Files selected for processing (2)
  • apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.test.tsx
  • apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The task context menu now hides “Mark as planned” when a task already has planned status. New tests verify the action is absent for planned tasks and present for other statuses.

Changes

Planned task menu behavior

Layer / File(s) Summary
Conditional planned action
apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.tsx
The menu renders “Mark as planned” only when the task status is not planned.
Context menu status coverage
apps/web/src/components/kanban-board/task-card-context-menu/task-card-context-menu-content.test.tsx
The tests mock menu dependencies and verify the action for planned and non-planned tasks.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 89ec2

This change hides the redundant “Mark as planned” action for tasks already in planned status while preserving it for other statuses. No actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: tinsever

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: hiding the "Mark as planned" option for backlog tasks.
Linked Issues check ✅ Passed The change satisfies issue #1645 by hiding "Mark as planned" when the task status is "planned". Tests cover both planned and non-planned tasks.
Out of Scope Changes check ✅ Passed The implementation and focused unit tests directly support issue #1645. No unrelated changes are identified.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Mark as planned" in Backlog

1 participant