feat: add mobile refresh control

This commit is contained in:
Federico Jaramillo Martinez
2026-05-23 21:18:22 +02:00
parent 1546143038
commit df20563abb
7 changed files with 195 additions and 2 deletions
+14
View File
@@ -21,6 +21,8 @@ function createContext(statePatch: Partial<AppState> = {}) {
openTerminal: vi.fn((options?: { terminalId?: string | undefined }) => { calls.push(`openTerminal:${options?.terminalId ?? ""}`); }),
refreshFiles: vi.fn(() => { calls.push("refreshFiles"); }),
refreshGit: vi.fn(() => { calls.push("refreshGit"); }),
refreshAppData: vi.fn(() => { calls.push("refreshAppData"); }),
reloadPage: vi.fn(() => { calls.push("reloadPage"); }),
startSession: vi.fn(() => { calls.push("startSession"); }),
archiveSession: vi.fn(() => { calls.push("archiveSession"); }),
stopActiveWork: vi.fn(() => { calls.push("stopActiveWork"); }),
@@ -86,6 +88,18 @@ describe("PluginRegistry", () => {
expect(calls).toEqual(["refreshGit"]);
});
it("routes app refresh and reload actions through the runtime context", () => {
const registry = new PluginRegistry();
registry.register({ id: "core", plugin: corePlugin });
const { context, calls } = createContext();
const actions = registry.getActions(context);
void actions.find((candidate) => candidate.id === "core:app.refresh-data")?.run();
void actions.find((candidate) => candidate.id === "core:app.reload-page")?.run();
expect(calls).toEqual(["refreshAppData", "reloadPage"]);
});
it("exposes terminal navigation as a shortcut-backed action", () => {
const registry = new PluginRegistry();
registry.register({ id: "core", plugin: corePlugin });