Skip to content

fix(sidebar): preselect cloud repository when creating task from repo group#2846

Open
rafaeelaudibert wants to merge 1 commit into
mainfrom
posthog-code/preselect-cloud-repo-new-task
Open

fix(sidebar): preselect cloud repository when creating task from repo group#2846
rafaeelaudibert wants to merge 1 commit into
mainfrom
posthog-code/preselect-cloud-repo-new-task

Conversation

@rafaeelaudibert

Copy link
Copy Markdown
Member

Summary

In the tasks sidebar (grouped by repository), clicking the + to the right of a repository name to create a new task did not preselect that repository in the main view when running in cloud mode — it opened a blank task input.

Root cause

onNewTask only handled the local-folder case via groupFolderId. Cloud-only repository groups have no registered local folder and their tasks carry no folderId, so groupFolderId was undefined and the handler fell through to openTaskInput() with no arguments, selecting nothing.

Fix

Detect cloud repository groups via their parsed repository (which carries an organization and a normalized owner/repo fullPath) and route them through the existing initialCloudRepository prefill path. That path already switches workspaceMode to "cloud" and calls setSelectedRepository(...), so the correct repo is now preselected. Local-folder groups take precedence and are unchanged; the empty fallback only remains for the genuinely-unidentifiable "Other" bucket.

🤖 Generated with Claude Code

… group

Clicking "+" next to a repository name in the tasks sidebar opened a blank
task input for cloud-only repository groups instead of preselecting that
repo. These groups have no registered local folder, so `groupFolderId` was
undefined and the handler fell through to `openTaskInput()` with no args.

Detect cloud repository groups via their parsed `repository` (which carries
an organization) and route them through the existing `initialCloudRepository`
prefill path, which switches the main view to cloud mode and preselects the
repo. Local-folder groups are unchanged.

Generated-By: PostHog Code
Task-Id: af3359b8-79a7-4752-965a-42c47d6b5b33
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 85e3cc2.

@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(sidebar): preselect cloud repository..." | Re-trigger Greptile

1 similar comment
@greptile-apps

greptile-apps Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(sidebar): preselect cloud repository..." | Re-trigger Greptile

@rafaeelaudibert rafaeelaudibert requested a review from a team June 23, 2026 03:48
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