-
-
Notifications
You must be signed in to change notification settings - Fork 19
Improvement of Task filtering status #3140
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
WalkthroughThe changes introduce new utility functions for assignee transformation and cache invalidation, enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant UI as TaskCard Component
participant Helper as task-helper.ts
participant API as API Route
participant Query as React Query Client
UI->>UI: Receives optional availableLists prop
alt availableLists provided
UI->>UI: Sets lists state directly
else
UI->>API: Fetches lists from API
end
UI->>Helper: Calls moveTask() on move action
Helper->>API: Performs move mutation
API-->>Helper: Returns result or error
Helper->>UI: Throws error or returns success
Helper->>Query: invalidateTaskCaches()
Query-->>UI: Updates caches
UI->>UI: Shows toast on error
Possibly related PRs
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsxOops! Something went wrong! :( ESLint: 9.29.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /eslint.config.mjs apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.tsOops! Something went wrong! :( ESLint: 9.29.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /eslint.config.mjs apps/web/src/lib/time-tracking-helper.tsOops! Something went wrong! :( ESLint: 9.29.0 Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@typescript-eslint/parser' imported from /eslint.config.mjs
✨ 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3140 +/- ##
==========================================
- Coverage 0.80% 0.80% -0.01%
==========================================
Files 2554 2554
Lines 326716 326774 +58
Branches 3056 3056
==========================================
Hits 2623 2623
- Misses 321912 321970 +58
Partials 2181 2181 ☔ 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 @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 significantly refines how tasks are managed and displayed, particularly in the context of time tracking. It introduces a more robust and consistent approach to moving tasks between lists, ensuring that task completion status (archived/unarchived) is correctly managed based on the target list's status. Furthermore, it optimizes data fetching for time tracking by applying precise filters at the API level, guaranteeing that only active and relevant tasks are presented to the user, thereby improving the accuracy and usability of the time tracking feature.
Highlights
- Task Completion Logic Refactor: Centralized the logic for moving tasks to completion by introducing a shared
moveTask
helper function. This ensures consistent handling of task archiving based on the target list's status (e.g., 'done' or 'closed' lists will archive the task). - Optimized Task List Fetching: Improved the
TaskCard
component to optionally receiveavailableLists
as a prop, preventing redundant API calls to fetch task lists if the data is already available from a parent component. - Enhanced Task API Filtering for Time Tracking: Modified the task API endpoint (
/api/v1/workspaces/[wsId]/tasks
) to apply specific filters when requested for time tracking purposes. This ensures that only non-archived tasks from 'not_started' or 'active' lists are returned, providing a more accurate and relevant dataset for time tracking. - Improved Data Fetching for Time Tracking: Rewrote the task fetching query within
time-tracking-helper.ts
to explicitly join related tables (task lists, boards, assignees) and apply precise filters. This ensures that the time tracking view only displays tasks that are truly active and relevant for tracking time against. - Centralized Cache Invalidation: Introduced a new
invalidateTaskCaches
utility function to consistently invalidate relevant caches (tasks, task lists, and time tracking data) after task updates, ensuring UI consistency across the application.
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
The pull request improves task filtering by status and enhances the time tracking feature. It introduces several changes, including adding status to the TaskList data structure, filtering tasks based on the list status, and updating the task card component to handle task completion. The changes also include refactoring some code for better consistency and adding comments for clarity.
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx
Show resolved
Hide resolved
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx
Show resolved
Hide resolved
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: 0
♻️ Duplicate comments (5)
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx (2)
72-72
: Good optimization to prevent redundant API calls.This optional prop allows the parent component to pass pre-fetched lists, avoiding unnecessary network requests.
257-273
: Improved consistency by using the shared moveTask helper.The refactor to use the shared
moveTask
function ensures consistent logic and proper cache invalidation. The error handling with toast notifications provides good user feedback.apps/web/src/lib/time-tracking-helper.ts (1)
232-243
: Use the existing transformAssignees utility function.This logic duplicates the
transformAssignees
function already available intask-helper.ts
. Consider importing and using that function instead for consistency.+import { transformAssignees } from '@/lib/task-helper'; - assignees: task.assignees - ?.map((a: any) => ({ - ...a.user, - // Extract email from nested user_private_details - email: a.user?.user_private_details?.[0]?.email || null, - })) - .filter( - (user: any, index: number, self: any[]) => - user && - user.id && - self.findIndex((u: any) => u.id === user.id) === index - ) || [], + assignees: transformAssignees(task.assignees || []).map((user: any) => ({ + ...user, + // Extract email from nested user_private_details + email: user?.user_private_details?.[0]?.email || null, + })),apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (2)
17-17
: Consider adding documentation for the status field.Adding comments to explain the possible status values would improve clarity for other developers.
178-179
: Consider improving type safety in the assignee mapping.Using proper type assertions instead of
any
would provide better type safety.
🧹 Nitpick comments (2)
apps/web/src/lib/time-tracking-helper.ts (1)
240-241
: Simplify the conditional check using optional chaining.The current logic can be simplified as suggested by the static analysis tool.
- user && - user.id && + user?.id &&apps/web/src/lib/task-helper.ts (1)
152-153
: Simplify the conditional check using optional chaining.The current logic can be simplified as suggested by the static analysis tool.
- user && - user.id && + user?.id &&
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx
(6 hunks)apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts
(7 hunks)apps/web/src/lib/task-helper.ts
(6 hunks)apps/web/src/lib/time-tracking-helper.ts
(2 hunks)packages/types/src/primitives/TaskBoard.ts
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
apps/web/src/lib/time-tracking-helper.ts
[error] 240-241: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
apps/web/src/lib/task-helper.ts
[error] 152-153: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🔇 Additional comments (4)
packages/types/src/primitives/TaskBoard.ts (1)
3-5
: Excellent documentation improvement!These clarifying comments effectively distinguish
TaskBoardStatus
from the AI module'sTaskStatus
, preventing potential developer confusion. Clear documentation like this is valuable for maintainability.apps/web/src/lib/task-helper.ts (2)
147-156
: Excellent utility function for code reuse.The
transformAssignees
function centralizes assignee transformation logic, promoting consistency across the codebase. This is exactly what was needed to eliminate the duplicate logic in other files.
159-166
: Great addition for consistent cache management.The
invalidateTaskCaches
function ensures all related caches are invalidated together, improving data consistency after task operations. Including time-tracking data invalidation is particularly important for the PR's objectives.apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (1)
92-139
: Excellent implementation of time tracking specific filtering.The detection of time tracking requests and application of appropriate filters (non-archived tasks, active/not_started lists) aligns perfectly with the PR objectives. This ensures consistent data between the API and the time tracking helper.
- Filter time tracker API to exclude tasks from 'done' and 'closed' lists - Update task movement logic to properly archive completed tasks - Add proper cache invalidation for time tracker when tasks move - Standardize task completion logic across components - Refactor duplicate assignee transformation into shared utility - Add documentation for task list status values - Improve type safety with proper interface definitions BREAKING CHANGE: Time tracker will no longer show tasks from completed lists Resolves task status logic inconsistency where done tasks remained trackable
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: 0
♻️ Duplicate comments (3)
apps/web/src/lib/time-tracking-helper.ts (1)
7-7
: Excellent implementation addressing previous feedback.The import and usage of
transformAssignees
directly addresses the past review comment about avoiding duplicated filter logic. This ensures consistent assignee processing across the application.Also applies to: 233-233
apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (2)
17-19
: Well-documented interface extension with clear field usage.The addition of the
status
field toTaskListData
with comprehensive comments explaining possible values and usage context is excellent. This addresses the previous review feedback about documenting possible status values.
27-27
: Good interface renaming and necessary field addition.The rename from
RawTaskData
toTaskData
is cleaner, and thearchived
field addition is essential for filtering archived tasks, as noted in previous reviews.Also applies to: 37-37
🧹 Nitpick comments (1)
apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (1)
180-182
: Improved type safety in assignee processing.While the
any
types are still present, the explicit typing in the map function is clearer than before. The deduplication logic usingMap
is efficient and correct.Consider creating a proper type for the assignee transformation to further improve type safety:
+interface ProcessedAssignee { + id: string; + display_name: string | null; + avatar_url: string | null; +} - .map((a: any) => a.user) - .filter((u: any) => !!u?.id) - .reduce((uniqueUsers: Map<string, any>, user: any) => { + .map((a: TaskAssigneeData) => a.user) + .filter((u): u is ProcessedAssignee => !!u?.id) + .reduce((uniqueUsers: Map<string, ProcessedAssignee>, user: ProcessedAssignee) => {Also applies to: 187-187
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts
(7 hunks)apps/web/src/lib/task-helper.ts
(6 hunks)apps/web/src/lib/time-tracking-helper.ts
(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/web/src/lib/time-tracking-helper.ts (1)
apps/web/src/lib/task-helper.ts (1)
transformAssignees
(147-155)
🪛 GitHub Check: codecov/patch
apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts
[warning] 17-19: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L17-L19
Added lines #L17 - L19 were not covered by tests
[warning] 27-27: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L27
Added line #L27 was not covered by tests
[warning] 37-37: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L37
Added line #L37 was not covered by tests
[warning] 93-95: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L93-L95
Added lines #L93 - L95 were not covered by tests
[warning] 111-111: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L111
Added line #L111 was not covered by tests
[warning] 115-115: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L115
Added line #L115 was not covered by tests
[warning] 135-142: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L135-L142
Added lines #L135 - L142 were not covered by tests
[warning] 162-162: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L162
Added line #L162 was not covered by tests
[warning] 172-172: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L172
Added line #L172 was not covered by tests
[warning] 176-176: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L176
Added line #L176 was not covered by tests
[warning] 180-182: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L180-L182
Added lines #L180 - L182 were not covered by tests
[warning] 187-187: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L187
Added line #L187 was not covered by tests
apps/web/src/lib/task-helper.ts
[warning] 147-155: apps/web/src/lib/task-helper.ts#L147-L155
Added lines #L147 - L155 were not covered by tests
[warning] 158-162: apps/web/src/lib/task-helper.ts#L158-L162
Added lines #L158 - L162 were not covered by tests
[warning] 164-165: apps/web/src/lib/task-helper.ts#L164-L165
Added lines #L164 - L165 were not covered by tests
[warning] 219-219: apps/web/src/lib/task-helper.ts#L219
Added line #L219 was not covered by tests
[warning] 511-511: apps/web/src/lib/task-helper.ts#L511
Added line #L511 was not covered by tests
[warning] 524-524: apps/web/src/lib/task-helper.ts#L524
Added line #L524 was not covered by tests
[warning] 536-536: apps/web/src/lib/task-helper.ts#L536
Added line #L536 was not covered by tests
[warning] 538-538: apps/web/src/lib/task-helper.ts#L538
Added line #L538 was not covered by tests
apps/web/src/lib/time-tracking-helper.ts
[warning] 7-7: apps/web/src/lib/time-tracking-helper.ts#L7
Added line #L7 was not covered by tests
[warning] 52-54: apps/web/src/lib/time-tracking-helper.ts#L52-L54
Added lines #L52 - L54 were not covered by tests
[warning] 74-81: apps/web/src/lib/time-tracking-helper.ts#L74-L81
Added lines #L74 - L81 were not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (8)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Prettier Check (23)
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Verify generated types
🔇 Additional comments (8)
apps/web/src/lib/task-helper.ts (4)
157-165
: Excellent centralization of cache invalidation logic.The
invalidateTaskCaches
function properly handles cache consistency by invalidating all related query keys. The time tracking cache invalidation is especially important since task availability affects the time tracker.
184-186
: Good documentation and consistent use of utility function.The comments clearly explain the archival logic based on list status, and the refactoring to use
transformAssignees
improves code consistency.Also applies to: 219-219
511-511
: Clean parameter handling and improved cache management.The underscore prefixes on unused parameters follow good conventions, and the switch to
invalidateTaskCaches
ensures comprehensive cache invalidation across related components.Also applies to: 524-524, 536-538
146-155
: ```shell
#!/bin/bashSearch for tests covering transformAssignees
rg "transformAssignees" -g "*.{test,spec}.{ts,tsx,js,jsx}" -n || echo "No tests found for transformAssignees"
Search for tests covering invalidateTaskCaches
rg "invalidateTaskCaches" -g "*.{test,spec}.{ts,tsx,js,jsx}" -n || echo "No tests found for invalidateTaskCaches"
</details> <details> <summary>apps/web/src/lib/time-tracking-helper.ts (2)</summary> `52-81`: **Well-structured query with appropriate filtering for time tracking.** The complex joins and filtering logic correctly identify available tasks for time tracking by: - Filtering by workspace through board relation - Excluding deleted and archived tasks - Restricting to active task lists ('not_started' or 'active') - Including necessary nested data (assignees, board info) --- `223-244`: **Comprehensive task transformation with proper data flattening.** The transformation logic effectively: - Flattens nested board/list properties for easier access - Processes assignees consistently using the utility function - Extracts email from nested private details - Adds useful computed fields (`is_assigned_to_current_user`, `completed`) </details> <details> <summary>apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (2)</summary> `94-95`: **Smart conditional filtering logic for time tracking requests.** The detection of time tracking requests (`limit=100` without specific filters) and subsequent application of appropriate filters is well-designed. This ensures the API returns only relevant tasks for time tracking while maintaining backward compatibility for other use cases. Also applies to: 135-141 --- `111-111`: **Proper integration of new fields in query and response.** The addition of `archived` and `status` fields to both the select query and response transformation ensures data consistency across the API. Also applies to: 115-115, 162-162, 172-172, 176-176 </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
- Add ProcessedAssignee interface for better type definitions - Replace 'any' types with proper TypeScript interfaces - Use type guards for safer runtime type checking - Enhance assignee deduplication with strong typing - Improve code maintainability and IDE support The API now has comprehensive type safety for assignee data processing while maintaining backward compatibility with existing functionality.
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: 0
♻️ Duplicate comments (5)
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx (2)
72-72
: Good optimization to prevent redundant API calls.The optional
availableLists
prop allows parent components to pass pre-fetched task lists, avoiding unnecessary API requests when the data is already available.Also applies to: 81-81
257-273
: Update the comment about cache invalidation.The
moveTask
function now handles cache invalidation internally throughinvalidateTaskCaches
, making the comment about "manually invalidating queries" inaccurate.- // Use the standard moveTask function to ensure consistent logic - const supabase = createClient(); - try { - await moveTask(supabase, task.id, targetCompletionList.id); - // Manually invalidate queries since we're not using the mutation hook - onUpdate(); + // Use the standard moveTask function for consistent logic and cache management + const supabase = createClient(); + try { + await moveTask(supabase, task.id, targetCompletionList.id); + onUpdate();apps/web/src/lib/time-tracking-helper.ts (1)
235-235
: Excellent use of the shared assignee transformation utility.Using
transformAssignees
instead of the duplicated filtering logic maintains consistency and leverages the centralized implementation.apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (2)
23-25
: Well-documented status field addition.The comments clearly explain the possible status values and their purpose for time tracking, addressing the suggestion from previous reviews.
43-43
: Necessary field addition for task lifecycle management.The
archived
field enables proper filtering of tasks based on their completion/archival status.
🧹 Nitpick comments (3)
apps/web/src/lib/task-helper.ts (2)
146-156
: Excellent refactoring to centralize assignee transformation logic.The
transformAssignees
utility function effectively eliminates code duplication and provides consistent assignee processing across the application. The deduplication logic usingfindIndex
is correct and efficient.Consider adding unit tests for this utility function to improve coverage and prevent regressions:
describe('transformAssignees', () => { it('should extract and deduplicate user objects', () => { const assignees = [ { user: { id: '1', display_name: 'User 1' } }, { user: { id: '2', display_name: 'User 2' } }, { user: { id: '1', display_name: 'User 1' } }, // duplicate ]; const result = transformAssignees(assignees); expect(result).toHaveLength(2); expect(result.map(u => u.id)).toEqual(['1', '2']); }); });
158-166
: Good centralization of cache invalidation logic.The
invalidateTaskCaches
function ensures consistent cache invalidation across task-related operations. The inclusion of time-tracking data invalidation makes sense since task availability affects the time tracker.Consider adding JSDoc documentation to clarify the function's purpose and parameters:
/** * Invalidates all task-related caches consistently * @param queryClient - React Query client instance * @param boardId - Optional board ID to scope invalidation */ export function invalidateTaskCaches(queryClient: any, boardId?: string) {apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (1)
186-199
: Improved assignee deduplication with better performance.The Map-based approach using
reduce
is more efficient than the previous filter-based deduplication, especially for larger assignee lists. The explicit typing withProcessedAssignee
improves type safety.Consider extracting this deduplication logic into a utility function to match the pattern established in
task-helper.ts
:function deduplicateAssignees(assignees: TaskAssigneeData[]): ProcessedAssignee[] { return [ ...assignees .map((a) => a.user) .filter((u): u is ProcessedAssignee => !!u?.id) .reduce((uniqueUsers: Map<string, ProcessedAssignee>, user: ProcessedAssignee) => { if (!uniqueUsers.has(user.id)) { uniqueUsers.set(user.id, user); } return uniqueUsers; }, new Map()) .values(), ]; }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx
(7 hunks)apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts
(8 hunks)apps/web/src/lib/task-helper.ts
(6 hunks)apps/web/src/lib/time-tracking-helper.ts
(3 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/web/src/lib/time-tracking-helper.ts (1)
apps/web/src/lib/task-helper.ts (1)
transformAssignees
(147-156)
🪛 GitHub Check: codecov/patch
apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx
[warning] 4-4: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L4
Added line #L4 was not covered by tests
[warning] 33-33: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L33
Added line #L33 was not covered by tests
[warning] 72-72: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L72
Added line #L72 was not covered by tests
[warning] 81-81: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L81
Added line #L81 was not covered by tests
[warning] 98-98: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L98
Added line #L98 was not covered by tests
[warning] 100-104: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L100-L104
Added lines #L100 - L104 were not covered by tests
[warning] 121-121: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L121
Added line #L121 was not covered by tests
[warning] 256-273: apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx#L256-L273
Added lines #L256 - L273 were not covered by tests
apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts
[warning] 5-10: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L5-L10
Added lines #L5 - L10 were not covered by tests
[warning] 23-25: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L23-L25
Added lines #L23 - L25 were not covered by tests
[warning] 33-33: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L33
Added line #L33 was not covered by tests
[warning] 43-43: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L43
Added line #L43 was not covered by tests
[warning] 100-102: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L100-L102
Added lines #L100 - L102 were not covered by tests
[warning] 117-117: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L117
Added line #L117 was not covered by tests
[warning] 121-121: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L121
Added line #L121 was not covered by tests
[warning] 141-148: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L141-L148
Added lines #L141 - L148 were not covered by tests
[warning] 168-168: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L168
Added line #L168 was not covered by tests
[warning] 178-178: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L178
Added line #L178 was not covered by tests
[warning] 182-182: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L182
Added line #L182 was not covered by tests
[warning] 186-199: apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts#L186-L199
Added lines #L186 - L199 were not covered by tests
apps/web/src/lib/task-helper.ts
[warning] 147-154: apps/web/src/lib/task-helper.ts#L147-L154
Added lines #L147 - L154 were not covered by tests
[warning] 156-156: apps/web/src/lib/task-helper.ts#L156
Added line #L156 was not covered by tests
[warning] 159-163: apps/web/src/lib/task-helper.ts#L159-L163
Added lines #L159 - L163 were not covered by tests
[warning] 165-166: apps/web/src/lib/task-helper.ts#L165-L166
Added lines #L165 - L166 were not covered by tests
[warning] 220-220: apps/web/src/lib/task-helper.ts#L220
Added line #L220 was not covered by tests
[warning] 512-512: apps/web/src/lib/task-helper.ts#L512
Added line #L512 was not covered by tests
[warning] 525-525: apps/web/src/lib/task-helper.ts#L525
Added line #L525 was not covered by tests
[warning] 537-537: apps/web/src/lib/task-helper.ts#L537
Added line #L537 was not covered by tests
[warning] 539-539: apps/web/src/lib/task-helper.ts#L539
Added line #L539 was not covered by tests
apps/web/src/lib/time-tracking-helper.ts
[warning] 3-3: apps/web/src/lib/time-tracking-helper.ts#L3
Added line #L3 was not covered by tests
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Deploy-Preview
- GitHub Check: Verify generated types
🔇 Additional comments (8)
apps/web/src/lib/task-helper.ts (3)
185-187
: Clear documentation of task archival business logic.The comments effectively explain how list status determines task archival state, making the business rules explicit and maintainable.
220-220
: Good use of the centralized utility function.Replacing inline assignee transformation with the
transformAssignees
utility maintains consistency and reduces code duplication.
537-539
: Improved cache invalidation strategy.Using
invalidateTaskCaches
instead of only invalidating the tasks cache ensures consistency across all related data, including time-tracking information.apps/web/src/app/[locale]/(dashboard)/[wsId]/tasks/boards/[boardId]/task.tsx (1)
98-104
: Efficient conditional data fetching.The logic correctly uses prop-provided lists when available and only fetches from the API when necessary, improving performance and reducing network requests.
Also applies to: 121-121
apps/web/src/lib/time-tracking-helper.ts (2)
3-3
: Good adoption of the centralized utility function.Importing
transformAssignees
from the task helper ensures consistent assignee processing across the application.
52-83
: Comprehensive query enhancement for time tracking.The expanded query with nested relations (task lists, boards, assignees) and filtering by workspace, archival status, and list status provides all necessary data for time tracking functionality while maintaining performance with appropriate limits.
apps/web/src/app/api/v1/workspaces/[wsId]/tasks/route.ts (2)
5-9
: Excellent addition of explicit typing for assignees.The
ProcessedAssignee
interface improves type safety and clearly defines the structure of processed assignee data, replacing the previousany
types.
100-102
: Smart detection and filtering for time tracking requests.The logic correctly identifies time tracking requests and applies appropriate filters to exclude archived tasks and include only tasks from active lists, ensuring data consistency with the time tracking helper.
Also applies to: 141-147
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 @Adinorio.
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation