Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/constants/src/issue/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ export const ISSUE_DISPLAY_FILTERS_BY_PAGE: TIssueFiltersToDisplayByPageType = {
gantt_chart: {
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.

type: ["active", "backlog"],
},
extra_options: {
Expand Down