-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: [UX improvement] Add ARIA labels and focus states to playground inputs #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -295,7 +295,8 @@ export function PlaygroundView({ | |||||||
| <div className="mb-6 grid gap-3 md:grid-cols-3"> | ||||||||
| <Control label="Guide"> | ||||||||
| <select | ||||||||
| className="pp-select" | ||||||||
| aria-label="Guide" | ||||||||
| className="pp-select focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--strand-color-accent-lede)]" | ||||||||
| onChange={(e) => setGuideSlug(e.target.value)} | ||||||||
| value={guideSlug} | ||||||||
| > | ||||||||
|
|
@@ -309,7 +310,8 @@ export function PlaygroundView({ | |||||||
|
|
||||||||
| <Control label="Preset"> | ||||||||
| <select | ||||||||
| className="pp-select" | ||||||||
| aria-label="Preset" | ||||||||
| className="pp-select focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--strand-color-accent-lede)]" | ||||||||
|
Comment on lines
+313
to
+314
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the Guide dropdown, this
Suggested change
|
||||||||
| onChange={(e) => setPresetSlug(e.target.value as UseCase | "")} | ||||||||
| value={presetSlug} | ||||||||
| > | ||||||||
|
|
@@ -326,6 +328,7 @@ export function PlaygroundView({ | |||||||
|
|
||||||||
| <Control label={`Temperature · ${temperature.toFixed(1)}`}> | ||||||||
| <input | ||||||||
| aria-label="Temperature" | ||||||||
| className="w-full" | ||||||||
|
Comment on lines
+331
to
332
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||
| max="1" | ||||||||
| min="0" | ||||||||
|
|
@@ -341,7 +344,8 @@ export function PlaygroundView({ | |||||||
| <div className="grid gap-5 md:grid-cols-2"> | ||||||||
| <Panel label="Input"> | ||||||||
| <textarea | ||||||||
| className="min-h-[220px] w-full resize-y bg-transparent text-sm focus:outline-none" | ||||||||
| aria-label="Input" | ||||||||
| className="min-h-[220px] w-full resize-y bg-transparent text-sm focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--strand-color-accent-lede)]" | ||||||||
| onChange={(e) => setInput(e.target.value)} | ||||||||
| placeholder="Paste a customer message, a prompt, a paragraph to rewrite…" | ||||||||
| style={{ color: "var(--strand-color-ink-primary)" }} | ||||||||
|
|
@@ -362,6 +366,7 @@ export function PlaygroundView({ | |||||||
| style={{ color: "var(--strand-color-ink-muted)" }} | ||||||||
| > | ||||||||
| <input | ||||||||
| aria-label="Extra pass (slower)" | ||||||||
|
|
||||||||
| checked={humanizeExtraPass} | ||||||||
|
Comment on lines
+369
to
370
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The checkbox is nested inside a
Suggested change
|
||||||||
| disabled={isRunning} | ||||||||
| onChange={(e) => setHumanizeExtraPass(e.target.checked)} | ||||||||
|
|
@@ -719,6 +724,7 @@ function HumanizeToggle({ | |||||||
| }} | ||||||||
| > | ||||||||
| <input | ||||||||
| aria-label="Humanize output" | ||||||||
|
|
||||||||
| checked={on} | ||||||||
|
Comment on lines
+727
to
728
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||
| disabled={disabled || !authenticated} | ||||||||
| onChange={onToggle} | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
<select>element is already nested inside a<Control>component, which renders a<label>element. In HTML, nesting form controls inside a<label>implicitly associates them, providing the accessible name automatically. Therefore,aria-label="Guide"is redundant and can be safely removed to keep the markup clean.