From dbc59c374a0954fc2c83403b4cb4b0373beed304 Mon Sep 17 00:00:00 2001 From: HuiNeng6 <3650306360@qq.com> Date: Wed, 25 Mar 2026 07:18:59 +0800 Subject: [PATCH 1/2] fix(debugger): disable copy button when Call Stack has no frames - Add guard in handleCopyStack to return early if frames array is empty - Disable copy button when there are no stack frames to prevent empty clipboard overwrite - Fixes issue where copy action could silently wipe user's clipboard with empty string Fixes #37588 --- src/components/debugger/CallStackPanel.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/debugger/CallStackPanel.tsx b/src/components/debugger/CallStackPanel.tsx index 5b702af2..3febad18 100644 --- a/src/components/debugger/CallStackPanel.tsx +++ b/src/components/debugger/CallStackPanel.tsx @@ -143,6 +143,8 @@ export function CallStackPanel() { }; const handleCopyStack = async () => { + // Guard: do not overwrite clipboard when there are no frames + if (frames().length === 0) return; const text = frames() .map((f) => { const loc = f.source?.path ? `${f.source.path}:${f.line}${f.column > 0 ? `:${f.column}` : ""}` : "unknown"; @@ -162,7 +164,7 @@ export function CallStackPanel() { - + From 7b95e9385db1a19092ede3b96f0de2a3c49aeda1 Mon Sep 17 00:00:00 2001 From: HuiNeng6 <3650306360@qq.com> Date: Wed, 25 Mar 2026 07:21:46 +0800 Subject: [PATCH 2/2] fix(settings): add hover effect to GUI/JSON settings switch - Remove inline style that was overriding hover effects - Add CSS class for active state with proper hover styling - Fixes issue where switch between GUI Settings and JSON editor had no visual feedback on hover Fixes #37583 (reported in PlatformNetwork/bounty-challenge) --- src/components/SettingsDialog.tsx | 6 +----- src/styles/settings.css | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/components/SettingsDialog.tsx b/src/components/SettingsDialog.tsx index 70699575..44951bd1 100644 --- a/src/components/SettingsDialog.tsx +++ b/src/components/SettingsDialog.tsx @@ -834,11 +834,7 @@ export function SettingsDialog(props: SettingsDialogProps) { variant={showJsonView() ? "secondary" : "ghost"} size="sm" icon={showJsonView() ? : } - style={showJsonView() ? { - background: "rgba(234, 179, 8, 0.2)", - color: "var(--cortex-warning)", - border: "1px solid rgba(234, 179, 8, 0.3)", - } : {}} + class={showJsonView() ? "settings-json-toggle-active" : ""} title={showJsonView() ? "Switch to GUI Settings" : "Open Settings (JSON)"} > {showJsonView() ? "GUI Settings" : "JSON"} diff --git a/src/styles/settings.css b/src/styles/settings.css index ce77d962..af2f5486 100644 --- a/src/styles/settings.css +++ b/src/styles/settings.css @@ -883,3 +883,20 @@ text-overflow: ellipsis; } } + +/* ========================================================================== + JSON/GUI Settings Toggle Button + ========================================================================== */ + +/* Active state (JSON mode) */ +.settings-json-toggle-active { + background: rgba(234, 179, 8, 0.2) !important; + color: var(--cortex-warning) !important; + border: 1px solid rgba(234, 179, 8, 0.3) !important; +} + +/* Hover state for active toggle */ +.settings-json-toggle-active:hover { + background: rgba(234, 179, 8, 0.35) !important; + border-color: rgba(234, 179, 8, 0.5) !important; +}