mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-14 03:56:55 +03:00
fix(app): enable debug tools toggle on local channel (#49278)
This commit is contained in:
committed by
GitHub
Unverified
parent
5379a2dfe0
commit
005522786f
@@ -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 (
|
||||
<TitlebarRightProvider>
|
||||
@@ -53,11 +62,7 @@ export default function Layout(props: ParentProps) {
|
||||
<Titlebar
|
||||
update={update}
|
||||
verticalTabs={verticalTabs() ? { mount: state.tabsMount } : undefined}
|
||||
debugTools={
|
||||
import.meta.env.DEV
|
||||
? { visible: state.debugTools, toggle: () => setState("debugTools", (value) => !value) }
|
||||
: undefined
|
||||
}
|
||||
debugTools={debugTools}
|
||||
/>
|
||||
<div class="flex flex-1 min-h-0 min-w-0 flex-row">
|
||||
<Show when={verticalTabs()}>
|
||||
|
||||
@@ -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 (
|
||||
<Tooltip
|
||||
placement={props.sidebar ? "right" : "bottom"}
|
||||
|
||||
Reference in New Issue
Block a user