-
Notifications
You must be signed in to change notification settings - Fork 14
feat(#230): add view task modal #231
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
feat(#230): add view task modal #231
Conversation
- add component to show todo details in read only mode with edit and close button. - move updateTask mutation to a separate hook - renamed create-edit-todo-dialog to todo-dialog
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe PR introduces a modal dialog system for viewing and editing todos across the application. A new Changes
Sequence DiagramsequenceDiagram
actor User
participant UI as Table/List View
participant Dialog as TodoDialog
participant ViewModal as ViewTodoModal
participant Form as CreateEditTodoForm
participant Hook as useUpdateTask
participant API as TasksApi
participant Cache as Query Cache
User->>UI: Click on todo row
UI->>Dialog: Open dialog (mode: view)
Dialog->>ViewModal: Render view modal
ViewModal-->>Dialog: Display todo details (read-only)
Dialog-->>UI: Show modal with details
User->>Dialog: Click Edit button
Dialog->>Dialog: Switch mode to edit
Dialog->>Form: Render form with todo data
Form-->>Dialog: Show editable form
User->>Form: Edit fields & click Save
Form->>Dialog: Trigger onSubmit with new data
Dialog->>Hook: Call handleSubmission(todoDetails)
rect rgb(200, 220, 240)
Note over Hook,Cache: Update & Invalidate
Hook->>API: updateTask(id, updateDetails)
API-->>Hook: Success response
Hook->>Cache: Invalidate getTasks
Hook->>Cache: Invalidate getWatchListTasks
Hook->>Cache: Invalidate team-scoped queries
end
Hook-->>Dialog: handleSubmission completes
Dialog->>Dialog: Switch mode to view
Dialog->>ViewModal: Render updated details
ViewModal-->>Dialog: Display refreshed data
Dialog-->>UI: Modal shows updated view
User->>Dialog: Click Close
Dialog->>UI: Close modal
UI-->>User: Return to list view
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
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. Comment |
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
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (8)
src/components/todos/create-edit-todo-dialog.tsxsrc/components/todos/create-todo-button.tsxsrc/components/todos/edit-task-button.tsxsrc/components/todos/todo-dialog.tsxsrc/components/todos/todo-list-table.tsxsrc/components/todos/view-todo-modal.tsxsrc/hooks/useUpdateTask.tssrc/modules/teams/team-tasks.tsx
💤 Files with no reviewable changes (1)
- src/components/todos/create-edit-todo-dialog.tsx
🧰 Additional context used
🧬 Code graph analysis (7)
src/components/todos/todo-dialog.tsx (3)
src/components/todos/create-edit-todo-form.tsx (2)
TTodoFormData(45-45)CreateEditTodoForm(114-350)src/components/ui/alert-dialog.tsx (5)
AlertDialog(122-122)AlertDialogTrigger(132-132)AlertDialogContent(125-125)AlertDialogHeader(128-128)AlertDialogTitle(131-131)src/components/todos/view-todo-modal.tsx (1)
ViewTodoModal(43-108)
src/components/todos/view-todo-modal.tsx (8)
src/lib/utils.ts (1)
cn(5-7)src/components/todos/create-edit-todo-form.tsx (1)
TTodoFormData(45-45)src/api/labels/labels.api.ts (1)
LablesApi(4-12)src/lib/date-util.ts (1)
DateUtil(11-21)src/components/todos/task-priority-label.tsx (1)
TaskPriorityLabel(14-29)src/components/todos/todo-status-table.tsx (1)
TodoStatusTable(15-32)src/components/ui/badge.tsx (1)
Badge(37-37)src/components/ui/button.tsx (1)
Button(59-59)
src/modules/teams/team-tasks.tsx (10)
src/hooks/useUpdateTask.ts (1)
useUpdateTask(14-67)src/components/todos/create-edit-todo-form.tsx (1)
TTodoFormData(45-45)src/components/todos/todo-dialog.tsx (1)
TodoDialog(39-100)src/lib/todo-util.ts (1)
TodoUtil(4-67)src/components/todos/todo-status-table.tsx (1)
TodoStatusTable(15-32)src/components/todos/todo-labels-list.tsx (1)
TodoLabelsList(92-109)src/components/todos/task-priority-label.tsx (1)
TaskPriorityLabel(14-29)src/lib/date-util.ts (1)
DateUtil(11-21)src/components/users/reassign-user.tsx (1)
ReassignUser(97-117)src/components/todos/edit-task-button.tsx (1)
EditTodoButton(16-54)
src/components/todos/edit-task-button.tsx (4)
src/api/tasks/tasks.types.ts (1)
TTask(11-24)src/hooks/useUpdateTask.ts (1)
useUpdateTask(14-67)src/components/todos/create-edit-todo-form.tsx (1)
TTodoFormData(45-45)src/components/todos/todo-dialog.tsx (1)
TodoDialog(39-100)
src/components/todos/create-todo-button.tsx (1)
src/components/todos/todo-dialog.tsx (1)
TodoDialog(39-100)
src/hooks/useUpdateTask.ts (3)
src/api/tasks/tasks.types.ts (1)
TTask(11-24)src/api/tasks/tasks.api.ts (1)
TasksApi(17-77)src/components/todos/create-edit-todo-form.tsx (1)
TTodoFormData(45-45)
src/components/todos/todo-list-table.tsx (7)
src/hooks/useUpdateTask.ts (1)
useUpdateTask(14-67)src/components/todos/create-edit-todo-form.tsx (1)
TTodoFormData(45-45)src/components/todos/todo-dialog.tsx (1)
TodoDialog(39-100)src/lib/todo-util.ts (1)
TodoUtil(4-67)src/components/todos/todo-status-table.tsx (1)
TodoStatusTable(15-32)src/components/todos/todo-labels-list.tsx (1)
TodoLabelsList(92-109)src/components/todos/task-priority-label.tsx (1)
TaskPriorityLabel(14-29)
🪛 Biome (2.1.2)
src/components/todos/todo-list-table.tsx
[error] 122-122: Static Elements should not be interactive.
To add interactivity such as a mouse or key event listener to a static element, give the element an appropriate role value.
(lint/a11y/noStaticElementInteractions)
[error] 122-122: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event.
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
(lint/a11y/useKeyWithClickEvents)
🔇 Additional comments (13)
src/components/todos/create-todo-button.tsx (1)
4-4: LGTM!The migration from
CreateEditTodoDialogtoTodoDialogis a clean drop-in replacement with no functional changes.Also applies to: 50-75
src/components/todos/view-todo-modal.tsx (2)
43-49: LGTM!The label fetching logic with
useQueryand filtering is implemented correctly, with appropriatestaleTimecaching.
53-92: LGTM!The read-only field display is well-structured with proper fallbacks and formatting. The use of the internal
ViewFieldcomponent provides good consistency.src/components/todos/todo-dialog.tsx (2)
12-37: LGTM!Excellent use of discriminated union types to ensure type safety across different dialog modes.
52-70: LGTM!The mode transition logic correctly handles switching between view and edit modes, with proper cleanup when the dialog closes.
src/components/todos/edit-task-button.tsx (2)
19-28: LGTM!The refactor to use
useUpdateTaskhook properly centralizes the update logic and cleanly handles dialog closure on success.
31-52: LGTM!The migration to
TodoDialogis clean with all props correctly wired, including mutation pending state.src/hooks/useUpdateTask.ts (2)
17-42: LGTM!The mutation setup includes comprehensive query invalidations covering all relevant cache keys (getTasks, watchlist, deferred, team-scoped) with proper success/error handling.
44-61: LGTM!The
handleSubmissionimplementation correctly:
- Detects changes using
TodoUtil.getUpdateTodoDetails- Only mutates when there are actual changes (optimization)
- Properly chains the custom
onSuccesscallbacksrc/modules/teams/team-tasks.tsx (2)
37-49: LGTM!The integration of
useUpdateTaskand modal state management correctly handles the view/edit mode transitions with proper callback chaining.
51-93: LGTM!The TodoDialog wrapping pattern correctly makes the entire row clickable to open the view modal, while
stopPropagationon the actions cell prevents unintended dialog opening when interacting with action buttons.src/components/todos/todo-list-table.tsx (2)
65-76: LGTM!The modal state and update flow integration mirrors the team-tasks implementation and correctly handles mode transitions.
78-131: LGTM with accessibility concern noted below.The TodoDialog wrapping pattern correctly implements the clickable row behavior.
…support in createEditTodoForm
- update filename from create-todo-form to todo-form
Date: 28 Dec 2025
Developer Name: @Hariom01010
Issue Ticket Number
Closes #230
Description
This PR adds support for a view task modal which shows a task's detail in read-only mode with close button both on user and team dashboard.
If a user has edit access for the task, the modal is opened in edit mode
If a user doesn't have edit acesss for the task, the modal is opened in view mode.
The update task mutation has been moved to a separate hook.
This will allow user to see essentials details for any task like
Title,Description,Assignee,Status,Priority,LabelsandDue DateDocumentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
proof.of.working.mp4
Test Coverage
Screenshot 1
Additional Notes