Repository navigation
Make the folder fields a button, so Chromium draws none of their text - #656
Merged
Merged
Conversation
The create-site dialog's Location and the settings' New sites go here were a file input, whose button and "No file chosen" Chromium draws in its own language, not the one chosen in the settings, and reports to screen readers as the input's value. They are now a button saying "Choose folder…", named by the field and that text, and described by the folder it holds. Dropping a folder on the input was the one thing it added, and #228 closed that route as unsupported, so its handler and directoryFromFileEntry go too. Fixes #655.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2 tasks done
zaerl
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The folder fields in the create-site dialog ("Location") and the settings ("New sites go here") were a native file input. Chromium draws that input's "Choose Files" button and "No file chosen" in its own language, which follows the OS or
--langbut not the language chosen in the settings, and has no en-XA pack. So with an English OS and Dutch chosen in the settings, those two strings stay English. Screen readers also heard "No file chosen" in English, as the input's value.What changes
''orC:\fakepath). Its handler anddirectoryFromFileEntrygo, along with the three unit tests that recorded that unsupported route.How to test this
The en-XA journey covers what was reported:
npx playwright test --project=journeys tests/e2e/journeys/i18n.spec.jsfrom the repository root. Its two new checks, one per field, fail without this change and pass with it.tests/e2e/journeys/create-site.spec.jschecks the button's description before and after a folder is chosen.What the journeys can't reach is the real system dialog, so by hand, on either platform, on the current head:
Starting state: the app open with no sites, or any state with the Create site button.
What must not have happened: pressing Choose folder… inside the create-site dialog must not submit the form (no "Please provide a site name." appears). Under
npx electron . --lang=en-XA, neither field shows "Choose Files" or "No file chosen".Risks and limitations
C:\fakepathor nothing, per Dropping a folder on the Create site location button is half-supported #228.alert()andconfirm()are other places Electron draws English. They are out of scope here.Related
Fixes #655. Part of #659, under #622.
Design decisions and alternatives considered
The issue first proposed keeping the input and hiding Chromium's text with CSS (
::file-selector-buttonand a transparent colour), with our own label drawn over it. That fixes the screen but not the accessibility tree: Chromium still reports the input's value as "No file chosen" in English, and CSS can't change that. Once the drop route is accepted as unsupported, the input adds nothing a button doesn't, so it goes.The name is set with an explicit
aria-labelledbyover a span in the label and a span in the button, becauseField.Controlotherwise names its control by the label alone. Props passed toField.Controlare merged after its own, so the explicit value wins.Review outcome (required — see AGENTS.md)
c328144. 2 [fix here] · 0 [follow-up], both fixed:npm run shots, and onlycreate-site-modal.pngis committed (the other captures drifted with nothing in them changed by this PR).site-folder.cjswas applied too.c2a819d/ basec328144. 0 [fix here] · 1 [follow-up]. It confirmed both fixes against Base UI's source. The follow-up predates this PR:chooseFolderincreate-site-dialog.jsxswallows a failedchooseDirectory()with an emptycatch. The settings field'schoosedoes the same. Deferred, since it is unrelated to the translation.c2a819d.Screenshots or recording
Before: Chromium's file input, "Choose Files" and "No file chosen", in English under every language.
After:
🤖 Generated with Claude Code