Skip to content

chore(tasks): update task UI#37

Open
Rishavraaj wants to merge 13 commits intomainfrom
chore/update-task-ui
Open

chore(tasks): update task UI#37
Rishavraaj wants to merge 13 commits intomainfrom
chore/update-task-ui

Conversation

@Rishavraaj
Copy link
Contributor

@Rishavraaj Rishavraaj commented Mar 13, 2026

Summary

  • Task UI overhaul — updated the tasks table with new columns (ID with copy-to-clipboard, Subtasks count, Created By), replaced the Created At column with Completed At,
    and improved status/assignee inline editing
  • Task owner tracking — added task_owner table to record who created a task; on creation the authenticated user is automatically saved as the primary owner via a DB
    transaction
  • Removed created_by text field — owner identity is now properly tracked through the task_owner relation instead of a free-text column
  • Pagination fix — tasks list now fetches up to 100 tasks in one request and delegates pagination to the client-side table, fixing subtask row count mismatch
  • ResizeObserver mock — added to test setup to unblock frontend tests in jsdom

Changes by area

Backend

  • Added TaskOwner model in core.prisma (mirrors ContactOwner/CompanyOwner/DealOwner pattern) with task_id, user_id, is_primary, assigned_at, unique constraint
    on (task_id, user_id), and cascade deletes
  • TaskRepository.create() runs in a $transaction — creates the task then inserts a task_owner row with is_primary = true
  • All task queries now include owners with user id, name, email
  • Dropped created_by column from the task table

Frontend

  • New IdCell component — shows task ID, copies to clipboard on click with "Copied" feedback
  • New Subtasks column — shows badge with count for parent tasks, for subtasks/empty
  • Created By column replaces Created At
  • BaseTable now manages internal pagination state when none is provided externally
  • autoResetPageIndex: false added to prevent table jumping on data updates
  • Removed SidebarDivider entries from the app layout

Tests

  • Unit tests for all createTaskColumns cell renderers (ID, Title, Subtasks, Status, Assignee, Created By, Completed At, Actions)
  • Controller spec updated to pass req argument to create

Test plan

  • Create a task — verify a task_owner row is created with is_primary = true for the logged-in user
  • Task list shows ID, Subtasks, Created By, Completed At columns correctly
  • Click a task ID — verify it copies to clipboard and shows "Copied" feedback
  • Inline status change to DONE sets completedAt; changing away clears it
  • Inline assignee edit saves on blur and Enter, reverts on Escape
  • Delete a task — verify task_owner is cascade deleted
  • Pagination works correctly across multiple pages of tasks

@Rishavraaj Rishavraaj changed the title feat(tasks): update task UI, add created_by field, and fix pagination feat(tasks): update task UI Mar 13, 2026
@Rishavraaj Rishavraaj changed the title feat(tasks): update task UI chore(tasks): update task UI Mar 13, 2026
@Rishavraaj Rishavraaj self-assigned this Mar 13, 2026
@Rishavraaj Rishavraaj force-pushed the chore/update-task-ui branch from 57dbff7 to 890aad9 Compare March 16, 2026 04:36
Rishavraaj and others added 11 commits March 16, 2026 21:06
- Add createdBy string field to Task model (who created the task)
- Populate createdBy from authenticated user name/email on task creation
- Restructure task list columns: ID (copy to clipboard) | Title | Subtasks
  | Status | Assignee | Created By | Completed At | Actions
- Remove description from title cell; move subtask count to its own column
- Fix BaseTable pagination: add autoResetPageIndex: false to prevent
  TanStack from resetting to page 0 on every render due to new array refs
- BaseTable now owns internal pagination state when none is provided,
  enabling client-side pagination without external state management
- TasksList fetches up to 100 tasks and paginates flat rows (tasks +
  subtasks) client-side at 10 per page

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Pass mock request object to controller.create() calls and update
toHaveBeenCalledWith assertions to include the createdBy field.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Covers all 8 columns (ID, Title, Subtasks, Status, Assignee, Created By,
Completed At, Actions) with 22 new test cases including clipboard copy,
status transitions, inline assignee editing, and action callbacks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…owner

Adds TaskOwner model to track task ownership with isPrimary flag,
mirroring the pattern used by ContactOwner, CompanyOwner, and DealOwner.
On task creation, the authenticated user is recorded as the primary owner
in a transaction. All task queries now include owners with user details.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drops the created_by text column from the task table and removes the
migration that added it. Owner identity is now tracked via task_owner.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tedBy field

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mprove assertions

- Modified tests to check for primary owner instead of the removed createdBy field.
- Updated assertions to use expect.objectContaining for better clarity and maintainability.
- Adjusted test cases to handle scenarios with no primary owner correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rship

- Modified mock request to include user ID for better alignment with ownership logic.
- Updated assertions to check for createdByUserId instead of the removed createdBy field.
- Enhanced test clarity by using expect.objectContaining for assertions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…th in Tasks

- Added React import to BaseTable.tsx for proper JSX handling.
- Updated column width in Tasks component from max-w-96 to max-w-80 for improved layout.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Rishavraaj Rishavraaj force-pushed the chore/update-task-ui branch from e629bf2 to 891196b Compare March 16, 2026 15:42
- Deleted the test case for rendering the parentTitle label for subtasks, as it is no longer applicable.
- Updated the remaining test to ensure it correctly verifies that the parentTitle label is not rendered for top-level tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replaced the button element with a div in the IdCell component to enhance semantic structure while maintaining click functionality.
- Updated styling to ensure consistent user experience.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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