-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: Work Items state in the search result #8454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: preview
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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() ?? ""} |
There was a problem hiding this comment.
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.
There was a problem hiding this 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
SearchEndpointand 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
📒 Files selected for processing (2)
apps/api/plane/app/views/search/base.pyapps/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}: Useconsttype parameters for more precise literal inference in TypeScript 5.0+
Use thesatisfiesoperator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicitisreturn types in filter/check functions
UseNoInfer<T>utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing inswitch(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 legacyexperimentalDecorators
Useusingdeclarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Usewith { type: "json" }for import attributes; avoid deprecatedassertsyntax (TypeScript 5.3/5.8+)
Useimport typeexplicitly when importing types to ensure they are erased during compilation, respectingverbatimModuleSyntaxflag
Use.ts,.mts,.ctsextensions inimport typestatements (TypeScript 5.2+)
Useimport 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 newSetmethods likeunion,intersection, etc., when available (TypeScript 5.5+)
UseObject.groupBy/Map.groupBystandard methods for grouping instead of external libraries (TypeScript 5.4+)
UsePromise.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 viasuperin 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
| <StateDropdown | ||
| value={workItem?.state} | ||
| projectId={workItem.projectId?.toString() ?? ""} | ||
| disabled={true} | ||
| buttonVariant="background-with-text" | ||
| size="xs" | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 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 -50Repository: 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 -100Repository: 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 -150Repository: 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.
Description
Implemented work item status to display in the search result
Fixes #7722
Fixes #8144
Type of Change
Screenshots and Media (if applicable)
Workspace search

Command+k

Test Scenarios
References
Note
Adds issue state to search results and surfaces it in the Power-K UI.
GlobalSearchEndpoint.filter_issuesnow returnsstatein issue search payloadsissuerender a read-onlyStateDropdownnext toIssueIdentifierWritten by Cursor Bugbot for commit 4cfbb1f. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.