Skip to content

Improve board task UI #3145

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

Closed
wants to merge 6 commits into from
Closed

Conversation

Adinorio
Copy link
Collaborator

@Adinorio Adinorio commented Jun 20, 2025

Moved to another branch because this is not yet ready to be deleted

Adinorio added 2 commits June 21, 2025 04:09
… controls

- Replace separate refresh and columns buttons with single 'Columns & Data' button for table mode
- Add comprehensive sorting options: name, ID, created date, progress, task count, group
- Implement owner-only column visibility controls for workspace security
- Create unified 'View Options' button for cards/groups modes with smart alerts
- Add persistent settings with localStorage for user preferences
- Include loading states and animations for better UX
- Fix TypeScript compilation errors and update ViewSettings interface
- Add proper internationalization keys for all new UI elements
- Maintain backward compatibility while improving interface consistency

Enhanced features:
- Sort by IDs as requested, with ascending/descending toggle
- Smart filtering with workload imbalance detection
- Context-aware options based on current view mode
- Drag-and-drop support for groups with visual feedback
- Mobile-responsive design with proper touch interactions
@Adinorio Adinorio self-assigned this Jun 20, 2025
Copy link
Contributor

coderabbitai bot commented Jun 20, 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/tasks/improve-board-task-ui

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

graphite-app bot commented Jun 20, 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

@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 board user interface, transforming it from a basic data table into a dynamic and insightful management tool. By introducing new visual layouts, rich board-specific statistics, and customizable view options, it aims to provide users with a more intuitive and efficient way to monitor and interact with their task boards.

Highlights

  • New UI Views for Task Boards: This pull request introduces two entirely new ways to visualize and manage task boards: 'Cards' view and 'Groups' view. These provide a more visual, interactive, and organized experience compared to the traditional table layout.
  • Enhanced Board Statistics and Smart Alerts: Each task board now includes comprehensive statistics such as completion rates, active/overdue tasks, priority distribution, and workload analysis per assignee. The UI leverages these stats to display 'Smart Alerts' for urgent tasks, multiple overdue items, or workload imbalances, providing immediate insights into board health.
  • Customizable View Settings: A new settings panel has been added, allowing users to dynamically control how task boards are displayed. This includes options for sorting (by name, progress, task count, etc.), managing column visibility in table mode, and overriding smart filters. These preferences are persisted locally for a consistent user experience.
  • Improved Data Layer for UI Enrichment: The backend data fetching logic has been significantly enhanced with a new getBoardStats function. This function retrieves detailed task and list information for each board, calculating the various metrics and smart detection flags that power the new UI features.
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 pull request overhauls the task boards UI, adding multiple view modes and detailed statistics. Feedback addresses a critical N+1 query issue, fixes a color assignment bug, and improves maintainability.

Comment on lines 49 to 64
const enhancedBoards: EnhancedBoard[] = await Promise.all(
rawData.map(async (board, index) => {
const boardStats = await getBoardStats(board.id);

// Sample group assignment based on board name or index
const groups = ['gaming', 'robotics', 'marketing', 'development', 'design'];
const groupId = groups[index % groups.length];

return {
...board,
href: `/${wsId}/tasks/boards/${board.id}`,
stats: boardStats,
groupId,
};
})
);

Choose a reason for hiding this comment

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

critical

Fetching board statistics introduces an N+1 query problem. Fetching boards and then making a separate DB call (getBoardStats) for each board results in many queries, slowing down page load time. Refactor data fetching to retrieve all board statistics in a single query.

Comment on lines 95 to 109
export const GROUP_COLORS = {
'Gaming': '#10b981', // emerald
'Robotics': '#3b82f6', // blue
'Marketing': '#f59e0b', // amber
'Development': '#8b5cf6', // violet
'Design': '#ec4899', // pink
'Research': '#06b6d4', // cyan
'Sales': '#84cc16', // lime
'Support': '#f97316', // orange
'Finance': '#6366f1', // indigo
'HR': '#14b8a6', // teal
'Operations': '#ef4444', // red
'Strategy': '#64748b', // slate
'Default': '#6b7280' // gray
} as const;

Choose a reason for hiding this comment

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

high

Case-sensitivity mismatch between keys in GROUP_COLORS (e.g., 'Gaming') and groupId values in page.tsx (e.g., 'gaming') causes color lookup to fail. Make keys lowercase to ensure correct colors are applied.

