Repository navigation
Description
Problem
Opening an existing draft in Planner Studio (Define stage) clears the draft's base branch and saves the cleared value back:
PUT /api/planner/drafts/<id> {"context_config":{"baseBranch":"", …}}
After that, Generate Plan, Export Context and Refresh context now stay disabled because the draft has no base branch.
Cause
In propr-ui/src/components/TaskPlanner/SetupWizard.tsx (useSetupWizardLoaders):
const repoLoader = useRepositoryLoader(true, initialRepository ?? undefined, initialBaseBranch ?? undefined);
const newModeBranches = useBranchesLoader(isNewMode ? repoLoader.selectedRepo : '', repoLoader.selectedBaseBranch, setConfig);
const repoInfo = useRepoInfoLoader(isNewMode, draft, setConfig);useRepositoryLoader(true, …)loads the repository catalog even when an existing draft is being edited.- When the catalog arrives, it sets
selectedBaseBranchfrom the catalog entry'sbaseBranch. - That changes the dependencies of
useBranchesLoader('', …), so its effect re-runs. In edit mode the repository is'', anduseResolvedBaseBranchdefaults toclearOnMissingRepository: true, so it callsclearResolvedBaseBranch(setConfig). useRepoInfoLoader's dependencies did not change, so it doesn't re-run, and nothing restores the draft's branch.- Draft persistence then saves
baseBranch: "".
On first mount the order happens to be harmless: clear, then the draft's branch is set. The bug appears only when the catalog loads afterwards, which a real server's catalog (InstanceCatalogRepository.baseBranch) triggers.
Reproduction
Found while rendering Planner Studio against mocked API responses for the site screenshots:
- Open a draft whose
context_config.baseBranchismain. - The repository catalog includes
baseBranchfor its repositories. - Within the save debounce, the UI sends the
PUTabove, and Generate Plan is disabled.
It hasn't been confirmed on a live instance yet.
Suggested fix
Keep the new-mode branch resolver out of edit mode. For example:
- pass
shouldResolve: isNewModetouseBranchesLoader, or - set
clearOnMissingRepository: falsethere, or - only run
useRepositoryLoaderin new mode.
Add a regression test: an existing draft with baseBranch: 'main', with the catalog resolving after mount, keeps baseBranch and sends no clearing PUT.
🤖 Generated with Claude Code
Activity
propr-dev commentedon Oct 10, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-52932/claude-opus-5-5-planner-studio-opening-an-20261010-2100-enhmainissue-2932-20261010-2100-claude-opus-5-5-enh🔍 Track Task Execution