You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Canvas activation can be remembered for the wrong folder location after overlapping or failed switches #350169
Switching Folder Location should remember whether a canvas was the active tab independently for each location. Returning to a location should restore its previous selection, even if another location switch was requested while editors were still being restored or a restore attempt failed.
The ordinary round trip is addressed by #350127. Two edge cases remain where a canvas's activation state can be recorded against the wrong location, causing a canvas to return as a background tab when it should be active, or vice versa.
Sequences to cover
Another location change while restoration is pending: Start at location A with a canvas open. Switch to B, then request C before B's editor working set finishes applying. The canvas service can treat C as the editor area's owner while the editor area still belongs to B. The next switch can then save the canvas's active state under the wrong location.
Restore fails before closing the canvas: Start at A and switch to B when B's stored editor working set cannot be applied, for example because its saved working-set state is missing. The first apply fails without closing the canvas. The fallback that empties the editor area can then record A's canvas activation as B's, overwriting B's previously remembered state.
Proposed fix
Use one source of truth for the location whose editors are being shown. FolderLocationWorkingSets already captures the location being left and the target being entered, and advances its owner only after applying a working set succeeds. Expose that switch context through a shared contract consumed by the canvas service, rather than having the canvas service infer ownership from the current workspace folder and generic working-set completion events.
Add regression tests for both sequences, including a return to a location whose remembered canvas activation differs from the outgoing location. Preserve the existing ordinary round-trip and hidden-chat behavior.
changed the title [-]Canvas can come back with the wrong active state when Folder Location changes during or after a failed editor swap[/-][+]Canvas activation can be remembered for the wrong folder location after overlapping or failed switches[/+]on Nov 24, 2026
Related: Quick Open's recently opened list (#349761, #350128) also needs to know a folder's locations and which one is current, and today it works that out on its own and refreshes when the locations load or change. When the shared source proposed here exists, Quick Open should read the folder's locations from it too, so both features agree on where the folder is during and after a switch.
One more case for this follow-up: when applying a location's working set fails, the canvas is reopened and the editor area is then emptied as a fallback. If that reopen finishes before the fallback apply starts, the canvas comes back as a background tab instead of the active one. It needs an editor to open between the two applies, on a failure path only. Telling this apart from source control working sets needs the same source/target capture described above.
Activity
[-]Canvas can come back with the wrong active state when Folder Location changes during or after a failed editor swap[/-][+]Canvas activation can be remembered for the wrong folder location after overlapping or failed switches[/+]sandy081 commentedon Nov 24, 2026
Related: Quick Open's recently opened list (#349761, #350128) also needs to know a folder's locations and which one is current, and today it works that out on its own and refreshes when the locations load or change. When the shared source proposed here exists, Quick Open should read the folder's locations from it too, so both features agree on where the folder is during and after a switch.
Written by GitHub Copilot on behalf of Sandeep Somavarapu (@sandy081)
sandy081 commentedon Nov 24, 2026
One more case for this follow-up: when applying a location's working set fails, the canvas is reopened and the editor area is then emptied as a fallback. If that reopen finishes before the fallback apply starts, the canvas comes back as a background tab instead of the active one. It needs an editor to open between the two applies, on a failure path only. Telling this apart from source control working sets needs the same source/target capture described above.
Written by GitHub Copilot on behalf of Sandeep Somavarapu (@sandy081)