fix(daemon,app): graceful-shutdown final snapshot pass + StoppedSnapshot detach cleanup
Addresses final-review findings: Cmd::Shutdown now snapshots all live surfaces synchronously before exit (spec graceful-shutdown requirement); StoppedSnapshot calls detachSurface on unmount to release the bridge output channel. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,7 @@ import { SearchBar } from "./SearchBar";
|
||||
import { StatusRing } from "./StatusRing";
|
||||
import { COLORS, FONT, STATE_COLOR } from "./theme";
|
||||
import type { LayoutNode, SurfaceState, SurfaceView } from "./layoutTypes";
|
||||
import { setRatios, restartSurface, setZoom, moveSurface, attachSurface } from "./socketBridge";
|
||||
import { setRatios, restartSurface, setZoom, moveSurface, attachSurface, detachSurface } from "./socketBridge";
|
||||
|
||||
interface Props {
|
||||
workspaceId: string;
|
||||
@@ -149,7 +149,7 @@ function StoppedSnapshot({ surfaceId, font, palette }: { surfaceId: string; font
|
||||
void attachSurface(surfaceId, () => {}).then((res) => {
|
||||
if (!disposed && res.snapshot) term.write(res.snapshot);
|
||||
});
|
||||
return () => { disposed = true; term.dispose(); };
|
||||
return () => { disposed = true; term.dispose(); void detachSurface(surfaceId); };
|
||||
}, [surfaceId, font, palette]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
return <div ref={hostRef} style={{ position: "absolute", inset: 0, opacity: 0.45, pointerEvents: "none" }} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user