Skip to content

refactor(i18n): show browser tabs, page notes, VS Code, and px0 through Fluent - #942

Merged
penso merged 9 commits into
mainfrom
i18n/rest-chat-browser
Nov 1, 2026
Merged

penso merged 9 commits into
mainfrom
i18n/rest-chat-browser

Conversation

@penso

@penso penso commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Merged with main, including main's own fix for the #905 build break (3f18590). It takes main's side of every i18n/errors file, so it no longer depends on #937. It also carries one style commit: main failed just check-sorted, because rustfmt had folded the keep-sorted end marker in i18n/errors/host_build.rs onto a closing brace. #941 makes the same edit.

Summary

Part of Phase 2 of docs/i18n.md (string migration), following #880, #924, #925, #926, and #928. This PR covers browser tabs. Chats follow in a stacked PR.

  • browser/ is marked // i18n: migrated as a whole. Its text comes from four new files: browser.ftl (tabs, toolbar, address, placeholders), browser-notes.ftl (the page notes panel and its flashes), browser-vscode.ftl (the VS Code tab and its license prompt), and browser-px0.ftl.
  • Errors: a page, VS Code's server, or px0 that fails now shows its error through localize() instead of to_string().
  • Tab titles: titles are still saved in English, because the command line lists them (herdr-gpui tab list). The window shows the title the app gives a tab it draws (Review · branch, Orchestrator · repo, Devices, Terminal, New Tab) in its own language through a new Tab::label.
  • Agent prompt stays English: the prompt page notes become is written for the agent, so it is marked // i18n: data, as Security's prompts are. So are Location::display (used only in that prompt), the cut note an agent reads in browser feedback, and CSS, HTML, JS, and product names.
  • Placeholders: the address and note fields use set_placeholder_with, so they follow a language change.
  • Inline test modules in location.rs, view.rs, and annotate_view/screenshots.rs move to their own tests.rs. The checker would otherwise read their fixtures as shown text, and AGENTS.md keeps test bodies out of production files.
  • Leak test: browser/view_tests/en_xa.rs covers a blank tab with its toolbar and placeholder, the empty notes panel, the composer, a note in the list, and a VS Code tab whose server refuses its token.
  • Right to left: the en-XB capture showed that the page toolbar did not mirror, so Back pointed away from the side it leads from. The toolbar now uses direction::Logical::row, and its arrows use direction::icon. view_tests/rtl.rs covers it.
  • docs/i18n.md: "What is left" and the leak-test list are updated.

Still English

  • The notes panel's Send button and its "Queued until the agent is idle" line come from agent_notes, which the code view's notes share. It is outside this PR's scope and is listed in "What is left".

Screenshots

Native macOS captures, debug build, against an isolated sandbox daemon. The tabs were opened with herdr-gpui browser open and run new_browser_tab, and the language was switched with herdr-gpui language set; no synthetic input was used. The page's own text stays as the page wrote it.

en-XA, a local page: the toolbar's Annotate page en-XA
en-XA, a blank tab: its title, address placeholder, and body blank en-XA
en-XB, the same blank tab after language set en-XB: the placeholder follows the switch, and the toolbar runs from the right blank en-XB

The notes panel needs a click on Annotate, so it is not captured; the leak test covers it.

QA

  • just format
  • just ci on bfdfebb54 (macOS arm64): passed
  • just lint-linux: passed. The first run caught a cfg gate moved onto the wrong use; it is fixed in this commit.
  • just lint-windows: passed
  • en-XB toolbar test: Back, Forward, and the address run from the right
  • en-XA leak test: blank tab, notes panel (empty, composer, list), VS Code tab without its server
  • scripts/check-i18n.py: every English message is used, and browser/ holds no English literal outside data markers
  • Native en-XA and en-XB: a page tab and a blank tab (screenshots above)
  • Native en-XA: open a page (herdr-gpui browser open https://example.com), click Annotate, add a note on the page, and check the panel, flashes, and tab title
  • Native en-XB: the same, reading right to left
  • VS Code tab before accepting the license, and px0's starting text, under en-XA
  • English: browser tabs read as before

🤖 Generated with Claude Code

https://claude.ai/code/session_01BFavh8DuqfoT8UKWKk97Kq

penso and others added 3 commits October 31, 2026 10:39
#905 (iOS app, one pairing for every machine) and #926 (localized
errors) merged independently. #905 moved herdr-automate's binary,
checksum, and platform failures into host_build::Error and added
herdr_client::Error::TerminalAttach, remote control's app::Error::Enroll,
and the root Error::Nearby, none of which had a Localize mapping, so main
no longer compiled.

Each new enum gets its own mapping and .ftl file, as #926 set out:
host_build (error-host-build.ftl, which takes over the three automation
messages), terminal_attach (error-client-terminal-attach.ftl), nearby
(error-nearby.ftl), and enroll (in error-remote-control.ftl). Per-variant
tests cover each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BFavh5CsF9aiVsJURUwioh
…gh Fluent

Part of Phase 2 of docs/i18n.md. browser/ is marked migrated: every
text it shows comes from browser.ftl, browser-notes.ftl,
browser-vscode.ftl, and browser-px0.ftl. Errors a page, VS Code's server,
or px0 report go through localize() instead of to_string().

Tab titles stay saved in English, as the command line lists them; the
window shows the title the app gives a tab it draws (Review,
Orchestrator, Devices, Terminal, New Tab) in its language. The prompt an
agent receives with page notes stays English, marked as data.

Inline test modules of three files move to their own tests.rs, and the
browser gains an en-XA leak test.
@penso

penso commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator Author

just ci ran locally and passed on ce0f250f2 (macOS arm64). Earlier commit bfdfebb54 also passed just lint-linux and just lint-windows; later pushes change no cfg gates.

@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previously reported tab-name problems are fixed.

Summary

Moves browser text to Fluent while keeping saved tab titles in English.

  • Browser controls and page messages follow the selected language.
  • The page notes panel and its messages follow the selected language.
  • App-drawn browser tabs show titles in the window's language.
  • VS Code and px0 tabs show their messages in the selected language.
  • Browser tests and i18n notes sit in separate test files and updated docs.

Reviews (3) · Last reviewed commit: "fix(i18n): show a terminal tab's program..." · Reviewed by Greptile

Comment thread crates/herdr-gpui/src/browser/store.rs Resolved
Under en-XB the page toolbar kept its left-to-right order, so Back
pointed away from the side it should lead from. The row now runs from
the start side, and Back and Forward point along it.
penso added a commit that referenced this pull request Oct 31, 2026
@penso penso mentioned this pull request Oct 31, 2026
7 of 10 tasks
penso added 2 commits October 31, 2026 12:22
# Conflicts:
#	crates/herdr-gpui/locales/en-US/error-client-terminal-attach.ftl
#	crates/herdr-gpui/locales/en-US/error-host-build.ftl
#	crates/herdr-gpui/locales/en-US/error-nearby.ftl
#	crates/herdr-gpui/locales/en-US/error-remote-control.ftl
#	crates/herdr-gpui/src/i18n/errors/client/terminal_attach.rs
#	crates/herdr-gpui/src/i18n/errors/host_build.rs
#	crates/herdr-gpui/src/i18n/errors/nearby.rs
#	crates/herdr-gpui/src/i18n/errors/remote_control.rs
#	crates/herdr-gpui/src/i18n/errors/tests/nearby.rs
… own line

rustfmt had pulled the keep-sorted end marker onto the match arm's
closing brace, so just check-sorted failed on main.
@penso
penso changed the base branch from fix/i18n-errors-after-905 to main October 31, 2026 19:33
@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for herdr-ui canceled.

Name Link
🔨 Latest commit ce0f250
🔍 Latest deploy log https://app.netlify.com/projects/herdr-ui/deploys/6ae66cd8030fbcdfe13f4111

penso added 2 commits October 31, 2026 14:24
Tab::label() called every tab without a location New Tab, but an editor
tab also starts without one while its server starts or waits for
license consent. It now keeps the product name the store gave it.
The debug build already takes about 17 of its 20 seconds on a shared
Windows runner, so slower runs timed out after every layout passed.
The deadline only bounds a hung fixture; just test-perf measures speed.
@penso

penso commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

…inal

Location::drawn_title() names every herdr-core terminal tab Terminal in
the window's language, so Tab::label() hid the title the active pane's
program reports. The label now keeps that title once a program sets
one and translates only the default name.
@penso

penso commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@penso
penso added this pull request to stack #950 November 1, 2026 01:44
@penso
penso merged commit e57c23d into main Nov 1, 2026
23 checks passed
@penso
penso deleted the i18n/rest-chat-browser branch November 1, 2026 02:30
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.

1 participant