Suggested change
export const GROUP_COLORS = {
'Gaming': '#10b981', // emerald
'Robotics': '#3b82f6', // blue
'Marketing': '#f59e0b', // amber
'Development': '#8b5cf6', // violet
'Design': '#ec4899', // pink
'Research': '#06b6d4', // cyan
'Sales': '#84cc16', // lime
'Support': '#f97316', // orange
'Finance': '#6366f1', // indigo
'HR': '#14b8a6', // teal
'Operations': '#ef4444', // red
'Strategy': '#64748b', // slate
'Default': '#6b7280' // gray
} as const;
export const GROUP_COLORS = {
'gaming': '#10b981', // emerald
'robotics': '#3b82f6', // blue
'marketing': '#f59e0b', // amber
'development': '#8b5cf6', // violet
'design': '#ec4899', // pink
'research': '#06b6d4', // cyan
'sales': '#84cc16', // lime
'support': '#f97316', // orange
'finance': '#6366f1', // indigo
'hr': '#14b8a6', // teal
'operations': '#ef4444', // red
'strategy': '#64748b', // slate
'default': '#6b7280' // gray
} as const;

Comment on lines 53 to 55
// Sample group assignment based on board name or index
const groups = ['gaming', 'robotics', 'marketing', 'development', 'design'];
const groupId = groups[index % groups.length];

Choose a reason for hiding this comment

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

high

Group assignment logic is hardcoded and based on the board's index. Replace with a permanent solution, storing board grouping information in the database.

Comment on lines 291 to 294
const [groups, setGroups] = useState<BoardGroup[]>([
{ id: 'gaming', name: 'Gaming', boards: [], color: GROUP_COLORS.Gaming, order: 1 },
{ id: 'robotics', name: 'Robotics', boards: [], color: GROUP_COLORS.Robotics, order: 2 },
]);

Choose a reason for hiding this comment

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

high

Initial groups are hardcoded. For production, fetch this data from an API or a configuration store.

