settings ui: Update file headers when adding or removing projects (#40968)

This PR gets the `SettingsWindow` struct to subscribe to all
`Entity<Project>` events and any future project entities that are
created. When a project emits an event that signals a worktree has been
added or removed, the settings window refetches all settings files it
can find.

This fixes a bug where the settings ui would notice some project
settings that were created or opened after the `SettingsWindow` has been
initialized.

I also renamed `LOCAL` file mask to `PROJECT` to be inline with the
`SettingsFile` naming convention.

Release Notes:

- settings ui: Fix bug where project setting files wouldn't be detected
if they were created or opened after while an active settings window is
open
This commit is contained in:
Anthony Eid
2025-10-23 00:49:36 -04:00
committed by GitHub
parent 8f4646d6c3
commit 1edb1b3896
3 changed files with 186 additions and 149 deletions
+1 -1
View File
@@ -1458,7 +1458,7 @@ impl Workspace {
}),
cx.on_release(move |this, cx| {
this.app_state.workspace_store.update(cx, move |store, _| {
store.workspaces.remove(&window_handle.clone());
store.workspaces.remove(&window_handle);
})
}),
];