feat(channels): pick or create a channel's project from its Tasks tab

Merged
SA
9h ago
+17402-28

Summary

Stacked on #9238. The channel's Tasks tab gets the same ProjectPicker used on tasks and cloud workspaces: pick one of the organization's projects, create one in NewProjectDialog (it is linked as soon as it's made), or set none. The list is that project's tasks, and "Add task" creates into it.

  • New procedures: channelTask.project (the channel's project or null) and channelTask.setProject (members who can post; the project must be in the channel's organization). Additions only.
  • 0184 drops channel_tasks. Nothing reads or writes it since #9238, so this must deploy after it.

Migration safety

channel_tasks is 40 kB and only had #roster's 7 rows, which #9238 moved. DROP TABLE ... CASCADE drops its FKs to tasks and channels, so it briefly locks both.

Verification

Ran a desktop dev app from this branch with its own API and realtime against a Neon branch of production with all three migrations applied, signed in as the local dev admin added to the Paradev org on that branch:

  • #roster's Tasks tab shows the "Roster" project and its 7 tasks.
  • The picker lists the org's projects; switching to "Tasks, Projects, and more" shows its (empty) list and the DB row follows.
  • "Create project…" opens the new-project dialog; creating "Channel picker test" links it to the channel.
  • Switching back to Roster shows the 7 tasks again.
  • Not exercised in the UI: "Add task" (same CreateTaskDialog + channelTask.add path, checked against the router in #9238).
  • packages/trpc tests pass; desktop and trpc typecheck; check:i18n has nothing missing.

Summary by cubic

The channel's Tasks tab now uses the same ProjectPicker as tasks and cloud workspaces: members who can post can pick one of the organization's projects, create a new one (linked immediately), or set none. The tab shows that project's tasks, and "Add task" creates into it.

  • Adds channelTask.project and channelTask.setProject procedures; setProject requires a project in the channel's organization and posting permission.
  • Migration 0184 drops the channel_tasks table, which nothing reads or writes since the stacked change; deploy it after #9238.

Summary by CodeRabbit

  • New Features
    • Channels can now be associated with a project, or have their project assignment cleared.
    • Users who can add tasks can select an existing project or create a new one directly from the channel’s task area. Newly created projects are assigned to the channel automatically.
    • Project creation includes organization members and defaults the project lead to the current user.