Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/components/SettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -834,11 +834,7 @@ export function SettingsDialog(props: SettingsDialogProps) {
variant={showJsonView() ? "secondary" : "ghost"}
size="sm"
icon={showJsonView() ? <Icon name="gear" style={{ width: "14px", height: "14px" }} /> : <Icon name="file-lines" style={{ width: "14px", height: "14px" }} />}
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"}
Expand Down
4 changes: 3 additions & 1 deletion src/components/debugger/CallStackPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -162,7 +164,7 @@ export function CallStackPanel() {
<Icon name={showThreads() ? "eye" : "eye-slash"} size={12} />
</IconButton>
</Show>
<IconButton size="sm" variant="ghost" onClick={handleCopyStack} title="Copy Call Stack">
<IconButton size="sm" variant="ghost" onClick={handleCopyStack} disabled={frames().length === 0} title="Copy Call Stack">
<Icon name="copy" size={12} />
</IconButton>
</div>
Expand Down
17 changes: 17 additions & 0 deletions src/styles/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}