Keep new worktrees clean when setup changes are uncommitted (#3311)

* fix(worktrees): preserve selected base config

New worktrees were overwriting the selected ref's paseo.json with source-checkout bytes, which could create an accidental revert in an otherwise fresh workspace. Keep committed base config authoritative and warn when locally saved setup changes still need to be committed.

* fix(worktrees): seed config exclusively

* fix(projects): refresh config status on focus
This commit is contained in:
Mohamed Boudra
2026-08-13 12:02:15 +02:00
committed by GitHub
parent 9a7301d9a0
commit c190fed27c
23 changed files with 460 additions and 55 deletions
@@ -9,12 +9,14 @@ import {
clickReloadProjectSettings,
clickRetryProjectSettingsSave,
clickSaveProjectSettings,
commitPaseoConfig,
corruptPaseoConfig,
editWorktreeSetup,
expectEmptyScriptList,
expectProjectHostContextHidden,
expectNoEditableTarget,
expectNoProjectSettingsError,
expectNoUncommittedSetupWarning,
expectProjectEditFailed,
expectProjectEditName,
expectProjectEditSaved,
@@ -27,6 +29,7 @@ import {
expectSaveButtonDisabled,
expectScriptRowCount,
expectWriteFailedCalloutActions,
expectUncommittedSetupWarning,
fillProjectIconUrl,
fillProjectName,
installDaemonConnectionGate,
@@ -216,9 +219,16 @@ test.describe("Projects settings", () => {
test("user edits worktree setup from the projects page", async ({ page, editableProject }) => {
await openProjects(page);
await openProjectSettings(page, editableProject.name);
await expectNoUncommittedSetupWarning(page);
await editWorktreeSetup(page, updatedSetup);
await clickSaveProjectSettings(page);
await expectProjectConfigSaved(editableProject);
await expectUncommittedSetupWarning(page);
commitPaseoConfig(editableProject.path);
await returnToProjectsList(page);
await openProjectSettings(page, editableProject.name);
await expectNoUncommittedSetupWarning(page);
});
test("project navigation stays inside the selected host", async ({ page, editableProject }) => {
@@ -439,5 +449,7 @@ test.describe("Projects settings — error UX", () => {
await expectScriptRowCount(page, 0);
await expectEmptyScriptList(page);
await clickSaveProjectSettings(page);
await expectNoUncommittedSetupWarning(page);
});
});