Skip to content

Conversation

@biplavbarua
Copy link

@biplavbarua biplavbarua commented Dec 30, 2025

Summary

This PR enables sorting the Timeline View by Due Date (target_date).

Changes

  • Added 'target_date' to the order_by options in the Gantt chart layout configuration in 'packages/constants/src/issue/filter.ts'.

Why

Fixes #8267. This feature was requested to allow users to visualize work items based on their due dates in the timeline view, which helps in better deadline management.


Note

Enables due-date sorting in the Timeline/Gantt view.

  • Adds "target_date" to order_by for issues.gantt_chart.display_filters in packages/constants/src/issue/filter.ts, allowing sorting by due date in the Gantt timeline

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

Summary by CodeRabbit

  • New Features
    • Users can now sort issues by target date when viewing the Gantt chart on their profile issues page, providing better visibility into project timelines.

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

Added 'target_date' to the order_by options in the Gantt chart layout configuration. This enables users to sort items by Due Date in the Timeline View.
@CLAassistant
Copy link

CLAassistant commented Dec 30, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 30, 2025

📝 Walkthrough

Walkthrough

A single constant file is modified to append "target_date" to the sort options for the timeline (gantt_chart) layout in the profile issues page, enabling sorting by due date.

Changes

Cohort / File(s) Summary
Filter Constants
packages/constants/src/issue/filter.ts
Added "target_date" to the order_by array in display_filters for the gantt_chart layout under profile_issues, extending available sort options.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A timeline so neat, now sorted by due dates sweet,
No more guessing what's next on the beat,
Hop through your releases with clarity bright,
Target dates guide your workflow just right! 📅✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: sort timeline view by due date' directly reflects the main change: adding target_date sorting to the timeline/Gantt view configuration.
Description check ✅ Passed The PR description covers the objective, changes made, rationale, and references the related issue #8267, though it deviates from the template structure with extra Cursor-generated content.
Linked Issues check ✅ Passed The PR successfully implements the core requirement from issue #8267 by adding 'target_date' to order_by options, enabling users to sort timeline view items by due date instead of creation date.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to adding 'target_date' to the Gantt chart display filters configuration, directly addressing the requirement in issue #8267 with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

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

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8663382 and 1ea7244.

📒 Files selected for processing (1)
  • packages/constants/src/issue/filter.ts
🧰 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:

  • packages/constants/src/issue/filter.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Enable TypeScript strict mode and ensure all files are fully typed

Files:

  • packages/constants/src/issue/filter.ts
