Skip to content

feat(tasks): add channel selector to new-task composer#3689

Draft
puemos wants to merge 6 commits into
mainfrom
posthog-code/channel-selector-new-task
Draft

feat(tasks): add channel selector to new-task composer#3689
puemos wants to merge 6 commits into
mainfrom
posthog-code/channel-selector-new-task

Conversation

@puemos

@puemos puemos commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

When starting a new task, you could only target a repository. There was no way to pick a channel to work in from the main composer — channel tasks only existed on the separate per-channel screen.

Why: let people kick off a channel task (repo-less, owned by the channel's feed) straight from the new-task screen, the same way they pick a repo today.

Changes

  • New ChannelPicker pill sitting next to the repo picker, gated by the project-bluebird flag (mirrors the existing WorkspaceModeSelect pill).
  • Selecting a channel runs the task repo-less, attaches the channel's CONTEXT.md, and owns it in the channel's backend feed. The repo + branch pickers grey out (visible but disabled); No channel restores the normal repo flow.
  • The personal #me channel is omitted from the list (new tasks already default to it), and the picker is hidden on screens already bound to a fixed channel (the per-channel New task view is unaffected).

How did you test this?

  • pnpm --filter @posthog/ui typecheck — passes.
  • Biome lint/format on the changed files — clean.
  • New ChannelPicker.test.tsx (5 tests: label rendering, sentinel↔null mapping, emitted channel id, parent-filtered list) — passes via vitest run.
  • Did not manually drive the Electron app.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Adds a channel-picker pill next to the repo picker on the new-task
composer. Selecting a channel makes the task run repo-less (owned by the
channel's backend feed, with its CONTEXT.md attached) and greys out the
repo/branch pickers; "No channel" restores the normal repo flow. Gated by
the project-bluebird flag and hidden on screens already bound to a fixed
channel.

- New ChannelPicker presentational pill (mirrors WorkspaceModeSelect).
- TaskInput derives effective channel context/name/id + backend feed id
  from the picked channel, collapses worktree→local (repo-less), and
  disables the repo cluster.

Generated-By: PostHog Code
Task-Id: 33a1c8b2-6345-4dac-b733-b9e22c53e3d7
@trunk-io

trunk-io Bot commented Jul 22, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

React Doctor found 4 issues in 1 file · 4 warnings.

4 warnings

src/features/task-detail/components/TaskInput.tsx

Reviewed by React Doctor for commit 1f8af10.

react-doctor flagged the channel-selection effects (no-adjust-state-on-prop-change). Replace both with the render-time pattern the file already uses for prevEffectiveRepoPath:

- Clear a selected channel that no longer exists with a self-terminating inline guard instead of a useEffect.
- Reset the CONTEXT.md dismissal via a prev-value comparison during render instead of a useRef + useEffect.

No behavior change; removes the extra stale-UI commit.

Generated-By: PostHog Code
Task-Id: 33a1c8b2-6345-4dac-b733-b9e22c53e3d7
@posthog

posthog Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

puemos added 4 commits July 23, 2026 18:54
- Rebuild ChannelPicker on the shared Combobox (same primitive as the repo picker) so opening it reveals a search field you can type into to filter a long channel list.
- Replace the "No channel" default with the personal "me" channel: the pill now reads "me" by default and selecting it maps to the repo flow (task owned by the #me feed), matching what happened under the hood anyway.

Test updated for the combobox interaction (me default, list contents, id/null mapping).

Generated-By: PostHog Code
Task-Id: 33a1c8b2-6345-4dac-b733-b9e22c53e3d7
Float starred channels to the top of the picker (right after the default "me"), then the remaining channels — mirroring the sidebar's me → starred → channels order, but as one flat list with no section headings. Ordering is computed in the composer from the shared channel-stars query; the picker preserves whatever order it's given.

Generated-By: PostHog Code
Task-Id: 33a1c8b2-6345-4dac-b733-b9e22c53e3d7
Selecting "me" now targets the personal channel as a real repo-less channel task (like any other channel), instead of being the repo-flow default. That default is now a distinct "No channel" option (null → normal repo flow with the repo/branch pickers active).

Order is No channel → me → starred → the rest, one flat list. The picker is name-based so "me" is always pickable even before its folder is provisioned; the parent resolves the folder (for CONTEXT.md) and backend feed by name.

Generated-By: PostHog Code
Task-Id: 33a1c8b2-6345-4dac-b733-b9e22c53e3d7
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.

1 participant