S046: plan for 0.1.1 fixes (server names, raise on arrival, copy in fields)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-26 12:32:46 -06:00
commit 51dc36f519
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,29 @@
# S046 — 0.1.1: names from the server, raise on arrival, copy in fields
> Category 10 Distribution · Model: Sonnet · Effort: medium · Depends on: S045 · Phase: test · Human: 🧑 yes before release
> Files touched: crates/core/src/http/name.rs and its callers, crates/core/src/connector/**, crates/app/src/views/{incoming,add}/**, crates/app/src/keys.rs, crates/app/src/app.rs, version files, docs/releases/0.1.1.md, docs/tests/S046-fixes-0.1.1.md
## Goal
Three bugs the user found with 0.1.0 (Nacre on a real site):
1. **Name**: the browser hands over a provisional name (`output.bin`) at click time; the real name (archive) only comes with the server's reply (Content-Disposition, or the final link after redirects). Medlar keeps the sender's name, so the file stays `output.bin`.
2. **No raise**: a pushed download does not bring Medlar forward. `incoming.rs` sends `ViewportCommand::Focus` only, which Wayland (niri) ignores without an activation token, and does nothing when the window is hidden to the tray.
3. **Copy in fields**: in Settings (and every text field) Ctrl+C does not copy: `keys::pressed` lets the list's Copy shortcut (Ctrl+C) and Select all (Ctrl+A) eat the events while a text field has focus (`taken()` covers V, X, Z only).
## Read
- crates/core/src/http/name.rs (`pick`), where a task's name is set from a sender or the Add dialog and where the first reply is handled (rg `pick(`)
- crates/app/src/views/incoming.rs (`tick`, `ask`), app.rs lines ~255-330 (show/hide), crates/app/src/keys.rs (`pressed`, `taken`, `fits`)
- docs/CONNECTOR.md (`filename` field)
## Steps
- [ ] Name: a name from a sender (connector `filename`, or the Add dialog when the user did not type it) is a hint. On the first reply, when the hint is generic (no extension, or an extension like bin, php, asp, aspx, cgi, html, htm, download, or a known placeholder such as `output.bin`, `download`, `file`) and the reply gives a name (Content-Disposition, else the final link with a file extension), use the reply's name, made safe as today, before any file is created; a name the user typed always wins; collisions handled as today (never overwrite). The Add dialog's probe updates the shown name the same way while the user has not edited it. Unit tests in name.rs and an engine test against testserver (provisional name + Content-Disposition, and a redirect to a named link)
- [ ] Raise: on an arrival that shows the Add window or adds a download, if the main window is hidden show it (`Visible(true)`, `Minimized(false)`), then `Focus` and `RequestUserAttention(Critical)` (urgency where focus is refused); same for second-instance hand-over; clear the attention when the window gets focus. A kittest that records the viewport commands
- [ ] Copy: while a text field has focus, Ctrl+C, Ctrl+A (and Ctrl+X, Ctrl+V, Ctrl+Z as now) go to the field, not to list shortcuts; settings values that are read-only text (paths, versions, the port, the token) are selectable or have a copy button where egui allows. Unit test for `pressed` with a focused field
- [ ] Full workspace suite once (absolute TMPDIR), then release build; hidden smoke test: POST a link with `filename: output.bin` to a testserver URL that answers with Content-Disposition `game.zip`: Add window shows and the file is `game.zip`; window raised in the grab
- [ ] Version 0.1.1 everywhere (Cargo, metainfo, PKGBUILD, .SRCINFO); `tools/package.sh` builds tar.gz, AppImage, Arch package and `SHA256SUMS-0.1.1` in dist/; `docs/releases/0.1.1.md`; nothing into releases/
- [ ] Test file `docs/tests/S046-fixes-0.1.1.md` with Results, PROGRESS entry, tick INDEX, commit `S046: …`, `git push origin HEAD`
## End criteria
- the three bugs have passing regression tests; suite green; builds smoke-tested
## Pitfalls
File names from servers are hostile: same `safe` rules as today. Never rename over an existing file. Never contact the real site; testserver on loopback only. Release only after the user's yes.

View file

@ -66,6 +66,7 @@ Tracker: https://claude.ai/artifact/XouimfVJS6FYVKskGJ8s7H
## 10 Distribution
- [x] [S045](10%20Distribution/S045-installer-arch.md) installer.sh and Arch package
- [ ] [S046](10%20Distribution/S046-fixes-0.1.1.md) 0.1.1: names from the server, raise on arrival, copy in fields
## Later (after version 1; not run by /orchestrate)