Skip to content

Improve command palette navigation #3174

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

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

Adinorio
Copy link
Collaborator

No description provided.

Adinorio and others added 30 commits June 23, 2025 13:50
…components

🔧 BREAKING DOWN MONOLITHIC FILE (3497 → 1722 lines)

✨ New Components Created:
- components/GanttChart.tsx (1027 lines) - Timeline visualization with pagination & search
- components/TaskWorkflowAnalytics.tsx (208 lines) - Workflow efficiency metrics
- components/TaskCreationAnalytics.tsx (214 lines) - Creation trends & analytics
- components/StatusDistribution.tsx (117 lines) - Task status distribution charts
- components/TaskGroup.tsx (230 lines) - Collapsible task sections with priority badges

🛠️ Utilities & Hooks:
- utils/taskHelpers.ts (177 lines) - Shared utility functions for task operations
- hooks/useTaskAnalytics.ts (247 lines) - Analytics calculation hooks

🐛 Critical React Hooks Fixes:
- Fixed hook order violations in GanttChart component
- Moved useMemo from JSX to top-level (Rules of Hooks compliance)
- Resolved 'Rendered more hooks than during the previous render' error

🧹 Code Quality Improvements:
- Removed all unused imports and dependencies
- Clean separation of concerns between components
- Maintained full functionality while improving maintainability
- Each component now has focused, single responsibility

📊 Benefits:
- ✅ 50% reduction in main file size (3497 → 1722 lines)
- ✅ Improved testability with isolated components
- ✅ Enhanced maintainability and code readability
- ✅ Resolved React Hooks runtime errors
- ✅ Better developer experience for future modifications

This refactoring transforms a large, difficult-to-maintain monolithic component into a well-structured, modular architecture while preserving all existing functionality and fixing critical React compliance issues.
Copy link

graphite-app bot commented Jun 24, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

Copy link
Contributor

coderabbitai bot commented Jun 24, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch feat/command-palette/improve-quick-assist

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

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Jun 24, 2025

Codecov Report

Attention: Patch coverage is 0% with 3927 lines in your changes missing coverage. Please review.

Project coverage is 0.86%. Comparing base (b017dc3) to head (a07850b).

Files with missing lines Patch % Lines
[...]/tasks/boards/[boardId]/_components/list-view.tsx](https://app.codecov.io/gh/tutur3u/platform/pull/3174?src=pr&el=tree&filepath=apps%2Fweb%2Fsrc%2Fapp%2F%5Blocale%5D%2F%28dashboard%29%2F%5BwsId%5D%2Ftasks%2Fboards%2F%5BboardId%5D%2F_components%2Flist-view.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tutur3u#diff-YXBwcy93ZWIvc3JjL2FwcC9bbG9jYWxlXS8oZGFzaGJvYXJkKS9bd3NJZF0vdGFza3MvYm9hcmRzL1tib2FyZElkXS9fY29tcG9uZW50cy9saXN0LXZpZXcudHN4) 0.00% 920 Missing ⚠️
...ard)/[wsId]/tasks/boards/components/GanttChart.tsx 0.00% 372 Missing and 1 partial ⚠️
...)/[wsId]/tasks/boards/components/GanttTimeline.tsx 0.00% 369 Missing and 1 partial ⚠️
...ard)/[wsId]/tasks/boards/hooks/useTaskAnalytics.ts 0.00% 329 Missing and 1 partial ⚠️
.../tasks/boards/components/TaskCreationAnalytics.tsx 0.00% 281 Missing and 1 partial ⚠️
.../tasks/boards/components/TaskWorkflowAnalytics.tsx 0.00% 270 Missing and 1 partial ⚠️
...oard)/[wsId]/tasks/boards/components/TaskGroup.tsx 0.00% 264 Missing and 1 partial ⚠️
.../[wsId]/tasks/boards/components/TaskDetailCard.tsx 0.00% 249 Missing and 1 partial ⚠️
...ashboard)/[wsId]/tasks/boards/utils/taskHelpers.ts 0.00% 219 Missing and 1 partial ⚠️
apps/web/src/components/command/index.tsx 0.00% 126 Missing ⚠️
... and 10 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3174      +/-   ##
==========================================
- Coverage    0.87%    0.86%   -0.01%     
==========================================
  Files        2574     2585      +11     
  Lines      332704   335096    +2392     
  Branches     3138     3149      +11     
==========================================
  Hits         2912     2912              
- Misses     327597   329978    +2381     
- Partials     2195     2206      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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 @Adinorio, 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 delivers a substantial upgrade to the task management system, focusing on improving the user's ability to navigate, filter, and analyze tasks. It introduces powerful new UI features for task lists and analytics, backed by significant database enhancements for tag management, all while refining the command palette's usability and error handling.