**/*.{js,jsx,ts,tsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

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

Files:

  • packages/constants/src/issue/filter.ts
**/*.{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:

  • packages/constants/src/issue/filter.ts
🧠 Learnings (1)
📚 Learning: 2025-01-24T09:37:19.339Z
Learnt from: mathalav55
Repo: makeplane/plane PR: 6452
File: web/helpers/issue.helper.ts:6-6
Timestamp: 2025-01-24T09:37:19.339Z
Learning: In the Plane codebase, `ISSUE_DISPLAY_FILTERS_BY_LAYOUT` and `ISSUE_DISPLAY_FILTERS_BY_PAGE` are two distinct constants serving different purposes - one for layout-level filters and another for page-level filters. They are not interchangeable and should coexist.

Applied to files:

  • packages/constants/src/issue/filter.ts
⏰ 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
🔇 Additional comments (1)
packages/constants/src/issue/filter.ts (1)

264-264: AI summary incorrectly identifies the page.

The AI-generated summary states the change is in the profile_issues page, but the actual modification is in the issues page configuration at line 264 (within ISSUE_DISPLAY_FILTERS_BY_PAGE.issues.layoutOptions.gantt_chart). The profile_issues section (lines 107-135) does not contain a gantt_chart layout.

display_properties: ["key", "issue_type"],
display_filters: {
order_by: ["sort_order", "-created_at", "-updated_at", "start_date", "-priority"],
order_by: ["sort_order", "-created_at", "-updated_at", "start_date", "-priority", "target_date"],
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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, let's look at the file structure and the specific lines mentioned
wc -l packages/constants/src/issue/filter.ts

Repository: makeplane/plane

Length of output: 101


🏁 Script executed:

# Read the relevant section of the file to verify the claims
sed -n '200,280p' packages/constants/src/issue/filter.ts

Repository: makeplane/plane

Length of output: 2686


🏁 Script executed:

# Also check the beginning of the file for the EServerGroupByToFilterOptions reference
sed -n '1,50p' packages/constants/src/issue/filter.ts

Repository: makeplane/plane

Length of output: 1510


🏁 Script executed:

# Search for components that use gantt_chart display_filters or handle sorting
rg -n --type=ts --type=tsx 'gantt|timeline.*sort|order_by.*display' -A 3 -B 3 | head -100

Repository: makeplane/plane

Length of output: 86


🏁 Script executed:

# Search for files that might reference the sort options
find packages -name '*.ts' -o -name '*.tsx' | head -20

Repository: makeplane/plane

Length of output: 830


🏁 Script executed:

# Look for UI components that handle display filters and order_by
rg -n --type=ts --type=tsx 'display_filters|order_by' packages -l | head -20

Repository: makeplane/plane

Length of output: 86


🏁 Script executed:

# Search for gantt_chart and order_by references
rg -n 'gantt_chart|order_by' packages --type ts | grep -E 'gantt_chart|order_by' | head -30

Repository: makeplane/plane

Length of output: 2246


🏁 Script executed:

# Search for components that render sorting UI
rg -n 'SortButton|SortDropdown|OrderBy|display_filters' packages --type ts | head -30

Repository: makeplane/plane

Length of output: 2893


🏁 Script executed:

# Check for react files specifically
fd -e tsx -e jsx packages | head -20

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Search for where order_by is displayed in UI
rg -n 'order_by' packages/i18n/src/locales/en/translations.ts -A 2 -B 2 | head -60

Repository: makeplane/plane

Length of output: 482


🏁 Script executed:

# Find react/UI components that might handle sorting
fd -type f \( -name '*.tsx' -o -name '*.jsx' \) packages | head -30

Repository: makeplane/plane

Length of output: 229


🏁 Script executed:

# Search for components that render sort options in the codebase
rg -l 'sort_order|created_at|priority' packages --type ts | grep -i 'sort\|filter\|display' | head -20

Repository: makeplane/plane

Length of output: 459


🏁 Script executed:

# Look for the actual translation keys for sort options
rg -n 'target_date|start_date|sort_order' packages/i18n/src/locales/en/translations.ts

Repository: makeplane/plane

Length of output: 201


🏁 Script executed:

# Find components that use the display_filters from the constants
rg -l 'ISSUE_DISPLAY_FILTERS_BY' packages --type ts

Repository: makeplane/plane

Length of output: 134


🏁 Script executed:

# Search for where sort options are rendered to users
rg -n 'order_by.*label|sort.*button|SortButton' packages -A 2 -B 2 | head -80

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Look for components that specifically handle gantt_chart or timeline
rg -n 'gantt_chart' packages --type ts -A 5 -B 5 | head -100

Repository: makeplane/plane

Length of output: 3054


🏁 Script executed:

# Search for where display_filters are used to render UI
rg -n 'display_filters.*order_by|order_by.*display_filters' packages --type ts -A 3 -B 3

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Find the work-item/base.ts file to see how order_by is used
cat packages/utils/src/work-item/base.ts | head -100

Repository: makeplane/plane

Length of output: 2675


🏁 Script executed:

# Check if there are translation keys for target_date in order_by
rg -n 'target_date' packages/i18n/src/locales/en/translations.ts

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Check if the constants are actually imported and used in web/app packages
find packages -type d -name 'web' -o -name 'app' | head -5

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Look for any component that consumes ISSUE_DISPLAY_FILTERS_BY_PAGE
rg -n 'ISSUE_DISPLAY_FILTERS_BY_PAGE\|ISSUE_DISPLAY_FILTERS_BY_LAYOUT' packages --type ts -B 2 -A 5 | head -80

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Search more broadly for where sort options are rendered
rg -n '"sort_order"|"target_date"|"-created_at"' packages --type ts | grep -v node_modules | head -30

Repository: makeplane/plane

Length of output: 2409


🏁 Script executed:

# Check for where the order_by constant is actually used
rg -n 'display_filters\[.*order_by' packages --type ts -A 2 -B 2

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Look for any web or app directories at repository root
ls -la | grep -E 'web|app|src'

Repository: makeplane/plane

Length of output: 115


🏁 Script executed:

# Check the apps directory
ls -la apps/

Repository: makeplane/plane

Length of output: 494


🏁 Script executed:

# Look for where sort options are rendered in the app
find apps -type f -name '*.ts' -o -name '*.js' | head -20

Repository: makeplane/plane

Length of output: 866


🏁 Script executed:

# Check the issue/common.ts file which seems to have sort option configurations
cat packages/constants/src/issue/common.ts | head -150

Repository: makeplane/plane

Length of output: 4069


🏁 Script executed:

# Check if the translation key exists for target_date/due_date
rg -n 'common.order_by.due_date|common.order_by.target_date' packages/i18n/src/locales/en/translations.ts

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Check if gantt/timeline specific sort options are defined elsewhere
rg -n 'gantt|timeline' packages/constants/src/issue/ --type ts

Repository: makeplane/plane

Length of output: 469


🏁 Script executed:

# Look at the full ISSUE_ORDER_BY_OPTIONS to ensure target_date is included
sed -n '120,145p' packages/constants/src/issue/common.ts

Repository: makeplane/plane

Length of output: 941


🏁 Script executed:

# Check the translation for the due_date/target_date sort option
rg -n 'due_date|order_by' packages/i18n/src/locales/en/translations.ts -A 1 -B 1 | grep -A 5 -B 5 'due_date'

Repository: makeplane/plane

Length of output: 710


🏁 Script executed:

# Verify the exact lines in filter.ts for spreadsheet and gantt_chart
sed -n '245,270p' packages/constants/src/issue/filter.ts

Repository: makeplane/plane

Length of output: 862


🏁 Script executed:

# Check if there's any pattern or reason why spreadsheet doesn't have target_date
rg -n 'spreadsheet' packages/constants/src/issue/filter.ts -A 10 -B 2

Repository: makeplane/plane

Length of output: 1168


🏁 Script executed:

# Check if there's any documentation or comments explaining why spreadsheet differs
rg -n 'spreadsheet.*order_by|target_date.*spreadsheet' packages --type ts -B 5 -A 2 | head -50

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Look at the PR or commit message context to see if spreadsheet exclusion is intentional
git log --oneline -20 packages/constants/src/issue/filter.ts

Repository: makeplane/plane

Length of output: 126


🏁 Script executed:

# Verify ISSUE_ORDER_BY_OPTIONS is actually imported and used in UI components
rg -n 'ISSUE_ORDER_BY_OPTIONS' apps packages --type ts | head -20

Repository: makeplane/plane

Length of output: 1341


🏁 Script executed:

# Check the order-by.tsx component to see how it filters options
cat apps/web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx

Repository: makeplane/plane

Length of output: 1581


🏁 Script executed:

# Check if the display_filters.order_by is passed to the component
rg -n 'orderByOptions|display_filters' apps/web/core/components/issues/issue-layouts/filters/header/display-filters/order-by.tsx -B 5 -A 5

Repository: makeplane/plane

Length of output: 1161


🏁 Script executed:

# Verify how the display_filters configuration is used in the component hierarchy
rg -n 'ISSUE_DISPLAY_FILTERS_BY_PAGE\|layoutOptions' apps/web/core --type ts | head -15

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Let's search for where orderByOptions is populated/passed to FilterOrderBy
rg -n 'FilterOrderBy|orderByOptions' apps/web/core --type ts -B 3 -A 3 | head -60

Repository: makeplane/plane

Length of output: 7306


🏁 Script executed:

# Check how display_filters.order_by from constants is used
rg -n 'display_filters.*order_by|layoutOptions' apps/web/core --type ts -B 2 -A 2 | head -40

Repository: makeplane/plane

Length of output: 4129


🏁 Script executed:

# Verify the translation key exists in English translations
rg -n 'order_by.*due_date\|due_date.*order_by' packages/i18n/src/locales/en/translations.ts -B 2 -A 2

Repository: makeplane/plane

Length of output: 41


🏁 Script executed:

# Check the exact structure of the translation object
sed -n '569,580p' packages/i18n/src/locales/en/translations.ts

Repository: makeplane/plane

Length of output: 356


🏁 Script executed:

# Confirm that the spreadsheet exclusion might be intentional by checking if there's a pattern
rg -n 'spreadsheet.*order_by\|order_by.*spreadsheet' packages/constants/src/issue/filter.ts -B 2 -A 2

Repository: makeplane/plane

Length of output: 41


Addition of target_date enables due date sorting for timeline view.

The change correctly adds "target_date" to the order_by options for the gantt_chart layout, enabling timeline sorting by due date. This is consistent with other layouts in the issues page (list and kanban already include "target_date").

The UI integration is already functional—the FilterOrderBy component dynamically renders sort options based on the display_filters.order_by configuration passed from ISSUE_DISPLAY_FILTERS_BY_PAGE, so the new sort option will be available to users immediately.

However, note that the spreadsheet layout (line 253) does not include "target_date" in its order_by array while list, kanban, and gantt_chart do. Please verify whether this is intentional or if it should be added for consistency across all layouts that support date-based sorting.

🤖 Prompt for AI Agents
packages/constants/src/issue/filter.ts around line 253 and 264: the gantt_chart
layout at line 264 adds "target_date" to its order_by array but the spreadsheet
layout at line 253 does not include "target_date", creating an inconsistency for
date-based sorting; verify whether spreadsheet should support due-date sorting
and if so add "target_date" to the spreadsheet order_by array to match
list/kanban/gantt_chart, otherwise leave as-is and add a comment explaining the
intentional omission.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants