Skip to content

feat: Group tasks by relative date and reorder dependencies#1767

Open
jonathanlab wants to merge 2 commits intomainfrom
posthog-code/group-tasks-by-date-range
Open

feat: Group tasks by relative date and reorder dependencies#1767
jonathanlab wants to merge 2 commits intomainfrom
posthog-code/group-tasks-by-date-range

Conversation

@jonathanlab
Copy link
Copy Markdown
Contributor

@jonathanlab jonathanlab commented Apr 21, 2026

Tasks in the sidebar task list are now grouped by relative date categories (Yesterday, This week, etc)

Closes #1086

CleanShot 2026-04-21 at 16 51 31@2x

Created with PostHog Code

Generated-By: PostHog Code
Task-Id: 844c45f7-36dd-4201-b51f-2120c4ee7561
@jonathanlab jonathanlab requested a review from a team April 21, 2026 14:50
Generated-By: PostHog Code
Task-Id: 844c45f7-36dd-4201-b51f-2120c4ee7561
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 21, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/utils/time.ts
Line: 55-56

Comment:
**Redundant conditional — both branches are identical**

Both arms of the ternary produce `new Date(timestamp)`, so the conditional is superfluous. `new Date()` already handles both `string` and `number` inputs, so the whole expression can be collapsed to one line.

```suggestion
  const date = new Date(timestamp);
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/code/src/renderer/features/sidebar/components/TaskListView.tsx
Line: 381-382

Comment:
**Duplicate React keys when same date group appears non-consecutively**

`dateGroupedTasks` only merges *consecutive* tasks that share a label. If `flatTasks` ever has two tasks labelled `"Today"` separated by a `"Yesterday"` entry, two distinct group objects would both carry `label: "Today"`. Using the label alone as the `Fragment` key causes a duplicate-key warning and unpredictable reconciliation. Incorporating the array position into the key avoids this.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(sidebar): group tasks by relative d..." | Re-trigger Greptile

Comment on lines +55 to +56
const date =
typeof timestamp === "string" ? new Date(timestamp) : new Date(timestamp);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Redundant conditional — both branches are identical

Both arms of the ternary produce new Date(timestamp), so the conditional is superfluous. new Date() already handles both string and number inputs, so the whole expression can be collapsed to one line.

Suggested change
const date =
typeof timestamp === "string" ? new Date(timestamp) : new Date(timestamp);
const date = new Date(timestamp);
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/utils/time.ts
Line: 55-56

Comment:
**Redundant conditional — both branches are identical**

Both arms of the ternary produce `new Date(timestamp)`, so the conditional is superfluous. `new Date()` already handles both `string` and `number` inputs, so the whole expression can be collapsed to one line.

```suggestion
  const date = new Date(timestamp);
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that tru 😛

Comment on lines +381 to +382
{dateGroupedTasks.map((group) => (
<Fragment key={group.label}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Duplicate React keys when same date group appears non-consecutively

dateGroupedTasks only merges consecutive tasks that share a label. If flatTasks ever has two tasks labelled "Today" separated by a "Yesterday" entry, two distinct group objects would both carry label: "Today". Using the label alone as the Fragment key causes a duplicate-key warning and unpredictable reconciliation. Incorporating the array position into the key avoids this.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sidebar/components/TaskListView.tsx
Line: 381-382

Comment:
**Duplicate React keys when same date group appears non-consecutively**

`dateGroupedTasks` only merges *consecutive* tasks that share a label. If `flatTasks` ever has two tasks labelled `"Today"` separated by a `"Yesterday"` entry, two distinct group objects would both carry `label: "Today"`. Using the label alone as the `Fragment` key causes a duplicate-key warning and unpredictable reconciliation. Incorporating the array position into the key avoids this.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +55 to +56
const date =
typeof timestamp === "string" ? new Date(timestamp) : new Date(timestamp);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

that tru 😛

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.

Group by timeframes in the chronological sort view

2 participants