Skip to content

fix(kanban): use task query data for board cards#1452

Merged
arnestrickmann merged 2 commits intogeneralaction:mainfrom
jschwxrz:emdash/fix-kanban-shows-no-task-484
Mar 13, 2026
Merged

fix(kanban): use task query data for board cards#1452
arnestrickmann merged 2 commits intogeneralaction:mainfrom
jschwxrz:emdash/fix-kanban-shows-no-task-484

Conversation

@jschwxrz
Copy link
Collaborator

@jschwxrz jschwxrz commented Mar 13, 2026

summary:

  • kanban was reading from selectedProject.tasks, but that array is no longer populated in the current data flow
  • tasks are now loaded into tasksByProjectId[projectId]

fix:

  • kanban now uses the canonical task source (tasksByProjectId)
  • updated kanban internals to iterate over the passed in tasks list consistently

fixes #1443

@vercel
Copy link

vercel bot commented Mar 13, 2026

@jschwxrz is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 13, 2026

Greptile Summary

This PR fixes a data-flow regression where KanbanBoard was reading tasks from project.tasks — an array no longer populated in the current architecture — causing the board to render with no cards. Tasks are now sourced from tasksByProjectId in the task management context and passed down explicitly as a required tasks prop.

Key changes:

  • MainContentArea now pulls tasksByProjectId from useTaskManagementContext() and forwards tasksByProjectId[selectedProject.id] ?? [] to KanbanBoard.
  • KanbanBoard accepts a new required tasks: Task[] prop; all four useEffect dependency arrays have been updated from project.tasks?.length to a taskSignature string (task IDs joined with commas), which is a more precise change-detection signal.
  • All in-effect const wsList = project.tasks || [] declarations are removed and replaced with a single component-level useMemo.
  • Style note: The taskSignature is derived by joining IDs with a comma. Task IDs are UUIDs in this codebase so the collision risk is negligible, but using a non-UUID delimiter (e.g. |) would be safer. The ?? [] on the non-optional tasks prop is also a no-op and could be removed for clarity.

Confidence Score: 4/5

  • Safe to merge — the fix correctly addresses the empty-board regression with no breaking changes.
  • The logic is straightforward: tasks is sourced from the canonical query cache and passed explicitly, replacing the stale project.tasks field. All four effect dependency arrays have been updated consistently. The taskSignature proxy is a valid pattern and correctly re-triggers subscriptions when the task set changes. Two minor style issues (redundant ?? [] and comma-delimited signature) have no impact on correctness.
  • No files require special attention.

Important Files Changed

Filename Overview
src/renderer/components/kanban/KanbanBoard.tsx Refactored to accept an explicit tasks: Task[] prop instead of reading from project.tasks. Four useEffect dependency arrays updated from project.tasks?.length to a computed taskSignature string (task IDs joined), which is a more precise dependency. Minor style concerns: redundant ?? [] on a non-nullable prop, and a comma-joined ID signature that could theoretically collide.
src/renderer/components/MainContentArea.tsx Correctly threads tasksByProjectId[selectedProject.id] ?? [] from the task management context into KanbanBoard as the new required tasks prop; no logic issues.

Sequence Diagram

sequenceDiagram
    participant TM as TaskManagementContext
    participant MCA as MainContentArea
    participant KB as KanbanBoard

    TM->>TM: useQueries → taskResults per project
    TM->>TM: useMemo → tasksByProjectId[projectId]
    TM-->>MCA: tasksByProjectId (via context)
    MCA->>MCA: tasksByProjectId[selectedProject.id] ?? []
    MCA->>KB: tasks={Task[]} (required prop)
    KB->>KB: useMemo wsList = tasks
    KB->>KB: useMemo taskSignature = IDs joined
    KB->>KB: useEffect([project.id, taskSignature]) → subscribe PTY/activity
    KB->>KB: useEffect([project.id, taskSignature]) → poll git status
    KB->>KB: useEffect([project.id, taskSignature]) → poll PR status
    KB->>KB: useEffect([project.id, taskSignature]) → poll branch ahead
    KB->>KB: render columns from wsList + statusMap
Loading

Last reviewed commit: ff124be

@arnestrickmann arnestrickmann merged commit eb71b4b into generalaction:main Mar 13, 2026
2 of 3 checks passed
@jschwxrz jschwxrz deleted the emdash/fix-kanban-shows-no-task-484 branch March 13, 2026 18:21
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.

[bug]: Kanban view shows no task

2 participants