Comment on lines 109 to 116
<Badge variant="secondary" className="text-xs bg-orange-100 text-orange-800">
Overdue
</Badge>
)}
{stats.hasWorkloadImbalance && (
<Badge variant="outline" className="text-xs border-blue-200 text-blue-700">
Imbalanced
</Badge>

Choose a reason for hiding this comment

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

medium

Styling for "Overdue" and "Imbalanced" badges uses hardcoded Tailwind CSS classes. Add overdue and imbalanced variants to the Badge component for maintainability.

@@ -0,0 +1 @@

Choose a reason for hiding this comment

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

medium

This file is empty. If it's no longer needed, remove it.

Comment on lines 119 to 139
const [isHovered, setIsHovered] = useState(false);

const progressColor = board.stats.completionRate >= 75 ? 'from-emerald-400 to-emerald-600' :
board.stats.completionRate >= 50 ? 'from-blue-400 to-blue-600' :
board.stats.completionRate >= 25 ? 'from-yellow-400 to-yellow-600' : 'from-gray-400 to-gray-600';

const groupColor = board.groupId && GROUP_COLORS[board.groupId as keyof typeof GROUP_COLORS]
? GROUP_COLORS[board.groupId as keyof typeof GROUP_COLORS]
: GROUP_COLORS.Default;

return (
<Card
className={cn(
"group relative overflow-hidden transition-all duration-200",
"hover:shadow-lg hover:scale-[1.02]",
"border-l-4 bg-gradient-to-br from-card to-card/95",
isHovered && "shadow-lg scale-[1.02]"
)}
style={{ borderLeftColor: groupColor }}
onMouseEnter={() => setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}

Choose a reason for hiding this comment

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

medium

isHovered state and onMouseEnter/onMouseLeave handlers are redundant. Achieve the same hover effect using only CSS with Tailwind's group and group-hover utilities.

Comment on lines 126 to 197
<DropdownMenuCheckboxItem
checked={settings.visibleColumns?.includes('board') ?? true}
onCheckedChange={(checked) => {
const columns = settings.visibleColumns || ['board', 'progress', 'tasks', 'status', 'last_updated', 'actions'];
const newColumns = checked
? [...columns.filter(c => c !== 'board'), 'board']
: columns.filter(c => c !== 'board');
onSettingsChange({ ...settings, visibleColumns: newColumns });
}}
>
Board Name
</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem
checked={settings.visibleColumns?.includes('progress') ?? true}
onCheckedChange={(checked) => {
const columns = settings.visibleColumns || ['board', 'progress', 'tasks', 'status', 'last_updated', 'actions'];
const newColumns = checked
? [...columns.filter(c => c !== 'progress'), 'progress']
: columns.filter(c => c !== 'progress');
onSettingsChange({ ...settings, visibleColumns: newColumns });
}}
>
Progress
</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem
checked={settings.visibleColumns?.includes('tasks') ?? true}
onCheckedChange={(checked) => {
const columns = settings.visibleColumns || ['board', 'progress', 'tasks', 'status', 'last_updated', 'actions'];
const newColumns = checked
? [...columns.filter(c => c !== 'tasks'), 'tasks']
: columns.filter(c => c !== 'tasks');
onSettingsChange({ ...settings, visibleColumns: newColumns });
}}
>
Tasks
</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem
checked={settings.visibleColumns?.includes('status') ?? true}
onCheckedChange={(checked) => {
const columns = settings.visibleColumns || ['board', 'progress', 'tasks', 'status', 'last_updated', 'actions'];
const newColumns = checked
? [...columns.filter(c => c !== 'status'), 'status']
: columns.filter(c => c !== 'status');
onSettingsChange({ ...settings, visibleColumns: newColumns });
}}
>
Status
</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem
checked={settings.visibleColumns?.includes('last_updated') ?? true}
onCheckedChange={(checked) => {
const columns = settings.visibleColumns || ['board', 'progress', 'tasks', 'status', 'last_updated', 'actions'];
const newColumns = checked
? [...columns.filter(c => c !== 'last_updated'), 'last_updated']
: columns.filter(c => c !== 'last_updated');
onSettingsChange({ ...settings, visibleColumns: newColumns });
}}
>
Last Updated
</DropdownMenuCheckboxItem>
<DropdownMenuCheckboxItem
checked={settings.visibleColumns?.includes('actions') ?? true}
onCheckedChange={(checked) => {
const columns = settings.visibleColumns || ['board', 'progress', 'tasks', 'status', 'last_updated', 'actions'];
const newColumns = checked
? [...columns.filter(c => c !== 'actions'), 'actions']
: columns.filter(c => c !== 'actions');
onSettingsChange({ ...settings, visibleColumns: newColumns });
}}
>
Actions
</DropdownMenuCheckboxItem>

Choose a reason for hiding this comment

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

medium

Logic for handling column visibility changes is duplicated for each checkbox item. Refactor this into a single handler function that accepts the columnId and checked state as arguments.

Comment on lines +66 to +69
const handleRefresh = async () => {
// Trigger a page refresh or data refetch
window.location.reload();
};

Choose a reason for hiding this comment

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

medium

Using window.location.reload() for a refresh provides a poor user experience. Use router.refresh() from next/navigation for a smoother refresh.

  const handleRefresh = async () => {
    // Trigger a data refetch using Next.js's built-in router
    router.refresh();
  };

Comment on lines 162 to 183
{settings.viewMode === 'table' && (
<div className="flex items-center gap-2">
<Button
variant="outline"
size="sm"
onClick={handleRefresh}
className="flex items-center gap-2"
>
<RefreshCw className="h-4 w-4" />
Refresh
</Button>

<Button
variant="outline"
size="sm"
className="flex items-center gap-2"
>
<Columns className="h-4 w-4" />
Columns
</Button>
</div>
)}

Choose a reason for hiding this comment

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

medium

This block of controls for the table view appears to be redundant. The ViewSettingsPanel component already contains a "Refresh Data" button and controls for column visibility when viewMode is 'table'.

Copy link

codecov bot commented Jun 20, 2025

Codecov Report

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

Project coverage is 0.79%. Comparing base (bf80e52) to head (19bc465).
Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
...ard)/[wsId]/tasks/boards/components/board-list.tsx 0.00% 700 Missing and 1 partial ⚠️
...)/[wsId]/tasks/boards/components/view-settings.tsx 0.00% 421 Missing and 1 partial ⚠️
...ashboard)/[wsId]/tasks/boards/enhanced-content.tsx 0.00% 261 Missing and 1 partial ⚠️
.../[locale]/(dashboard)/[wsId]/tasks/boards/page.tsx 0.00% 180 Missing and 1 partial ⚠️
[...ocale]/(dashboard)/[wsId]/tasks/boards/columns.tsx](https://app.codecov.io/gh/tutur3u/platform/pull/3145?src=pr&el=tree&filepath=apps%2Fweb%2Fsrc%2Fapp%2F%5Blocale%5D%2F%28dashboard%29%2F%5BwsId%5D%2Ftasks%2Fboards%2Fcolumns.tsx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tutur3u#diff-YXBwcy93ZWIvc3JjL2FwcC9bbG9jYWxlXS8oZGFzaGJvYXJkKS9bd3NJZF0vdGFza3MvYm9hcmRzL2NvbHVtbnMudHN4) 0.00% 139 Missing ⚠️
.../[locale]/(dashboard)/[wsId]/tasks/boards/types.ts 0.00% 121 Missing and 1 partial ⚠️
...ashboard)/[wsId]/tasks/boards/[boardId]/kanban.tsx 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3145      +/-   ##
==========================================
- Coverage    0.79%    0.79%   -0.01%     
==========================================
  Files        2569     2574       +5     
  Lines      328129   329894    +1765     
  Branches     3071     3076       +5     
==========================================
  Hits         2625     2625              
- Misses     323311   325071    +1760     
- Partials     2193     2198       +5     

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

@Adinorio Adinorio closed this Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants