-
Notifications
You must be signed in to change notification settings - Fork 2
π¨ Palette: Make Kids Background Music Slider Accessible #132
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
dc935f4
c7c59c2
c9ce275
82f91be
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 |
|---|---|---|
|
|
@@ -1248,7 +1248,6 @@ | |
| "title": "MCP API Key", | ||
| "description": "Generate an API key to save prompts via MCP and access your private prompts.", | ||
| "yourApiKey": "Your API Key", | ||
|
|
||
| "keyWarning": "Keep this key secret. Anyone with this key can access your private prompts and create prompts on your behalf.", | ||
| "noApiKey": "You haven't generated an API key yet.", | ||
| "generate": "Generate API Key", | ||
|
|
@@ -1765,7 +1764,12 @@ | |
| "resetWarning": "This will delete all your stars and progress. Are you sure?", | ||
| "resetConfirm": "Yes, Reset Everything", | ||
| "resetComplete": "Progress reset! Reloading...", | ||
| "cancel": "Cancel" | ||
| "cancel": "Cancel", | ||
| "muteMusic": "Mute music", | ||
|
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. P2: Add the new kids.settings translation keys to all locale files, not just English. Otherwise non-English Kids Mode renders these new controls with missing translations/errors instead of localized accessible labels. Prompt for AI agents |
||
| "playMusic": "Play music", | ||
| "musicOn": "π On", | ||
| "musicOff": "π Off", | ||
| "musicVolume": "Music volume" | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,14 +3,21 @@ | |||||
| import "dotenv/config"; | ||||||
| import { defineConfig } from "prisma/config"; | ||||||
|
|
||||||
| if (!process.env.DATABASE_URL) { | ||||||
| process.env.DATABASE_URL = "postgresql://placeholder:placeholder@localhost:5432/placeholder"; | ||||||
| } | ||||||
|
|
||||||
| if (!process.env.DIRECT_URL) { | ||||||
| process.env.DIRECT_URL = "postgresql://placeholder:placeholder@localhost:5432/placeholder"; | ||||||
|
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. P1: Do not fall back DIRECT_URL to an unrelated placeholder when DATABASE_URL is configured; migration commands may target localhost instead of the intended database. Use DATABASE_URL as the DIRECT_URL fallback, or fail fast for migration commands. Prompt for AI agents
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| export default defineConfig({ | ||||||
| schema: "prisma/schema.prisma", | ||||||
| migrations: { | ||||||
| path: "prisma/migrations", | ||||||
| }, | ||||||
| engine: "classic", | ||||||
| datasource: { | ||||||
| url: | ||||||
| process.env.DATABASE_URL ?? "postgresql://placeholder:placeholder@localhost:5432/placeholder", | ||||||
| url: process.env.DATABASE_URL, | ||||||
| }, | ||||||
| }); | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -175,8 +175,9 @@ export function MusicButton() { | |
| return ( | ||
| <button | ||
| onClick={toggleMusic} | ||
| className="pixel-btn pixel-btn-amber flex h-8 items-center px-2 py-1.5" | ||
| className="pixel-btn pixel-btn-amber flex h-8 items-center px-2 py-1.5 focus-visible:ring-2 focus-visible:ring-[#8B4513] focus-visible:ring-offset-2 focus-visible:outline-none" | ||
| aria-label={labelText} | ||
| aria-pressed={isPlaying} | ||
|
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. P2: Prompt for AI agents |
||
| title={labelText} | ||
| > | ||
| {isPlaying ? <PixelSpeakerOn aria-hidden="true" /> : <PixelSpeakerOff aria-hidden="true" />} | ||
|
|
@@ -187,6 +188,7 @@ export function MusicButton() { | |
| // Volume slider component for settings | ||
| export function MusicVolumeSlider() { | ||
| const context = useMusicContext(); | ||
| const t = useTranslations("kids.settings"); | ||
|
|
||
| if (!context) return null; | ||
|
|
||
|
|
@@ -197,21 +199,25 @@ export function MusicVolumeSlider() { | |
| <div className="flex items-center justify-between"> | ||
| <button | ||
| onClick={() => setIsPlaying(!isPlaying)} | ||
| className={`rounded-lg px-3 py-1.5 text-sm font-medium transition-colors ${ | ||
| aria-pressed={isPlaying} | ||
| className={`rounded-lg px-3 py-1.5 text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-[#8B4513] focus-visible:ring-offset-2 focus-visible:outline-none ${ | ||
| isPlaying ? "bg-[#22C55E] text-white" : "bg-gray-200 text-gray-600" | ||
| }`} | ||
| > | ||
| {isPlaying ? "π On" : "π Off"} | ||
| {isPlaying ? t("musicOn") : t("musicOff")} | ||
| </button> | ||
| <span className="text-sm text-[#5D4037]">{Math.round(volume * 100)}%</span> | ||
| <span className="text-sm text-[#5D4037]" aria-hidden="true"> | ||
| {Math.round(volume * 100)}% | ||
| </span> | ||
| </div> | ||
| <input | ||
| type="range" | ||
| min="0" | ||
| max="100" | ||
| value={volume * 100} | ||
| onChange={(e) => setVolume(parseInt(e.target.value) / 100)} | ||
| className="h-2 w-full cursor-pointer appearance-none rounded-lg bg-[#D4A574] accent-[#8B4513]" | ||
| aria-label={t("musicVolume")} | ||
| className="h-2 w-full cursor-pointer appearance-none rounded-lg bg-[#D4A574] accent-[#8B4513] focus-visible:ring-2 focus-visible:ring-[#8B4513] focus-visible:ring-offset-2 focus-visible:outline-none" | ||
| /> | ||
| </div> | ||
| ); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
P2: Do not state that On/Off switches require
aria-pressed; switches should usearia-checked(or a native checkbox), while only toggle buttons usearia-pressed. This guidance could lead future accessibility fixes to implement incorrect ARIA semantics.Prompt for AI agents