Highlights

  • Enhanced Task List View: The task list view has been significantly upgraded with advanced filtering capabilities (by priority, status, assignee, and date), multi-column sorting, pagination, and options to toggle column visibility. It also introduces bulk task selection for future actions.
  • New Task Analytics & Visualization: Several new components have been added to provide deeper insights into tasks, including a comprehensive Gantt chart timeline, detailed status distribution, task creation and flow analytics, and workflow efficiency metrics.
  • Improved Command Palette User Experience: The command palette now offers a more robust user experience with explicit loading indicators, detailed error messages, and user-friendly empty states. It includes retry mechanisms for data fetching and direct prompts to create new boards or lists when applicable.
  • Database Performance & Integrity for Tags: The backend has been strengthened with new PostgreSQL GIN indexes for faster JSONB tag queries on board tags. Atomic operations for adding and removing tags, along with a new database-level CHECK constraint, ensure data integrity and improve concurrency.
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

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

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This is an impressive pull request that significantly enhances the application's task management capabilities. The new list view with advanced filtering, sorting, and bulk actions is a huge improvement to the user experience. The addition of the Gantt chart and analytics components provides valuable insights for users.

On the backend, the SQL migration for board tags is well-executed, focusing on performance and atomicity. The command palette is now much more robust, with better loading/error states and an error boundary.

The code quality is high, with good separation of concerns and use of modern React patterns. I've left a few suggestions for minor improvements, mostly around performance, robustness, and navigation consistency. Great work!

RETURN true;
EXCEPTION
-- Only catch the specific exceptions we raise in validate_and_normalize_board_tags
WHEN SQLSTATE '22000' THEN -- our custom validation errors

Choose a reason for hiding this comment

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

medium

The EXCEPTION block is configured to catch SQLSTATE '22000', which corresponds to data_exception. However, the RAISE EXCEPTION statements in the validate_and_normalize_board_tags function do not specify an ERRCODE, so they will default to P0001 (raise_exception). This means this EXCEPTION block may not catch the intended validation errors.

To fix this, you could change WHEN SQLSTATE '22000' to WHEN raise_exception, which is the default for RAISE statements without a specific error code.

    WHEN raise_exception THEN  -- Catches default RAISE EXCEPTION errors

Comment on lines +647 to +651
const priorityLabels = {
1: 'High',
2: 'Medium',
3: 'Low',
};

Choose a reason for hiding this comment

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

medium

The priorityLabels object is being created inside the map() function, which means it's recreated for every priority item on every render. This is inefficient, especially if the list of priorities grows.

For better performance and code clarity, you can define it once outside the map() callback, for example, at the component level or right before the return statement of the PopoverContent's child function.

tasks: Task[];
}>({
queryKey: ['tasks', wsId, selectedBoardId, selectedListId],
queryFn: async () => {
if (!selectedBoardId && !selectedListId) return [];
if (!selectedBoardId && !selectedListId) return { tasks: [] };

Choose a reason for hiding this comment

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

medium

This is a good fix. The previous code return [] would cause a TypeError when useQuery's result is accessed via .tasks, as an array doesn't have that property. Returning an object with an empty tasks array { tasks: [] } makes the return type consistent and prevents runtime errors.

Comment on lines 241 to 249
variant="outline"
size="sm"
onClick={() => {
const wsId = window.location.pathname.split('/')[1];
window.location.href = `/${wsId}/tasks/boards`;
}}
>
<Plus className="h-4 w-4 mr-2" />
Create Board

Choose a reason for hiding this comment

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

medium

Using window.location.href causes a full page reload, which can be a jarring user experience. Since useRouter is available in this component, you can use router.push() for a smoother client-side navigation. This also allows you to close the command palette programmatically after navigation.

        <Button
          variant="outline"
          size="sm"
          onClick={() => {
            router.push(`/${wsId}/tasks/boards`);
            setOpen(false);
          }}
        >
          <Plus className="h-4 w-4 mr-2" />
          Create Board
        </Button>

Comment on lines +116 to +128
<Button
variant="outline"
size="sm"
onClick={() => {
// Navigate to boards page to create new board
const wsId = window.location.pathname.split('/')[1];
window.location.href = `/${wsId}/tasks/boards`;
}}
className="gap-2"
>
<Plus className="h-3 w-3" />
Create Board
</Button>

Choose a reason for hiding this comment

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

medium

Using window.location.href causes a full page reload. It's better to handle navigation in the parent component (CommandPalette) which has access to the Next.js router and can close the palette.

Consider adding an onCreateBoard prop to this component and calling it onClick. The parent can then implement the client-side navigation.

Example in BoardNavigationProps:

onCreateBoard: () => void;

Example in the Button:

onClick={props.onCreateBoard}

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.

2 participants