fix(composer): restore project group reset effect

Revert read-side mask back to the merge-base state clear so a momentarily
unavailable host permanently drops the folder group instead of silently
retargeting Create when the host reappears.
This commit is contained in:
Neil
2026-08-24 19:29:51 -07:00
parent 29120ee4c3
commit bc12e01fd9
@@ -131,11 +131,15 @@ export function useComposerInitialTargetState(input: ComposerInitialTargetStateI
[actionableHostIds, projectGroups, selectedProjectGroupId]
)
const effectiveSelectedProjectGroupId = selectedProjectGroup ? selectedProjectGroupId : null
useEffect(() => {
if (selectedProjectGroupId && !selectedProjectGroup) {
setSelectedProjectGroupId(null)
}
}, [selectedProjectGroup, selectedProjectGroupId])
useEffect(() => {
if (
effectiveSelectedProjectGroupId ||
selectedProjectGroupId ||
!initialFolderProjectGroupId ||
initialProjectGroupAppliedRef.current
) {
@@ -150,12 +154,7 @@ export function useComposerInitialTargetState(input: ComposerInitialTargetStateI
initialProjectGroupAppliedRef.current = true
setSelectedProjectGroupId(nextGroup.id)
}
}, [
actionableHostIds,
effectiveSelectedProjectGroupId,
initialFolderProjectGroupId,
projectGroups
])
}, [actionableHostIds, initialFolderProjectGroupId, projectGroups, selectedProjectGroupId])
return {
draftRepoId,
@@ -173,7 +172,7 @@ export function useComposerInitialTargetState(input: ComposerInitialTargetStateI
setSelectedProjectHostSetupOverrideId,
initialFolderProjectGroupId,
initialFolderProjectGroup,
selectedProjectGroupId: effectiveSelectedProjectGroupId,
selectedProjectGroupId,
setSelectedProjectGroupId,
initialProjectGroupAppliedRef,
projectError,