feat(console-web): add bounded iframe keep-alive

- opt service and settings pages into document retention
- preserve iframe identity and local Solid state across navigation
- cap retained documents with deterministic LRU eviction
- deliver activate, deactivate, and dispose lifecycle messages
- reject commands emitted by inactive page documents
- expose page activity as a Solid accessor
- test retention, recreation, eviction, and invalid limits
This commit is contained in:
Maofeng
2026-07-30 09:43:08 +08:00
parent ccad05fa5a
commit 1b2c50c951
9 changed files with 360 additions and 52 deletions
@@ -46,7 +46,7 @@ function FramePage() {
</main>
}
>
<Page state={bridge.state} command={bridge.command} />
<Page state={bridge.state} active={bridge.active} command={bridge.command} />
</Suspense>
);
}}
@@ -3,5 +3,10 @@ import type { HostSharedState, PageCommand } from "../sdk/protocol";
export type PageProps = {
state: Accessor<HostSharedState | null>;
/**
* False while a keep-alive iframe is hidden. Page-owned polling, media or
* render loops should pause until this accessor becomes true again.
*/
active: Accessor<boolean>;
command: (command: PageCommand) => void;
};