Skip to content

Commit d8cdf2a

Browse files
authored
fix(settings): make usage switches clickable (#284)
1 parent f44dae5 commit d8cdf2a

3 files changed

Lines changed: 35 additions & 10 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"dev:renderer": "node scripts/free-port.mjs 3100 && vite",
2525
"dev:mobile": "node scripts/free-port.mjs 3100 && cross-env PORACODE_BUILD_TARGET=mobile vite",
2626
"dev:electron": "tsdown --watch",
27-
"dev:app": "node scripts/free-port.mjs 47820-47832 32120-32132 && pnpm run setup:native && wait-on dist/main/main.cjs dist/main/mcpProbeWorker.mjs && pnpm run prepare:package-assets && wait-on tcp:3100 && node scripts/dev-launch.mjs",
27+
"dev:app": "pnpm run setup:native && wait-on dist/main/main.cjs dist/main/mcpProbeWorker.mjs && pnpm run prepare:package-assets && wait-on tcp:3100 && node scripts/dev-launch.mjs",
2828
"build": "pnpm run build:renderer && pnpm run build:electron",
2929
"build:renderer": "vite build",
3030
"build:mobile": "pnpm run prepare:mobile:ssh && cross-env PORACODE_BUILD_TARGET=mobile vite build && node scripts/finalize-mobile-build.mjs",

src/renderer/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@
849849
--window-overlay-background: rgba(0, 0, 0, 0);
850850
--composer-surface: var(--surface);
851851
--interactive-cursor: default;
852+
--cursor-interactive: default;
852853

853854
/* Theme-adaptive interaction overlays. Derived from --foreground so they
854855
invert per theme: a light wash on dark themes (matching the old

src/renderer/views/SettingsOverlay/parts/UsageSettings.tsx

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,17 @@ function UsageProviderRow(props: { id: string; label: string }) {
254254
});
255255
}}
256256
>
257-
<Switch.Control>
258-
<Switch.Thumb />
259-
</Switch.Control>
257+
<Switch.Content>
258+
<Switch.Control
259+
onClick={(event) => {
260+
event.preventDefault();
261+
event.stopPropagation();
262+
event.currentTarget.closest("label")?.querySelector("input")?.click();
263+
}}
264+
>
265+
<Switch.Thumb />
266+
</Switch.Control>
267+
</Switch.Content>
260268
</Switch>
261269
</div>
262270
{enabled ? <UsageProviderControls id={id} label={label} /> : null}
@@ -379,9 +387,17 @@ export function UsageSettings() {
379387
});
380388
}}
381389
>
382-
<Switch.Control>
383-
<Switch.Thumb />
384-
</Switch.Control>
390+
<Switch.Content>
391+
<Switch.Control
392+
onClick={(event) => {
393+
event.preventDefault();
394+
event.stopPropagation();
395+
event.currentTarget.closest("label")?.querySelector("input")?.click();
396+
}}
397+
>
398+
<Switch.Thumb />
399+
</Switch.Control>
400+
</Switch.Content>
385401
</Switch>
386402
</SettingRow>
387403

@@ -403,9 +419,17 @@ export function UsageSettings() {
403419
});
404420
}}
405421
>
406-
<Switch.Control>
407-
<Switch.Thumb />
408-
</Switch.Control>
422+
<Switch.Content>
423+
<Switch.Control
424+
onClick={(event) => {
425+
event.preventDefault();
426+
event.stopPropagation();
427+
event.currentTarget.closest("label")?.querySelector("input")?.click();
428+
}}
429+
>
430+
<Switch.Thumb />
431+
</Switch.Control>
432+
</Switch.Content>
409433
</Switch>
410434
</SettingRow>
411435

0 commit comments

Comments
 (0)