-
-
Notifications
You must be signed in to change notification settings - Fork 21
Add task fetcher for calendar sidebar #3233
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
Conversation
WalkthroughThis update modifies the task priority system across the database, shared types, and frontend. It changes the enum values for task priority (replacing "medium" and "urgent" with "normal" and "critical"), updates related database migration scripts, adjusts TypeScript types, and refactors the task sidebar UI to reflect these new priorities and improve interactivity. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TasksSidebarContent
participant PriorityView
participant Database
User->>TasksSidebarContent: Opens sidebar
TasksSidebarContent->>PriorityView: Displays tasks grouped by priority
PriorityView->>Database: (On priority change) Update task priority (TODO)
PriorityView-->>TasksSidebarContent: Renders updated task list
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3233 +/- ##
==========================================
- Coverage 1.41% 1.41% -0.01%
==========================================
Files 1853 1853
Lines 241254 241422 +168
Branches 2464 2464
==========================================
Hits 3419 3419
- Misses 236324 236492 +168
Partials 1511 1511 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary of Changes
Hello @phatgg221, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request primarily addresses the core issue of data fetching for the calendar sidebar by migrating its primary component to a server-side rendering approach, which should enhance performance. In parallel, it delivers a substantial visual overhaul of the sidebar, introducing modern UI elements, animations, and a more intuitive task prioritization display. The PR also includes important development environment improvements and minor database schema adjustments, all contributing to a more robust and user-friendly application.
Highlights
- Architectural Shift to Server Components: The
TasksSidebar
component has been refactored from a client-side component to a server-side component (TaskSidebarServer
). This change is aimed at optimizing data fetching and improving initial load performance for the sidebar content. - Comprehensive UI/UX Redesign: The calendar sidebar's visual design has been significantly updated. This includes enhanced styling and animations for collapsed/expanded states, improved header and tab navigation, a redesigned task search input with dynamic focus effects, and a completely revamped display for tasks grouped by priority, featuring new icons, color schemes, and animations for individual task items.
- TypeScript Configuration Enhancement: The
tsconfig.json
forapps/external
now explicitly includes.next/types/**/*.ts
. This ensures that generated Next.js types are properly recognized by TypeScript, leading to improved type safety and a better development experience. - Codebase Cleanup and Refinement: Several unused imports and commented-out code blocks have been removed from
tasks-sidebar-content.tsx
, contributing to a cleaner and more maintainable codebase. Additionally, a line dropping thepg_trgm
extension was removed from a Supabase migration script, indicating a cleanup or correction in the database schema management.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request refactors the tasks sidebar, introducing UI/UX enhancements. However, there's a critical bug with priority mapping and a high-severity regression where the AI Chat tab is missing. Addressing these issues will significantly improve the user experience.
apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/tasks-sidebar-content.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/tasks-sidebar-content.tsx
Outdated
Show resolved
Hide resolved
apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/tasks-sidebar-content.tsx
Show resolved
Hide resolved
🚨 Biome Check ReportIssues Found: 5801📊 Analysis Summary
🔍 Issue Breakdown
🛠️ Next StepsRun the following command to fix issues: bun format-and-lint:fix Then commit and push the changes.
🤖 Auto-generated by Biome Check workflow • Last updated: 7/9/2025, 8:55:15 AM
|
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: 3
♻️ Duplicate comments (1)
apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/page.tsx (1)
52-52
: Verify TaskSidebarServer handles all required props.The switch from client-side
TasksSidebar
to server-sideTaskSidebarServer
is good for performance, but a previous review comment flagged thatTaskSidebarServer
doesn't pass thehasAiChatAccess
prop, which could break the AI Chat tab functionality.Please verify that
TaskSidebarServer
properly handles thehasAiChatAccess
prop and passes it toTasksSidebarContent
:#!/bin/bash # Description: Check if TaskSidebarServer properly handles hasAiChatAccess prop # Expected: TaskSidebarServer should fetch AI chat access data and pass it to TasksSidebarContent echo "Checking TaskSidebarServer implementation..." ast-grep --pattern $'export default $_ TaskSidebarServer($_) { $$$ }' echo "Checking for hasAiChatAccess usage in TaskSidebarServer..." rg -A 10 "hasAiChatAccess" --type ts
🧹 Nitpick comments (2)
packages/types/src/supabase.ts (1)
8902-8902
: Maintain a consistent severity order in Constants.task_priority.The array is now
['low', 'normal', 'high', 'critical']
.
If UI components rely on index/order for color mapping or sorting, double-check they haven’t drifted from the DB enum order above. Divergence will cause subtle UI bugs.apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/tasks-sidebar-content.tsx (1)
222-227
: Complete the priority update implementation.The function currently only logs to console. Implementing the actual API call is essential for the feature to work.
Would you like me to generate the implementation for updating task priority via API call or open a new issue to track this task?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/db/supabase/migrations/20250708033506_adjust_priority_enum.sql
(1 hunks)apps/external/tsconfig.json
(2 hunks)apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/tasks-sidebar-content.tsx
(4 hunks)apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/page.tsx
(3 hunks)apps/web/src/app/[locale]/(dashboard)/[wsId]/time-tracker/types.ts
(1 hunks)packages/types/src/supabase.ts
(2 hunks)
🧰 Additional context used
🪛 GitHub Actions: Check Database Migrations
apps/db/supabase/migrations/20250708033506_adjust_priority_enum.sql
[error] 1-1: Migration file 'apps/db/supabase/migrations/20250708033506_adjust_priority_enum.sql' must not end with '_new_migration.sql'.
🪛 GitHub Check: CodeFactor
apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/tasks-sidebar-content.tsx
[notice] 223-223: apps/web/src/app/[locale]/(dashboard)/[wsId]/calendar/components/tasks-sidebar-content.tsx#L223
Unresolved 'todo' comment. (eslint/no-warning-comments)
⏰ 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). (6)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Verify generated types
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
🔇 Additional comments (1)
apps/external/tsconfig.json (1)
4-8
: LGTM! Good formatting improvements.The multi-line formatting of JSON arrays enhances readability while maintaining the same compiler behavior. The addition of
.next/types/**/*.ts
to the include array is a standard Next.js practice for TypeScript type generation.Also applies to: 26-28, 31-39
@@ -46,6 +46,7 @@ | |||
|
|||
// Extended task interface with additional properties | |||
export interface ExtendedWorkspaceTask extends WorkspaceTask { | |||
due_date?: any; |
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.
🛠️ Refactor suggestion
Replace any
type with a more specific type.
The due_date
property uses any
which defeats TypeScript's type safety. Consider using a more specific type based on the expected data format.
- due_date?: any;
+ due_date?: string | Date | null;
If the due date comes from a database, it's typically a string in ISO format. If it's processed as a Date object, use Date
. The null
allows for tasks without due dates.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
due_date?: any; | |
due_date?: string | Date | null; |
🤖 Prompt for AI Agents
In apps/web/src/app/[locale]/(dashboard)/[wsId]/time-tracker/types.ts at line
49, replace the type of the due_date property from any to a more specific type
such as string | Date | null depending on whether the due date is stored as an
ISO string, a Date object, or can be null for tasks without due dates. This will
improve type safety and clarity in the code.
@@ -8736,7 +8736,7 @@ | |||
platform_service: 'TUTURUUU' | 'REWISE' | 'NOVA' | 'UPSKII'; | |||
subscription_status: 'trialing' | 'active' | 'canceled' | 'past_due'; | |||
task_board_status: 'not_started' | 'active' | 'done' | 'closed'; | |||
task_priority: 'low' | 'medium' | 'high' | 'urgent'; | |||
task_priority: 'low' | 'normal' | 'high' | 'critical'; |
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.
💡 Verification agent
🧩 Analysis chain
Renamed enum values are a backwards-incompatible change – audit the whole codebase & data.
Changing 'medium' | 'urgent'
→ 'normal' | 'critical'
will:
- Break existing rows that still hold the old text values.
- Break any run-time code, API requests, or UI components still sending
'medium'
/'urgent'
. - Potentially invalidate persisted filters, analytics dashboards, etc.
Please confirm that:
• A data migration script has already converted existing tasks.user_defined_priority
values.
• All front-end/SDK usages have been updated (including tests, constants, mock data, etc.).
This should return zero results (except in migration scripts).
If matches appear, update them or introduce a compatibility layer.
🏁 Script executed:
#!/usr/bin/env bash
# Grep the repo for the removed enum literals to surface missed occurrences.
rg -n "'medium'|'urgent'|\"medium\"|\"urgent\"" --glob '*.{ts,tsx,js,sql,go,py}'
Length of output: 7398
Action Required: Update all ‘medium’/‘urgent’ references to ‘normal’/‘critical’ (or add a compatibility layer)
Our grep check (rg -n "'medium'|'urgent'"
) surfaced numerous remaining occurrences of the old enum literals across UI, API, analytics, AI modules, migrations, etc. These will break at runtime unless updated:
• apps/web/src/components/...
• apps/web/src/app/.../tasks/boards/...
• apps/web/src/app/.../time-tracker/...
• apps/web/src/app/.../ai/spark/...
• apps/calendar/src/app/.../scheduler/...
• packages/ui/src/hooks/use-calendar.tsx
• packages/ui/src/components/ui/legacy/calendar/...
• packages/types/src/primitives/calendar-event.ts
• packages/ai/src/...
• apps/db/supabase/migrations/...sql
Next steps:
- Replace all occurrences of
'medium'
→'normal'
'urgent'
→'critical'
in code, tests, mock data, constants, and migration scripts (or introduce a runtime shim).
- Ensure your data-migration script has converted existing
tasks.user_defined_priority
rows. - Re-run the grep command and verify zero matches for the old literals.
🤖 Prompt for AI Agents
In packages/types/src/supabase.ts at line 8739, update all instances of the old
enum literals 'medium' and 'urgent' to 'normal' and 'critical' respectively
throughout the entire codebase including UI, API, analytics, AI modules,
migrations, tests, mock data, and constants. Additionally, ensure the
data-migration script converts existing database entries for
tasks.user_defined_priority accordingly. After making these changes, run the
grep command again to confirm no occurrences of 'medium' or 'urgent' remain.
Optionally, consider adding a runtime compatibility layer if immediate full
replacement is not feasible.
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.
LGTM! Thanks @phatgg221.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Chores