Skip to content

Commit b87f1d2

Browse files
feat(Sky): Signal Mountain lifecycle phases from frontend to skip fallback timers
Add implementation in Mountain.astro to advance the workbench lifecycle phases (Restored at 0ms, Eventually at 2000ms) by invoking the Tauri IPC command `lifecycle:advancePhase` directly from the frontend. This allows Mountain to skip its built-in 8s/23s fallback timers and transition to interactive states as soon as the workbench is ready. The implementation uses dynamic import for @tauri-apps/api/core since the workbench boots in a plain module context without a pre-resolved bundle. Calls are wrapped in try/catch with performance markers for observability. This implements the Atom P3 milestone for optimized lifecycle management, enabling the sidebar to refresh live after VSIX install/uninstall without relying on Mountain's fallback timers.
1 parent 4517367 commit b87f1d2

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

Public/product.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"date": "2026-04-21T18:11:08.294Z",
2+
"date": "2026-04-22T13:36:16.219Z",
33
"licenseName": "MIT",
44
"licenseUrl": "https://github.com/codeeditorland/land/blob/main/LICENSE",
55
"serverDataFolderName": ".land-server",

Source/Workbench/Mountain.astro

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,45 @@ import TelemetryBridge from "./TelemetryBridge.astro";
6666
);
6767
await InstallSkyBridge();
6868
performance.mark("land:mountain:skybridge:installed");
69+
70+
// Atom P3: signal Mountain that the workbench is
71+
// interactive so `Restored` / `Eventually` phases don't
72+
// rely on Mountain's 8s/23s fallback timers. Mountain
73+
// rejects backwards/same-phase advances so calling this
74+
// after the fallback fired is harmless. The Tauri IPC
75+
// is loaded dynamically because the workbench boot runs
76+
// in a plain `<script type="module">` context without a
77+
// pre-resolved bundle.
78+
try {
79+
const TauriModule = await import(
80+
"@tauri-apps/api/core"
81+
);
82+
await TauriModule.invoke("mountain_ipc_invoke", {
83+
command: "lifecycle:advancePhase",
84+
args: [3],
85+
});
86+
performance.mark("land:mountain:phase:restored");
87+
setTimeout(async () => {
88+
try {
89+
await TauriModule.invoke(
90+
"mountain_ipc_invoke",
91+
{
92+
command: "lifecycle:advancePhase",
93+
args: [4],
94+
},
95+
);
96+
performance.mark(
97+
"land:mountain:phase:eventually",
98+
);
99+
} catch {
100+
performance.mark(
101+
"land:mountain:phase:eventually:error",
102+
);
103+
}
104+
}, 2000);
105+
} catch {
106+
performance.mark("land:mountain:phase:error");
107+
}
69108
} catch {
70109
performance.mark("land:mountain:skybridge:error");
71110
}

0 commit comments

Comments
 (0)