Visual Studio Code, rebuilt in Rust
Rust
feat(update): block the unattended restart while a native dialog shows
rokartur71f926443d22
diff --git a/native/crates/app/src/dialog.rs b/native/crates/app/src/dialog.rsindex 9daab54973c..27d06e9020f 100644--- a/native/crates/app/src/dialog.rs+++ b/native/crates/app/src/dialog.rs@@ -1,7 +1,6 @@//! `nativeHostService.showMessageBox` with a checkbox: Electron's macOS message box is an NSAlert sheet whose//! suppression button carries `checkboxLabel`. GPUI's `Window::prompt` has no suppression button.-#[cfg(target_os = "macos")]use std::cell::Cell;#[cfg(target_os = "macos")]@@ -19,6 +18,31 @@ use objc2_foundation::NSString;#[cfg(target_os = "macos")]use raw_window_handle::{HasWindowHandle, RawWindowHandle};+thread_local! {+ /// dialogMainService.ts's dialog queues: the native message boxes and file panels showing, all on the main thread.+ static OPEN_DIALOGS: Cell<usize> = const { Cell::new(0) };+}++/// A native dialog that `has_open_dialogs` counts until it is dropped.+pub struct OpenDialog(());++impl OpenDialog {+ pub fn new() -> Self {+ OPEN_DIALOGS.set(OPEN_DIALOGS.get() + 1);+ OpenDialog(())+ }+}++impl Drop for OpenDialog {+ fn drop(&mut self) {+ OPEN_DIALOGS.set(OPEN_DIALOGS.get() - 1);+ }+}++/// dialogMainService.ts `hasOpenDialogs`, the unattended restart's `app.dialogOpen`.+pub fn has_open_dialogs() -> bool {+ OPEN_DIALOGS.get() > 0+}/// How a dialog answers while extension tests run (dialogService.ts `skipDialogs`).#[derive(Clone, Copy, PartialEq, Debug)]@@ -78,7 +102,7 @@ pub fn show_message_box_with_checkbox(window: &Window, in_tests: InTests, level:#[cfg(target_os = "macos")]fn begin_alert_sheet(ns_window: &NSWindow, level: PromptLevel, message: &str, detail: Option<&str>, buttons: &[String], checkbox: Option<(String, bool)>, sender: oneshot::Sender<(usize, bool)>) {- let sender = Cell::new(Some(sender));+ let sender = Cell::new(Some((sender, OpenDialog::new())));let mtm = MainThreadMarker::new().expect("dialogs open on the main thread");let alert = NSAlert::new(mtm);// Electron's message_box_mac.mm: warning and error types take the critical style, the caution icon with an app@@ -112,7 +136,7 @@ fn begin_alert_sheet(ns_window: &NSWindow, level: PromptLevel, message: &str, delet checked = suppression.as_ref().is_some_and(|suppression| suppression.state() == NSControlStateValueOn);// A negative response (NSModalResponseAbort) is a sheet closed without a button: cancel.let index = usize::try_from(response).ok().filter(|index| *index < count).unwrap_or(count - 1);- if let Some(sender) = sender.take() {+ if let Some((sender, _open)) = sender.take() {let _ = sender.send((index, checked));}});diff --git a/native/crates/app/src/file_dialog.rs b/native/crates/app/src/file_dialog.rsindex 33c3ab521c1..2f757d83c99 100644--- a/native/crates/app/src/file_dialog.rs+++ b/native/crates/app/src/file_dialog.rs@@ -48,9 +48,11 @@ pub fn show_save_dialog(dialog: FileDialog, cx: &App) -> oneshot::Receiver<Optio/// GPUI's path prompts, which tests answer with `simulate_new_path_selection`; AppKit panels need the main thread.fn gpui_prompt<P: 'static, T: 'static>(picked: oneshot::Receiver<anyhow::Result<Option<P>>>, cx: &App, map: impl FnOnce(Option<P>) -> T + 'static) -> oneshot::Receiver<T> {let (sender, receiver) = oneshot::channel();+ let open = crate::dialog::OpenDialog::new();cx.foreground_executor().spawn(async move {let picked = picked.await.ok().and_then(Result::ok).flatten();+ drop(open);let _ = sender.send(map(picked));}).detach();diff --git a/native/crates/app/src/file_dialog/macos.rs b/native/crates/app/src/file_dialog/macos.rsindex fc6cf0760db..8a0efafbdc0 100644--- a/native/crates/app/src/file_dialog/macos.rs+++ b/native/crates/app/src/file_dialog/macos.rs@@ -70,12 +70,12 @@ fn show<T: 'static>(dialog: &FileDialog, panel: &NSSavePanel, format: Option<Retlet _ = sender.send(refused);return receiver;}- let sender = Cell::new(Some(sender));+ let sender = Cell::new(Some((sender, crate::dialog::OpenDialog::new())));let handler = RcBlock::new(move |response: NSModalResponse| {LOCKS.with_borrow_mut(|locks| locks.remove(&lock));// The Format pop-up's target lives as long as its sheet.let _target = &format;- if let Some(sender) = sender.take() {+ if let Some((sender, _open)) = sender.take() {let _ = sender.send(read(response == NSModalResponseOK));}});diff --git a/native/crates/app/src/workbench/editor_view/merge_editor_view.rs b/native/crates/app/src/workbench/editor_view/merge_editor_view.rsindex bab2ef4b290..25429ed7410 100644--- a/native/crates/app/src/workbench/editor_view/merge_editor_view.rs+++ b/native/crates/app/src/workbench/editor_view/merge_editor_view.rs@@ -132,9 +132,9 @@ impl Workbench {self.commands.register("merge.dev.saveContentsToFolder", |workbench, _, window, cx| {let Some(contents) = workbench.merge_contents() else { return workbench.merge_info("No active merge editor") };let extension = workbench.merge_result().and_then(|result| result.document().path.extension().map(|extension| format!(".{}", extension.to_string_lossy()))).unwrap_or_default();- let picked = cx.prompt_for_paths(gpui::PathPromptOptions { files: false, directories: true, multiple: false, prompt: Some("Select folder to save to".into()) });+ let picked = workbench.show_open_dialog(select_folder_dialog(), cx);cx.spawn_in(window, async move |workbench, cx| {- let Ok(Ok(Some(paths))) = picked.await else { return };+ let Ok(paths) = picked.await else { return };let Some(folder) = paths.first() else { return };let written: std::io::Result<()> = ["base", "input1", "input2", "result", "initialResult"].into_iter().try_for_each(|name| std::fs::write(folder.join(format!("{name}{extension}")), contents[name].as_str().unwrap_or_default()));drop(workbench.update(cx, |workbench, cx| {@@ -148,15 +148,15 @@ impl Workbench {.detach();Outcome::done()});- self.commands.register("merge.dev.loadContentsFromFolder", |_, args, window, cx| {+ self.commands.register("merge.dev.loadContentsFromFolder", |workbench, args, window, cx| {let options = args.first().cloned().unwrap_or(Value::Null);let folder = uri_parts(&options["folderUri"]).ok().map(|(_, path)| path);- let picked = folder.is_none().then(|| cx.prompt_for_paths(gpui::PathPromptOptions { files: false, directories: true, multiple: false, prompt: Some("Select folder to save to".into()) }));+ let picked = folder.is_none().then(|| workbench.show_open_dialog(select_folder_dialog(), cx));cx.spawn_in(window, async move |workbench, cx| {let folder = match (folder, picked) {(Some(folder), _) => folder,(None, Some(picked)) => match picked.await {- Ok(Ok(Some(paths))) if !paths.is_empty() => paths[0].clone(),+ Ok(paths) if !paths.is_empty() => paths[0].clone(),_ => return,},(None, None) => return,@@ -1168,6 +1168,11 @@ impl Workbench {const CLOSE_WITH_CONFLICTS_KEY: &str = "mergeEditorCloseWithConflicts";/// `JSON.stringify(contents, undefined, 4)`.+/// devCommands.ts's folder picker, of both commands.+fn select_folder_dialog() -> crate::file_dialog::FileDialog {+ crate::file_dialog::FileDialog { title: Some("Select folder to save to".into()), folders: true, ..Default::default() }+}+fn pretty_json(value: &Value) -> String {use serde::Serialize;let mut buffer = Vec::new();diff --git a/native/crates/app/src/workbench/profiles_editor_view.rs b/native/crates/app/src/workbench/profiles_editor_view.rsindex 7280788482c..980c2b7acba 100644--- a/native/crates/app/src/workbench/profiles_editor_view.rs+++ b/native/crates/app/src/workbench/profiles_editor_view.rs@@ -7,7 +7,7 @@ use std::cell::Cell;use std::collections::{BTreeSet, HashSet};use std::rc::Rc;-use gpui::{AnyElement, App, Context, FocusHandle, FontWeight, MouseButton, PathPromptOptions, Window, div, prelude::*, px};+use gpui::{AnyElement, App, Context, FocusHandle, FontWeight, MouseButton, Window, div, prelude::*, px};use serde_json::{Value, json};use storage::profiles::{Options, Profile};@@ -16,6 +16,7 @@ use super::icon_select_box::IconTarget;use super::input_box_view::{InputId, InputLook, InputView};use super::keybindings_editor_view::ModalHeader;use crate::commands::Outcome;+use crate::file_dialog::FileDialog;use crate::input_box::InputBox;use crate::main_thread_quick_open::Owner;use crate::menus::MenuAction;@@ -532,9 +533,10 @@ impl Workbench {/// FileUserDataProfileContentHandler: the template saved to a picked `.code-profile` file.fn save_profile_template(&mut self, template: Value, name: String, window: &mut Window, cx: &mut Context<Self>) {let file_name = format!("{}.{PROFILE_EXTENSION}", name.replace('/', "-"));- let picked = cx.prompt_for_new_path(&self.default_file_path(), Some(&file_name));+ let filters = vec![("Profile".to_owned(), vec![PROFILE_EXTENSION.to_owned()])];+ let picked = self.show_save_dialog(FileDialog { title: Some("Save Profile".into()), filters, default_path: Some(self.default_file_path().join(file_name)), ..FileDialog::default() }, cx);cx.spawn_in(window, async move |workbench, cx| {- let Ok(Ok(Some(path))) = picked.await else { return };+ let Ok(Some(path)) = picked.await else { return };let written = std::fs::write(&path, template.to_string());let _ = workbench.update(cx, |workbench, cx| {match written {@@ -602,9 +604,10 @@ impl Workbench {/// `getProfileUriFromFileSystem`: "Select Profile Template File", then the new profile form with its contents.fn import_profile_from_file(&mut self, window: &mut Window, cx: &mut Context<Self>) {- let picked = cx.prompt_for_paths(PathPromptOptions { files: true, directories: false, multiple: false, prompt: Some("Select Profile Template File".into()) });+ let filters = vec![("Profile".to_owned(), vec![PROFILE_EXTENSION.to_owned()])];+ let picked = self.show_open_dialog(FileDialog { title: Some("Select Profile Template File".into()), filters, files: true, ..FileDialog::default() }, cx);cx.spawn_in(window, async move |workbench, cx| {- let Ok(Ok(Some(paths))) = picked.await else { return };+ let Ok(paths) = picked.await else { return };let Some(path) = paths.into_iter().next() else { return };let template = std::fs::read_to_string(&path).map_err(|error| error.to_string()).and_then(|content| profile_template::parse_template(&content));let _ = workbench.update_in(cx, |workbench, window, cx| match template {@@ -1023,9 +1026,9 @@ impl Workbench {/// "Add Folder": the picked folders open in the profile (`setProfileForWorkspace`).fn add_profile_folder(&mut self, profile: Profile, window: &mut Window, cx: &mut Context<Self>) {- let picked = cx.prompt_for_paths(PathPromptOptions { files: false, directories: true, multiple: true, prompt: Some("Add Folder".into()) });+ let picked = self.show_open_dialog(FileDialog { title: Some("Select Folders To Add".into()), button_label: Some("Add Folder".into()), folders: true, multiple: true, ..FileDialog::default() }, cx);cx.spawn_in(window, async move |workbench, cx| {- let Ok(Ok(Some(paths))) = picked.await else { return };+ let Ok(paths) = picked.await else { return };let _ = workbench.update(cx, |workbench, cx| {if workbench.user_data_profiles.state.is_none() {return;diff --git a/native/crates/app/src/workbench/unattended_restart.rs b/native/crates/app/src/workbench/unattended_restart.rsindex 093921f0ffa..62d21b9186b 100644--- a/native/crates/app/src/workbench/unattended_restart.rs+++ b/native/crates/app/src/workbench/unattended_restart.rs@@ -369,6 +369,9 @@ impl UnattendedRestart {if windows.is_empty() {blockers.push(("window.none", None));}+ if crate::dialog::has_open_dialogs() {+ blockers.push(("app.dialogOpen", None));+ }let mut enabled = !windows.is_empty();let mut displays_with_full_screen_window = BTreeSet::new();for handle in windows {@@ -453,7 +456,7 @@ mod tests {}/// The host feeds the lock to the scheduler and runs its first evaluation, which keeps the machine awake while- /// every window could be restored; the unlock lets it sleep again.+ /// every window could be restored and no native dialog shows; the unlock lets it sleep again.#[gpui::test]fn a_locked_screen_keeps_the_machine_awake_until_it_is_unlocked(cx: &mut gpui::TestAppContext) {let (workbench, cx) = workbench(cx);@@ -474,6 +477,20 @@ mod tests {assert!(keeps_awake(cx));host.update(cx, |host, cx| host.power_event("$onDidUnlockScreen", &[], cx));assert!(!keeps_awake(cx));++ // unattendedRestartScheduler.ts `app.dialogOpen`: a file panel showing blocks until it is answered.+ let picked = cx.update(|_, cx| crate::file_dialog::show_save_dialog(crate::file_dialog::FileDialog::default(), cx));+ cx.run_until_parked();+ host.update(cx, |host, cx| host.power_event("$onDidLockScreen", &[], cx));+ cx.run_until_parked();+ assert!(!keeps_awake(cx));+ host.update(cx, |host, cx| host.power_event("$onDidUnlockScreen", &[], cx));+ cx.simulate_new_path_selection(|_| None);+ cx.run_until_parked();+ drop(picked);+ host.update(cx, |host, cx| host.power_event("$onDidLockScreen", &[], cx));+ cx.run_until_parked();+ assert!(keeps_awake(cx));}#[gpui::test]diff --git a/port/ledger.md b/port/ledger.mdindex 5fd62f7d969..972c9b7bda2 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -408,7 +408,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| workbench/services/languageDetection | workbench service | M13 | ported | [3 S] workbench/language_detection.rs: 4 s after typing a Python snippet into a new untitled editor (Cmd+N in a ui-pair run, hc) the port's language entry shows Python, the reference's still Plain Text, also after 12 s; not yet known whether the reference build lacks the detection model or the port detects where upstream does not | language_detection.rs (languageDetectionWebWorker.ts `detectLanguagesImpl`, `adjustLanguageConfidence`, the 10000 char sample) and workbench/language_detection.rs (`LanguageDetectionWorkerClient`: the file name guess first, then @vscode/vscode-languagedetection 1.0.23 with its model in a Bun worker from the app's node_modules, model ids mapped as `getLanguageId`; `autoDetectLanguage` of textEditorModel.ts for untitled models and extensionless plain text files, 600 ms throttle, skipped after an explicit language and with `workbench.editor.languageDetection` off): cargo test -p app language_detection (the worker test runs the real model). The history biases only feed the regexp model, which 1.147.0 does not ship (`vscode-regexp-languagedetection` is not a dependency), so neither side has it; no telemetry || workbench/services/languageStatus | workbench service | M13 | verified | | `$setLanguageStatus` / `$removeLanguageStatus`, statuses matched by selector, ordered by severity, source, id (workbench/language_status.rs): cargo test -p app language_status || workbench/services/layout | workbench service | M11 | ported | [3 S] terminal_view.rs:1235: with Tab Focus Mode on, Tab in the terminal goes to the shell, where terminalInstance.ts:1204 leaves it to the browser's Tab order (port/notes.md Toggle Tab Key Moves Focus) <br> [3 S] action_bar.rs:45: an action bar item focused by Tab shows no hover, where the reference shows the command center's and Customize Layout's tooltips on focus, and the activity bar item's focus outline has square corners where the reference's are rounded (ui-pair Tab steps, port/notes.md Toggle Tab Key Moves Focus) <br> [3 L] workbench.rs:591: the Workbench is one GPUI view, so every scroll frame of any list renders and lays out every part again, where upstream's DOM updates only the scrolled list; the side bar, the editor area, the panel, the status bar, the activity bar and the title bar are cached part views (part_view.rs: a list scroll notifies only the view it was painted in, an editor scroll only the editor area's, a size measured while drawing redraws its view after the frame; the status bar gave no measurable change), the secondary side bar still renders with the Workbench; the Explorer's rows are absolutely placed 22px boxes as listView.ts's (workbench.rs Explorer rows; ~70% of the Explorer frame was the taffy layout of its rows in flow); `scroll_frame_time` median / p95 (two interleaved runs, the Studio shared): Explorer 3.7 / 15.5 and 3.6 / 14.7 ms (rows in flow: 10.9 / 18.6 and 11.0 / 21.4), Editor 8.6 / 24.3 and 8.8 / 26.3 ms, Settings 1.7 / 5.0 and 1.7 / 5.2 ms, Extensions 2.2 / 3.5 and 2.2 / 7.4 ms; each `key_context` caller clones every `config.*` key (keyboard.rs:400), the menubar and the timeline toolbar are rebuilt; the next steps are the Editor's median and every surface's p95 spikes (port/notes.md Scroll frame costs, cheap steps). GUI (Studio at load 33 to 57, 60 Hz display, 690 trackpad events in 7 s): main thread in `Window::draw` 86% scrolling the Explorer (800 files), 89% the Extensions @builtin list (port/notes.md Scroll frame costs) | layout.ts as a split-view tree (workbench/layout.rs): panel position (bottom, top, left, right) and alignment, primary side bar left or right, maximized panel with `panelMaximizationSupportedWhen`, hidden parts, persisted sizes and positions; zen mode (zen_mode.rs) with its settings and restore; centered layout (centered_layout.rs) with its sashes and stored margins; View > Appearance entries and the Panel Position and Align Panel submenus (cargo test -p app -- layout part_grid centered_layout zen_mode); layoutActions.ts Customize Layout quick pick (workbench/customize_layout.rs) with live items, Restore Defaults and Close, Toggle Activity Bar Visibility, Align Quick Input Top/Center (cargo test -p app -- customize_layout toggling_the_activity_bar; ui-pair m11/manage-menu.json, port/results/manage-menu.md; missing until then though the title bar showed its button); ui-pair layout-positions.json and layout-zen.json against the reference (port/results/layout.md). The pairs run with `zenMode.fullScreen` off. Maximize Secondary Side Bar (`workbench.action.maximizeAuxiliaryBar`, `restoreAuxiliaryBar`, `toggleMaximizedAuxiliaryBar`, the title's toggle) hides the other parts and restores them (workbench/panel.rs; cargo test -p app -- maximizing_the_secondary_side_bar_hides_the_other_parts_and_restore_brings_them_back). Zen mode enforces `zenMode.showTabs` on the main editor part until it ends (layout.ts `toggleZenMode` `enforcePartOptions`; workbench/zen_mode.rs `editor_show_tabs`; cargo test -p app -- show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own); navigationActions.ts `workbench.action.focusNextPart`/`focusPreviousPart` (F6, Shift+F6) walk editor, panel, auxiliary bar, status bar, activity bar and side bar past the hidden ones with layout.ts `focusPart` (the pane container's first expanded view; workbench/part_navigation.rs; cargo test -p app f6_walks_the_visible_parts); in an editor window F6 goes between its editor and its own status bar, whose entry focus is kept per window (workbench/auxiliary_windows.rs `auxiliary_status_bar`, workbench/status_entries.rs; cargo test -p app f6_in_an_editor_window_reaches_its_own_status_bar) |-| workbench/services/lifecycle | workbench service | M11 | ported | [3 L] unattendedRestart.ts: the editor detail names the scheme where upstream names `typeId`, `workbench.floatingWindowNotRestorable` cannot occur (the port's auxiliary windows are all editor parts), and the scheduler's `app.dialogOpen` (`hasOpenDialogs`) is not ported: the native open and save panels open from file_dialog.rs, profiles_editor_view.rs and merge_editor_view.rs without a count <br> [3 S] workbench/unattended_restart.rs `window_blockers`: a window keeps only `--profile` and `--profile-temp` of the command line that opened it, so `window.launchArguments` misses its other `SESSION_ARGUMENTS` and `window.launchedFromCli` its `VSCODE_CLI` environment <br> [3 S] terminal/pty.rs:95: `hasChildProcesses` is a foreground process group other than the shell's, so a background job (`cmd &`) does not block the restart where upstream's childProcessMonitor.ts sees it | workbench/lifecycle.rs: ShutdownReason, onBeforeShutdown vetoes on quit, close button, closeWindow, reload and load (`window.confirmBeforeClose`, backup tracker auto save, hot exit, showSaveConfirm); cargo test -p app lifecycle; no phases or onWillShutdown joiners; workbench/unattended_restart.rs: `canRestartUnattended` with its blocker aggregation and change log, and the participants `workbench.starting` (2.5 s after restore), dialog, quick input, transient workspace, modal editor, editors not restored or not restorable, `debug.sessionActive`, `tasks.running`, the backup tracker's `workingCopy.*` and `cli.waitingForEditorClose`, terminalUnattendedRestart.ts, testingUnattendedRestart.ts, `testing.continuousRun`, webviewUnattendedRestart.ts and notebookUnattendedRestart.ts: cargo test -p app unattended_restart (unattendedRestart.test.ts, terminalUnattendedRestart.test.ts, testingUnattendedRestart.test.ts); update/unattended_restart.rs: unattendedRestartScheduler.ts's decisions (keep awake from the lock, restart once locked a minute, retry every minute, veto, a newer update postponing, battery and thermal pressure, resume restarting the clock, the update not installed last time) over injected time: cargo test -p app update::unattended_restart (13 of unattendedRestartScheduler.test.ts's cases, without the telemetry outcomes the port does not send); workbench/unattended_restart.rs `UnattendedRestart`: the scheduler's host on macOS (power events, window blur, update state, timers, the `prevent-app-suspension` blocker, `quitAndInstall` from a window), `getWindowBlockers`, `hasArgumentsLostOnRelaunch`, `app.launchedFromCli` and the failed update remembered across the restart: cargo test -p app unattended_restart (a_locked_screen_keeps_the_machine_awake, windows_that_do_not_come_back_as_they_are_block, launch_arguments_the_relaunch_drops_block, a_restart_that_came_back_on_the_same_commit_failed_to_install); windows_state.rs `setNextExactRestore`/`takeExactRestore` (minimized windows, hidden app): cargo test -p app windows_state; verified: cargo test -p app backup_tracker lifecycle (workingCopyBackupTracker.test.ts); ui-pair hot-exit.json `dirty`, `restored` vs the reference (port/results/windows.md, milestone 11 verification) |+| workbench/services/lifecycle | workbench service | M11 | ported | [3 S] unattendedRestart.ts: the editor detail names the scheme where upstream names `typeId`, and `workbench.floatingWindowNotRestorable` cannot occur (the port's auxiliary windows are all editor parts) <br> [3 S] workbench/unattended_restart.rs `window_blockers`: a window keeps only `--profile` and `--profile-temp` of the command line that opened it, so `window.launchArguments` misses its other `SESSION_ARGUMENTS` and `window.launchedFromCli` its `VSCODE_CLI` environment <br> [3 S] terminal/pty.rs:95: `hasChildProcesses` is a foreground process group other than the shell's, so a background job (`cmd &`) does not block the restart where upstream's childProcessMonitor.ts sees it | workbench/lifecycle.rs: ShutdownReason, onBeforeShutdown vetoes on quit, close button, closeWindow, reload and load (`window.confirmBeforeClose`, backup tracker auto save, hot exit, showSaveConfirm); cargo test -p app lifecycle; no phases or onWillShutdown joiners; workbench/unattended_restart.rs: `canRestartUnattended` with its blocker aggregation and change log, and the participants `workbench.starting` (2.5 s after restore), dialog, quick input, transient workspace, modal editor, editors not restored or not restorable, `debug.sessionActive`, `tasks.running`, the backup tracker's `workingCopy.*` and `cli.waitingForEditorClose`, terminalUnattendedRestart.ts, testingUnattendedRestart.ts, `testing.continuousRun`, webviewUnattendedRestart.ts and notebookUnattendedRestart.ts: cargo test -p app unattended_restart (unattendedRestart.test.ts, terminalUnattendedRestart.test.ts, testingUnattendedRestart.test.ts); update/unattended_restart.rs: unattendedRestartScheduler.ts's decisions (keep awake from the lock, restart once locked a minute, retry every minute, veto, a newer update postponing, battery and thermal pressure, resume restarting the clock, the update not installed last time) over injected time: cargo test -p app update::unattended_restart (13 of unattendedRestartScheduler.test.ts's cases, without the telemetry outcomes the port does not send); workbench/unattended_restart.rs `UnattendedRestart`: the scheduler's host on macOS (power events, window blur, update state, timers, the `prevent-app-suspension` blocker, `quitAndInstall` from a window), `getWindowBlockers`, `hasArgumentsLostOnRelaunch`, `app.launchedFromCli`, `app.dialogOpen` (dialog.rs `has_open_dialogs`: the NSAlert sheets and the open and save panels) and the failed update remembered across the restart: cargo test -p app unattended_restart (a_locked_screen_keeps_the_machine_awake, windows_that_do_not_come_back_as_they_are_block, launch_arguments_the_relaunch_drops_block, a_restart_that_came_back_on_the_same_commit_failed_to_install); windows_state.rs `setNextExactRestore`/`takeExactRestore` (minimized windows, hidden app): cargo test -p app windows_state; verified: cargo test -p app backup_tracker lifecycle (workingCopyBackupTracker.test.ts); ui-pair hot-exit.json `dirty`, `restored` vs the reference (port/results/windows.md, milestone 11 verification) || workbench/services/localTranscription | workbench service | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert || workbench/services/localization | workbench service | M18 | verified | | ui-pair port/fixtures/extensions/ui-display-language.json: picking Deutsch installs MS-CEINTL.vscode-language-pack-de with the "Installing Deutsch language support..." progress and asks "Restart VSRustium to switch to Deutsch?"; localeService.ts: argv.json `locale` written and cleared, restart dialog, install of an MS-CEINTL pack: cargo test -p app nls localization; Command Palette titles, categories and descriptions translate by the reference call's module and key (port/tools/ref-commands with ref-nls-clone.ts; cargo test -p app a_palette_title_two_modules), menu bar items, side bar titles and pane headers by the reference's `nlsKeys` per menu, view and container (cargo test -p app menu_bar_items_and_view_titles_resolve_per_scope); other surfaces stay English (port/notes.md) || workbench/services/log | workbench service | M6 | verified | | output/log_levels.rs: defaultLogLevels.ts argv.json `log-level` read and write, `getDefaultLogLevel`, `parseLogLevel`; logs_actions.rs `setDefaultLogLevel` (cargo test -p app set_default_log_level_writes_argv, reads_and_writes_argv_log_levels); the Window log as logConstants.ts `windowLogId`; electron-browser logService.ts in a test run: the host console reaches stdout/stderr through the session; output/log_levels.rs: defaultLogLevels.ts argv.json `log-level` read and write, `getDefaultLogLevel`, `parseLogLevel`; logs_actions.rs `setDefaultLogLevel` (cargo test -p app set_default_log_level_writes_argv, reads_and_writes_argv_log_levels); the Window log as logConstants.ts `windowLogId` |