From cdc048243c5ca64d1bcace7afd3d47e16839ce97 Mon Sep 17 00:00:00 2001 From: Ben Follington <5009316+bfollington@users.noreply.github.com> Date: Thu, 23 Oct 2025 09:59:02 +1000 Subject: [PATCH 1/2] Fix charm list view auto-dismiss MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We regressed when reworking the 'active charm' concept. Clicking the 🔍 should show the charms list, clicking an item should navigate to it and dismiss the list. After our recent changes, we no longer automatically dismissed the list. This PR corrects that behaviour. --- packages/shell/src/lib/app/state.ts | 3 +++ packages/shell/test/app-state.test.ts | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/shell/src/lib/app/state.ts b/packages/shell/src/lib/app/state.ts index 7e893acdfd..0a4664da06 100644 --- a/packages/shell/src/lib/app/state.ts +++ b/packages/shell/src/lib/app/state.ts @@ -35,6 +35,9 @@ export function applyCommand( switch (command.type) { case "set-active-charm-id": { next.activeCharmId = command.charmId; + if (command.charmId) { + next.showShellCharmListView = false; + } break; } case "set-identity": { diff --git a/packages/shell/test/app-state.test.ts b/packages/shell/test/app-state.test.ts index 771d6b0ba3..b136c2f490 100644 --- a/packages/shell/test/app-state.test.ts +++ b/packages/shell/test/app-state.test.ts @@ -2,6 +2,7 @@ import { describe, it } from "@std/testing/bdd"; import { AppState, AppStateSerialized, + applyCommand, deserialize, serialize, } from "../src/lib/app/mod.ts"; @@ -69,4 +70,18 @@ describe("AppState", () => { assert(state.spaceName === SPACE_NAME); assert(state.identity?.did() === identity.did(), "deserializes identity."); }); + + it("clears charm list view when activating a charm", () => { + const initial: AppState = { + apiUrl: new URL(API_URL), + showShellCharmListView: true, + }; + + const next = applyCommand(initial, { + type: "set-active-charm-id", + charmId: "example", + }); + + assert(next.showShellCharmListView === false); + }); }); From 470752793b9fdeb2b692af352c68bc7bde3368d2 Mon Sep 17 00:00:00 2001 From: Ben Follington <5009316+bfollington@users.noreply.github.com> Date: Thu, 23 Oct 2025 09:59:48 +1000 Subject: [PATCH 2/2] Format pass --- packages/shell/test/app-state.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shell/test/app-state.test.ts b/packages/shell/test/app-state.test.ts index b136c2f490..43b4073014 100644 --- a/packages/shell/test/app-state.test.ts +++ b/packages/shell/test/app-state.test.ts @@ -1,8 +1,8 @@ import { describe, it } from "@std/testing/bdd"; import { + applyCommand, AppState, AppStateSerialized, - applyCommand, deserialize, serialize, } from "../src/lib/app/mod.ts";