Skip to content

Conversation

@Karthik7406
Copy link

@Karthik7406 Karthik7406 commented Dec 25, 2025

Description

Implemented work item status to display in the search result

Fixes #7722
Fixes #8144

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • [x ] 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

Screenshots and Media (if applicable)

Workspace search
image

Command+k
image

Test Scenarios

References


Note

Adds issue state to search results and surfaces it in the Power-K UI.

  • API: GlobalSearchEndpoint.filter_issues now returns state in issue search payloads
  • UI: Power-K search results for issue render a read-only StateDropdown next to IssueIdentifier

Written by Cursor Bugbot for commit 4cfbb1f. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features
    • Search results now display the state/status of each issue, allowing users to quickly view the current status of work items directly within search results. The state is shown in a read-only format alongside issue information for improved visibility.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 25, 2025

📝 Walkthrough

Walkthrough

This change adds work item state information to global search results. The backend now includes the "state" field in the API response for searched issues, and the frontend displays this state using a read-only StateDropdown component in the search results modal.

Changes

Cohort / File(s) Summary
Backend API Enhancement
apps/api/plane/app/views/search/base.py
Added "state" field to the values dictionary returned by filter_issues() method, expanding the issue payload to include state data in search results.
Frontend UI Display
apps/web/core/components/power-k/ui/modal/search-results-map.tsx
Imported StateDropdown component and integrated it into the issue group item rendering to display work item state as a read-only, background-styled badge in search results.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A search through the warren, revealing the way,
Now showing what state each work item's in—at play!
No more guessing open from done with a glance,
The status shines bright, giving work items their chance. ✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Work Items state in the search result' clearly and concisely describes the main change—adding work item status display to search results.
Description check ✅ Passed The description covers the main change, includes references to linked issues (#7722, #8144), specifies the type of change (feature), and provides screenshots demonstrating the implementation.
Linked Issues check ✅ Passed The PR successfully implements the primary requirement from both linked issues: displaying work item status in search results alongside each item in both workspace search and Command+K UI.
Out of Scope Changes check ✅ Passed All changes focus narrowly on adding state display to search results; no unrelated modifications or scope creep detected in the API and UI layer updates.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

/>
<StateDropdown
value={workItem?.state}
projectId={workItem.projectId?.toString() ?? ""}
Copy link

Choose a reason for hiding this comment

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

Wrong property name causes StateDropdown to receive empty projectId

The code uses workItem.projectId but the IWorkspaceIssueSearchResult interface defines the property as project_id (snake_case). This is inconsistent with line 42 which correctly uses workItem.project_id. Since workItem.projectId is undefined, the fallback ?? "" passes an empty string to StateDropdown, preventing the component from fetching and displaying states correctly. The property name should be project_id to match the interface and backend response.

Fix in Cursor Fix in Web

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: 1

🧹 Nitpick comments (1)
apps/api/plane/app/views/search/base.py (1)

109-109: Prefer explicit "state_id" for consistency with SearchEndpoint.

For consistency with line 411 in SearchEndpoint and clarity, use "state_id" instead of "state". While both return the state ID in Django's .values(), explicit "state_id" makes the intent clearer and maintains consistency across the codebase.

🔎 Proposed fix
-            "state"
+            "state_id"
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f04be48 and 4cfbb1f.

📒 Files selected for processing (2)
  • apps/api/plane/app/views/search/base.py
  • apps/web/core/components/power-k/ui/modal/search-results-map.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/core/components/power-k/ui/modal/search-results-map.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Enable TypeScript strict mode and ensure all files are fully typed

Files:

  • apps/web/core/components/power-k/ui/modal/search-results-map.tsx
**/*.{js,jsx,ts,tsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Use Prettier with Tailwind plugin for code formatting, run pnpm fix:format

Files:

  • apps/web/core/components/power-k/ui/modal/search-results-map.tsx
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{js,jsx,ts,tsx}: Use ESLint with shared config across packages, adhering to max warnings limits per package
Use camelCase for variable and function names, PascalCase for components and types
Use try-catch with proper error types and log errors appropriately

Files:

  • apps/web/core/components/power-k/ui/modal/search-results-map.tsx
🧠 Learnings (2)
📚 Learning: 2025-10-29T09:17:54.815Z
Learnt from: NarayanBavisetti
Repo: makeplane/plane PR: 7905
File: apps/api/plane/app/views/search/base.py:241-276
Timestamp: 2025-10-29T09:17:54.815Z
Learning: In apps/api/plane/app/views/search/base.py, the `filter_intakes` method uses `Issue.objects` (base manager) instead of `Issue.issue_objects` (custom manager) because the custom manager filters out all intake statuses, which would prevent querying pending and snoozed intake issues.

Applied to files:

  • apps/api/plane/app/views/search/base.py
📚 Learning: 2025-12-23T14:18:32.899Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/models/api.py:35-35
Timestamp: 2025-12-23T14:18:32.899Z
Learning: Django REST Framework rate limit strings are flexible: only the first character of the time unit matters. Acceptable formats include: "60/s", "60/sec", "60/second" (all equivalent), "60/m", "60/min", "60/minute" (all equivalent), "60/h", "60/hr", "60/hour" (all equivalent), and "60/d", "60/day" (all equivalent). Abbreviations like "min" are valid and do not need to be changed to "minute". Apply this guidance to any Python files in the project that configure DRF throttling rules.

Applied to files:

  • apps/api/plane/app/views/search/base.py
🧬 Code graph analysis (1)
apps/web/core/components/power-k/ui/modal/search-results-map.tsx (1)
apps/web/core/components/dropdowns/state/dropdown.tsx (1)
  • StateDropdown (17-46)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot

Comment on lines +48 to +54
<StateDropdown
value={workItem?.state}
projectId={workItem.projectId?.toString() ?? ""}
disabled={true}
buttonVariant="background-with-text"
size="xs"
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for IWorkspaceIssueSearchResult or similar type definitions
echo "=== Searching for type definitions ==="
rg -n "IWorkspaceIssueSearchResult|IssueSearchResult" --type=ts --type=tsx -g '!node_modules' -B 2 -A 10 | head -100

# Also search for workItem type in the search-results-map file
echo -e "\n=== Searching for workItem type in the target file ==="
rg -n "workItem" apps/web/core/components/power-k/ui/modal/search-results-map.tsx -B 3 -A 3 | head -50

Repository: makeplane/plane

Length of output: 1280


🏁 Script executed:

#!/bin/bash
# Check for case transformation utilities in the codebase
echo "=== Checking for case transformation utilities ==="
rg -n "camelCase|snakeCase|toCamel|toSnake|camelCase|snake2camel" --type=ts --type=tsx -g '!node_modules' | head -50

# Look for axios or API response transformation
echo -e "\n=== Checking for API response transformations ==="
rg -n "transformResponse|AxiosInstance|request\(" --type=ts --type=tsx -g '!node_modules' -A 3 | head -100

Repository: makeplane/plane

Length of output: 233


🏁 Script executed:

#!/bin/bash
# Check the imports and see where workItem comes from
echo "=== Checking imports in search-results-map.tsx ==="
head -30 apps/web/core/components/power-k/ui/modal/search-results-map.tsx

# Search for project_id or projectId in the search modal files
echo -e "\n=== Searching for project_id or projectId usage in power-k directory ==="
rg -n "project_id|projectId" apps/web/core/components/power-k/ --type=ts --type=tsx -B 2 -A 2 | head -150

Repository: makeplane/plane

Length of output: 1483


Critical: Incorrect property name breaks state display.

Line 50 uses workItem.projectId, but all properties on this object use snake_case (including project_id used correctly on line 42 above it and line 61 below it). Since workItem.projectId does not exist, it will be undefined, resulting in an empty string passed to StateDropdown.

This prevents the StateDropdown from displaying the work item state correctly, breaking the core feature this PR aims to deliver.

Fix: Change line 50 from projectId={workItem.projectId?.toString() ?? ""} to projectId={workItem.project_id?.toString() ?? ""}.

🤖 Prompt for AI Agents
In apps/web/core/components/power-k/ui/modal/search-results-map.tsx around lines
48 to 54, the StateDropdown is passed projectId={workItem.projectId?.toString()
?? ""} but the workItem uses snake_case keys (project_id), so projectId resolves
to undefined and breaks state display; update the prop to use
workItem.project_id?.toString() ?? "" so the correct project id is passed to
StateDropdown and the state renders properly.

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.

[feature]: Search Filters / Status [feature]: show work item status in search results

1 participant