From 54824a1421da38bd8a2760f3a4e7ef66ae67166b Mon Sep 17 00:00:00 2001 From: LukeParkerDev <10430890+Hona@users.noreply.github.com> Date: Wed, 16 Sep 2026 14:42:19 +1000 Subject: [PATCH] fix(app): enable debug tools toggle on local channel --- packages/app/src/shell/shell.tsx | 15 ++++++++++----- packages/app/src/shell/titlebar/titlebar.tsx | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/app/src/shell/shell.tsx b/packages/app/src/shell/shell.tsx index b781f3e26201..0062a8438548 100644 --- a/packages/app/src/shell/shell.tsx +++ b/packages/app/src/shell/shell.tsx @@ -33,6 +33,15 @@ export default function Layout(props: ParentProps) { }, install: installUpdate, } + // A plain object avoids the compiler's conditional-prop memo, which leaks when read from event handlers. + const debugTools = import.meta.env.DEV + ? { + get visible() { + return state.debugTools + }, + toggle: () => setState("debugTools", (value) => !value), + } + : undefined return ( @@ -53,11 +62,7 @@ export default function Layout(props: ParentProps) { setState("debugTools", (value) => !value) } - : undefined - } + debugTools={debugTools} />
diff --git a/packages/app/src/shell/titlebar/titlebar.tsx b/packages/app/src/shell/titlebar/titlebar.tsx index cd3bdb8c7363..362cc9aaa79f 100644 --- a/packages/app/src/shell/titlebar/titlebar.tsx +++ b/packages/app/src/shell/titlebar/titlebar.tsx @@ -792,7 +792,7 @@ function ChannelIndicator(props: { if (!channel || channel === "prod") return null const label = () => language.t(`titlebar.channel.${channel}`) - const debug = () => (channel === "dev" ? props.debugTools : undefined) + const debug = () => (channel === "dev" || channel === "local" ? props.debugTools : undefined) return (