fix(task-input): respect folderId when pre-selecting directory#2178
Closed
oliverb123 wants to merge 2 commits into
Closed
fix(task-input): respect folderId when pre-selecting directory#2178oliverb123 wants to merge 2 commits into
oliverb123 wants to merge 2 commits into
Conversation
Clicking the "+" beside a project in the sidebar passes that project's folderId to the new-task view, but the directory fallback effect would race with the folderId effect and pre-fill the most-recently-accessed repo instead. Skip the fallback when an explicit folderId is present so the folder lookup is the sole source of truth. Generated-By: PostHog Code Task-Id: 70c8762e-5b7b-4699-96fd-ce73f379ee2b
Contributor
|
Reviews (1): Last reviewed commit: "fix(task-input): respect folderId when p..." | Re-trigger Greptile |
In cloud workspace mode the visible repo is driven by `selectedRepository` (derived to `selectedCloudRepository`), which was initialized from `lastUsedCloudRepository` and never reacted to `view.folderId`. Extend the folderId effect to also set the cloud repo from `folder.remoteUrl` (using `normalizeRepoKey`) and persist it via `setLastUsedCloudRepository`, so the cloud picker shows the project the user actually clicked. `workspaceMode` is intentionally left untouched — both modes now reflect the clicked project; the user's mode preference is preserved. Generated-By: PostHog Code Task-Id: 70c8762e-5b7b-4699-96fd-ce73f379ee2b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
folderIdto the new-task view, but the directory was still being pre-filled with the most-recently-accessed repo.TaskInputraced to initializeselectedDirectory: a fallback tomostRecentRepo.pathand a lookup driven byview.folderId. Whenfoldershadn't loaded yet on first render, the fallback fired first and the folderId lookup never overrode it.view.folderIdis set so the folder lookup is the sole source of truth in that case. Behavior is unchanged when no folder context is provided.Test plan