refactor(profiles): drop manual snapshot update now that switching autosaves

Since switching projects automatically saves the current configuration
back to the project being left, the per-project "update from current"
button is redundant and even harmful: it allowed overwriting another
project's snapshot with the current state, breaking the invariant that
a project holds the state you last left it in.

- Remove the resnapshot button and confirm dialog from the manage
  dialog; drop the now-unused scope prop and PROFILE_SCOPE_LABELS
- Add a footer Close button to the manage dialog (overlay click is
  disabled app-wide, so it previously could only be closed via Esc)
- Update manageDescription in all four locales to describe the
  autosave behavior; remove the two dead i18n keys
- Fix a shadowed `warnings` vec in ProfileService::apply that silently
  dropped autosave-failure warnings before they reached the frontend
- Mention auto-capture on next switch in the "no snapshot for this
  scope yet" warning and doc comments

The backend update command keeps its resnapshot parameter; it is now
only exercised by the pre-switch autosave path.
This commit is contained in:
Jason
2026-07-04 23:50:25 +08:00
parent 22159430c6
commit 9f7642e29c
9 changed files with 29 additions and 73 deletions
+1 -6
View File
@@ -184,12 +184,7 @@ pub fn apply_profile(
log::warn!("切换项目后停止代理服务失败: {e}");
}
if let Some(app_state) = app_handle.try_state::<AppState>() {
emit_profile_apply_events(
&app_handle,
app_state.inner(),
&profile_id,
scope,
);
emit_profile_apply_events(&app_handle, app_state.inner(), &profile_id, scope);
}
});
} else {