Skip to content

Fix AI gateway toggle styling and remote clipboard copy - #106

Merged
ganisback merged 2 commits into
mainfrom
fix-toggle-style
Aug 10, 2026
Merged

Fix AI gateway toggle styling and remote clipboard copy#106
ganisback merged 2 commits into
mainfrom
fix-toggle-style

Conversation

@MasonXon

@MasonXon MasonXon commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Two small fixes for the AI gateway page.

Toggle styling

Standardize all toggle switches in AIGateway.tsx to use the same
peer-checked:after:border-white treatment as the Settings page, so the
knob border turns white when enabled.

Before:
image

After:
image

Remote clipboard copy

navigator.clipboard is only available in secure contexts (HTTPS or
localhost). When the gateway is reached over plain HTTP from a remote
address, the API is undefined and every copy button (API key, base URL,
curl example) silently fails.

Install a minimal writeText polyfill backed by document.execCommand
only when the native clipboard is missing, so localhost/HTTPS keep using
the real API and all existing call sites work unchanged.

Standardize all toggle switches in AIGateway.tsx to use the same
peer-checked:after:border-white treatment as the Settings page, so the
knob border turns white when enabled.

Generated with AI

Co-Authored-By: csglite <xzhgan@gmail.com>
@MasonXon
MasonXon requested a review from ganisback August 10, 2026 08:56
navigator.clipboard is only available in secure contexts (HTTPS or
localhost). When the gateway is reached over plain HTTP from a remote
address, the API is undefined and every copy button silently fails.

Install a minimal writeText polyfill backed by document.execCommand only
when the native clipboard is missing, so localhost/HTTPS keep using the
real API and all existing call sites work unchanged.
@MasonXon MasonXon changed the title Fix AI gateway toggle styling to match settings page Fix AI gateway toggle styling and remote clipboard copy Aug 10, 2026
@ganisback
ganisback merged commit f5efa64 into main Aug 10, 2026
@ganisback
ganisback deleted the fix-toggle-style branch August 10, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants