Skip to content

refactor(i18n): show what the window says about undelivered input through Fluent - #959

Merged
penso merged 4 commits into
mainfrom
i18n/window-input
Nov 1, 2026
Merged

penso merged 4 commits into
mainfrom
i18n/window-input

Conversation

@penso

@penso penso commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Part of Phase 2 of docs/i18n.md, following #880, #926/#928, and #941. This PR covers what the main window says about input it could not deliver: typed keys and held input, the mouse, pastes, dropped files, images, and the file copy to an SSH device. Find, copy mode, and annotation follow in their own PR.

  • Messages: a new window-input.ftl.
    • Status line: "Input not sent: …", the disconnected flash, refused pastes and drops, wheel, mouse, scroll, and pane-resize failures, tab moves, link handlers, and resizes.
    • Notices: a discarded image or paste, a resized image, and the copy's start, completion, cancellation, failure, and cleanup.
    • The copy card: its title, file label, progress, and Cancel button.
  • Marked // i18n: migrated: pending_input, input, mouse, accessibility (including the terminal's screen-reader name), file_drop, wsl_drop, transfers, images, image_source, clipboard, tab_drag, links, and lifecycle. Test-only shell scripts in clipboard.rs, a Debug name, macOS's TemporaryItems folder, and a storage log's context are tagged // i18n: data.
  • Errors: every {error} these lines show uses localize() instead of Display/to_string(), including the copy's own errors and clipboard::Error::Busy.
  • Plurals and fragments:
    • "(N held inputs discarded)" and "N files" are selectors.
    • "Image"/"Paste" + "not sent"/"discarded" used to be glued in Rust. They are now whole sentences chosen by a kind selector.
    • The copy card's sizes (B … EiB) and "sent / total (N%)" are messages, with a unit selector.
  • Notices keep their cleaning: local_transfer_notice still passes title and body through Notice::local_feedback's safe_text, because callers outside this scope give it daemon and SSH text. Those toasts lose en-XB's direction marks, as before.
  • Tests:
    • window/images.rs moves its inline tests to images/tests.rs.
    • Existing tests that compared status lines verbatim now strip the isolation marks, through a new test-only i18n::leak_tests::unmarked.
    • New en-XA leak tests:
      • window/tests/en_xa_input.rs: the disconnected flash, a paste and a drop refused by an open menu, and a drop on nothing.
      • transfers/tests/en_xa.rs: the copy card while copying, finishing, and cancelling.
      • images/tests/en_xa.rs: a discarded image's and paste's status line and notice, with the error's own message inside.
  • Docs: none. docs/i18n.md is left as on main, because every open i18n PR edits its "What is left" list. One PR updates the list after they all merge.

No visible change in English.

Screenshots

None. Every surface here needs input the window refuses: a key typed while disconnected, a paste or drop with a menu open, or a file dropped on an SSH pane. On this machine that would mean synthetic keyboard and drag events on a display the user shares, which they've asked not to do without asking first. The en-XA leak tests draw each of these surfaces headless, and the manual checks below cover them natively.

QA

  • just format
  • just ci on 5296b3691 (macOS arm64, after merging main): passed, 16,404 tests, 0 failed
  • just lint-linux and just lint-windows on 5296b3691: passed (file_drop's cloud gate and clipboard's Linux tests changed)
  • en-XA leak tests: undelivered input (flash, refused paste and drops), the copy card in three states, and a discarded image or paste
  • Existing tests with the English unchanged apart from isolation marks
  • Drop files on an SSH pane under en-XA: the copy card's title, progress ("… KiB / … MiB (…%)"), and Cancel read in en-XA, and the completion notice too
  • Paste an image too large to send under en-XA: the status line and the "Image discarded" notice read in en-XA
  • English: these lines read as before

penso added 3 commits October 31, 2026 21:14
…ough Fluent

Part of Phase 2 of docs/i18n.md. The main window's status line, flashes,
and notices for input it could not deliver now come from window-input.ftl:
typed keys and held input, the mouse, pastes, dropped files, images, the
file copy to an SSH device and its card, tab drags, link handlers, and
resizes. Errors there use localize() instead of to_string().

Hand-built plurals become selectors (held inputs discarded, files
copying), the copy card's sizes and progress are messages with a unit
selector, and the image kind ("Image" or "Paste") picks a whole sentence.
The inline tests of window/images.rs move to images/tests.rs.
The status line now builds these lines from messages, so the tests that
compared them verbatim strip the marks Fluent puts around each
placeable, through a shared i18n::leak_tests::unmarked.
@netlify

netlify Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for herdr-ui canceled.

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

@penso

penso commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

just ci ran locally and passed on 5296b3691 (macOS arm64): 16,404 tests, 0 failed. just lint-linux and just lint-windows also passed on 5296b3691.

@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue was found.

Summary

Moves undelivered-input feedback and the SSH copy card into Fluent messages.

  • The window explains undelivered input in the selected language.
  • Image and paste failures appear in translated status lines and notices.
  • SSH file-copy progress and notices use translated messages.

No actionable issues were found. The previous-review merge-base check failed, so the full PR was reviewed.

Reviews (2) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@penso

penso commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai review

@penso
penso merged commit dcaa783 into main Nov 1, 2026
18 of 22 checks passed
@penso
penso deleted the i18n/window-input branch November 1, 2026 21:18
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