feat: fetch and display tasks from the API - #31
Conversation
First real codegen run against the introspected schema. DateTime is mapped to string so dueDate types honestly instead of unknown. Generated
graphql-request v7 constructs new URL(endpoint) without a base, so the relative '/graphql' threw TypeError: Invalid URL synchronously — no request ever reached the network. Resolving against window.location.origin keeps the same-origin proxy design in dev, preview, and any future deploy.
… empty states TasksView owns the four query states: skeleton board while pending, role=alert with retry on failure, empty state, and the board grouped by the Status enum onto the five required columns, position-sorted. task-display.ts translates schema values (point enums, tags, due dates) into the design's vocabulary. Tests mock the transport seam with API-shaped fixtures; the three state tests pin the three requirement bullets. Sample data retired.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe task pages now fetch tasks through GraphQL and React Query. They render loading, error with retry, empty, and grouped board states. Task cards use API data and shared formatting helpers. Tests cover fetched content and query states. ChangesAPI-driven task board
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TaskPage
participant TasksView
participant useTasks
participant GraphQLAPI
participant TaskBoard
TaskPage->>TasksView: render task view
TasksView->>useTasks: request tasks
useTasks->>GraphQLAPI: fetch TasksDocument
GraphQLAPI-->>useTasks: return tasks or error
useTasks-->>TasksView: provide query state
TasksView->>TaskBoard: render grouped tasks
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/features/tasks/TaskCard.tsx`:
- Around line 55-60: Remove the hardcoded fork and comment metrics from the task
card, including the corresponding icons or wrappers if they have no remaining
content. Update the JSX in TaskCard so it does not display fabricated values,
rather than adding unsupported fields to ApiTask.
In `@src/test/fixtures.ts`:
- Around line 5-8: Make the relative-date fixture deterministic by updating
daysFromNow and its fixtureTasks callers to use an injected or fixed reference
date instead of the current time at module load. Ensure router tests
consistently use that stable date so the Twitter task’s expected relative-day
value cannot change across midnight.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: ae2d5236-08fb-422e-bc8c-db3f981e3fb6
⛔ Files ignored due to path filters (4)
src/graphql/generated/fragment-masking.tsis excluded by!**/generated/**src/graphql/generated/gql.tsis excluded by!**/generated/**src/graphql/generated/graphql.tsis excluded by!**/generated/**src/graphql/generated/index.tsis excluded by!**/generated/**
📒 Files selected for processing (14)
README.mdcodegen.tssrc/app/router.test.tsxsrc/features/tasks/Dashboard.tsxsrc/features/tasks/MyTask.tsxsrc/features/tasks/TaskCard.tsxsrc/features/tasks/TasksView.tsxsrc/features/tasks/queries.tssrc/features/tasks/sample-tasks.tssrc/features/tasks/task-display.tssrc/features/tasks/types.tssrc/features/tasks/useTasks.tssrc/lib/graphql-client.tssrc/test/fixtures.ts
💤 Files with no reviewable changes (1)
- src/features/tasks/sample-tasks.ts
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Phase 3 (Get): tasks query with generated types, five status columns fed by real data, loading/error/empty
states. All 20 tests green; verified live against the API through the dev proxy.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation