Text chat 26: Upload tray, drop overlay, attachment modals, paste (#276) #413

Manually merged
charles merged 6 commits from textchat-26-ui-upload-tray into textchat 2026-11-13 08:46:34 +00:00
Owner

Text chat 26: the upload tray, the drop overlay, the attachment modals and image paste (spec §3.3, §8, §9.2).

Stacked on: textchat-25-ui-composer (already merged into textchat; its only extra commit, a merge of textchat, was resolved to the textchat side).

What I built

  • Upload tray (screens/main/composer/attachments.rs, ChannelAttachmentArea.{tsx,module.css}): a row of 12.5 rem tiles inside the composer box, above the text, in send order (selectors::upload_tray). Each tile shows the getFileIcon icon, the name, the size and the extension (getFileExtension, 1 to 4 characters). Each also has the spoiler / edit / remove bar (Phosphor fill icons, tooltips). A spoiler tile is covered until you click it. You can drag a tile to reorder: press, move, then release on another tile. A 2 px line shows which side it will land on, and the drop sends MoveAttachment at drop_index, which follows the original's handleAttachmentDrop formula. The Send button is now enabled when the tray has files and there is no text.
  • Edit attachment (modals/attachment_edit.rs): file name (up to 512 characters), alt text for images and videos only (up to 4096, with an n/4,096 counter), and "Mark as spoiler". Cancel or Save; Save sends EditAttachment.
  • Refused-file alerts (modals/upload_errors.rs): "File size too large", "Whoa, this is heavy" and "Can't upload files here", shown from chat.uploads.refusal. As on desktop in the original, there is a header X and no footer. Closing an alert sends the new UserAction::DismissUploadRefusal.
  • Drop overlay (modals/drop_overlay.rs, UploadDropModal): "Upload to #general", or "Upload directly to #general" while Shift is held. During slowmode, Shift does not send directly. Escape hides the card, but the drop still attaches the files, as in the original. The dropped paths go to the store as CoreEvent::Files with Attach or AttachAndSend.
  • Progress cards (MessageUploadProgress): the pending message of an upload job shows one card per file with its name, size, a progress bar (red once the job fails) and "Cancel upload" (CancelUpload).
  • Paste: Ctrl+V in the composer reads ClipboardImages::read_image first. If there is an image, it goes to AddFiles as image.png. Otherwise the text from iced's clipboard is pasted. Pasted text over the message limit becomes message.txt (the store gets the pasted text, then PasteLongText, then the draft back), and the draft is left unchanged. The inline edit box keeps the editor's own paste.
  • widgets::modal: a general modal (backdrop, centred card, Escape) with the standard header, content and footer card (Modal.module.css, small: 27.5 rem).

Deviations and cross-crate changes (please review)

  • fluxer-core: I added UserAction::DismissUploadRefusal (one variant, one arm in uploads.rs, a test and a README line). Without it the refusal stays until a later add succeeds, so the UI cannot reopen the alert for a second, identical refusal.
  • New injected trait files::LocalFiles (describe(paths) -> BoxFuture<Vec<FileRef>>, keep_pasted(png) -> FileRef). It is implemented by apps/fluxer's Desktop: a dropped file's size and type are read on a plain thread, and pasted PNGs are kept in PastedImages under FileSource::Clipboard. This was needed because the UI cannot hold the runtime's types (#365). fluxer_ui::run takes it as a new local_files argument. CLAUDE.md's list of sanctioned injected traits now names it, and the READMEs are updated.
  • I touched widgets/message_row.rs and screens/main/messages.rs for the progress cards and CancelUpload, and screens/main/mod.rs to draw the modals.
  • Tiles show the file-type icon, not a preview of an image or video, because the UI reads no file contents.
  • The file-size alert uses the text for an unknown number of files plus the instance-administrator sentence. There is no Plutonium upsell.
  • Wayland: winit 0.30 delivers no file drops (see the fluxer-platform README), so under Wayland the overlay never shows. It works on X11/XWayland and Windows.

Testing

  • crates/fluxer-ui/tests/uploads.rs (7 tests, no GPU): tray_tiles_and_actions_emit, drag_reorder_emits_move, edit_modal_limits, refusal_opens_matching_modal, drop_overlay_shift_sends_directly, paste_image_becomes_file, progress_row_cancel. In fluxer-core: dismissing_the_refusal_clears_it.
  • 4 new screenshot tests: upload_tray, upload_drop_overlay, attachment_edit_modal and upload_progress. The goldens were made on lavapipe in the Ubuntu 22.04 image (fluxer-native-shots:u2204). All 55 fluxer-ui screenshot tests pass there. The app's view comes from the fork's CSS files named in each test; I have no Electron reference image.
  • cargo xtask ci is green on the host. FLUXER_SCREENSHOT_TESTS=1 could not run the whole workspace inside the 22.04 image, because its libspa is too old for fluxer-capture. So the ignored tests ran with cargo test -p fluxer-ui -- --ignored in that image instead.
  • apps/fluxer --lib sometimes aborts at exit with a futex error after all its tests pass. This is the known #338, which also happens without this change.
  • No real-desktop tests ran: no drop or paste was tried by hand.

Closes #276

🤖 Generated with Claude Code

Text chat 26: the upload tray, the drop overlay, the attachment modals and image paste (spec §3.3, §8, §9.2). Stacked on: textchat-25-ui-composer (already merged into textchat; its only extra commit, a merge of textchat, was resolved to the textchat side). ## What I built - **Upload tray** (`screens/main/composer/attachments.rs`, `ChannelAttachmentArea.{tsx,module.css}`): a row of 12.5 rem tiles inside the composer box, above the text, in send order (`selectors::upload_tray`). Each tile shows the `getFileIcon` icon, the name, the size and the extension (`getFileExtension`, 1 to 4 characters). Each also has the spoiler / edit / remove bar (Phosphor fill icons, tooltips). A spoiler tile is covered until you click it. You can drag a tile to reorder: press, move, then release on another tile. A 2 px line shows which side it will land on, and the drop sends `MoveAttachment` at `drop_index`, which follows the original's `handleAttachmentDrop` formula. The Send button is now enabled when the tray has files and there is no text. - **Edit attachment** (`modals/attachment_edit.rs`): file name (up to 512 characters), alt text for images and videos only (up to 4096, with an `n/4,096` counter), and "Mark as spoiler". Cancel or Save; Save sends `EditAttachment`. - **Refused-file alerts** (`modals/upload_errors.rs`): "File size too large", "Whoa, this is heavy" and "Can't upload files here", shown from `chat.uploads.refusal`. As on desktop in the original, there is a header X and no footer. Closing an alert sends the new `UserAction::DismissUploadRefusal`. - **Drop overlay** (`modals/drop_overlay.rs`, `UploadDropModal`): "Upload to #general", or "Upload directly to #general" while Shift is held. During slowmode, Shift does not send directly. Escape hides the card, but the drop still attaches the files, as in the original. The dropped paths go to the store as `CoreEvent::Files` with `Attach` or `AttachAndSend`. - **Progress cards** (`MessageUploadProgress`): the pending message of an upload job shows one card per file with its name, size, a progress bar (red once the job fails) and "Cancel upload" (`CancelUpload`). - **Paste:** Ctrl+V in the composer reads `ClipboardImages::read_image` first. If there is an image, it goes to `AddFiles` as `image.png`. Otherwise the text from iced's clipboard is pasted. Pasted text over the message limit becomes `message.txt` (the store gets the pasted text, then `PasteLongText`, then the draft back), and the draft is left unchanged. The inline edit box keeps the editor's own paste. - **`widgets::modal`:** a general modal (backdrop, centred card, Escape) with the standard header, content and footer card (`Modal.module.css`, small: 27.5 rem). ## Deviations and cross-crate changes (please review) - **fluxer-core:** I added `UserAction::DismissUploadRefusal` (one variant, one arm in `uploads.rs`, a test and a README line). Without it the refusal stays until a later add succeeds, so the UI cannot reopen the alert for a second, identical refusal. - **New injected trait `files::LocalFiles`** (`describe(paths) -> BoxFuture<Vec<FileRef>>`, `keep_pasted(png) -> FileRef`). It is implemented by `apps/fluxer`'s `Desktop`: a dropped file's size and type are read on a plain thread, and pasted PNGs are kept in `PastedImages` under `FileSource::Clipboard`. This was needed because the UI cannot hold the runtime's types (#365). `fluxer_ui::run` takes it as a new `local_files` argument. CLAUDE.md's list of sanctioned injected traits now names it, and the READMEs are updated. - I touched `widgets/message_row.rs` and `screens/main/messages.rs` for the progress cards and `CancelUpload`, and `screens/main/mod.rs` to draw the modals. - Tiles show the file-type icon, not a preview of an image or video, because the UI reads no file contents. - The file-size alert uses the text for an unknown number of files plus the instance-administrator sentence. There is no Plutonium upsell. - Wayland: winit 0.30 delivers no file drops (see the fluxer-platform README), so under Wayland the overlay never shows. It works on X11/XWayland and Windows. ## Testing - `crates/fluxer-ui/tests/uploads.rs` (7 tests, no GPU): `tray_tiles_and_actions_emit`, `drag_reorder_emits_move`, `edit_modal_limits`, `refusal_opens_matching_modal`, `drop_overlay_shift_sends_directly`, `paste_image_becomes_file`, `progress_row_cancel`. In `fluxer-core`: `dismissing_the_refusal_clears_it`. - 4 new screenshot tests: `upload_tray`, `upload_drop_overlay`, `attachment_edit_modal` and `upload_progress`. The goldens were made on lavapipe in the Ubuntu 22.04 image (`fluxer-native-shots:u2204`). All 55 `fluxer-ui` screenshot tests pass there. The app's view comes from the fork's CSS files named in each test; I have no Electron reference image. - `cargo xtask ci` is green on the host. `FLUXER_SCREENSHOT_TESTS=1` could not run the whole workspace inside the 22.04 image, because its libspa is too old for `fluxer-capture`. So the ignored tests ran with `cargo test -p fluxer-ui -- --ignored` in that image instead. - `apps/fluxer --lib` sometimes aborts at exit with a futex error after all its tests pass. This is the known #338, which also happens without this change. - No real-desktop tests ran: no drop or paste was tried by hand. Closes #276 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Text chat 21-24 landed. The inline edit box now replaces only the text in
the new message row (attachments, embeds, stickers, forward and reactions
stay below it); the row's new events are routed next to the editor's. The
13 goldens Text chat 22-24 added were regenerated on lavapipe: only the
list's position moved, the composer box being taller.

Refs #275

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-ui/README.md
#	crates/fluxer-ui/src/screens/main/media.rs
#	crates/fluxer-ui/src/screens/main/messages.rs
#	crates/fluxer-ui/src/theme/icons.rs
#	crates/fluxer-ui/src/widgets/message_row.rs
#	crates/fluxer-ui/tests/screenshots.rs
#	docs/screenshots/README.md
#	fixtures/golden/attachment_file_card.png
#	fixtures/golden/attachment_spoiler.png
#	fixtures/golden/attachments_mosaic_4.png
#	fixtures/golden/attachments_mosaic_7.png
#	fixtures/golden/embed_article.png
#	fixtures/golden/embed_gifv.png
#	fixtures/golden/embed_rich_fields.png
#	fixtures/golden/embed_youtube.png
#	fixtures/golden/message_forwarded.png
#	fixtures/golden/message_reactions.png
#	fixtures/golden/message_reply.png
#	fixtures/golden/message_system_pin.png
#	fixtures/golden/reactors_modal.png
The refusal of chat.uploads stayed until the next files were added, so the
UI could not tell a second identical refusal from the one already shown.
Closing the modal now clears it.

Refs #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The composer's upload tray (12.5 rem tiles, spoiler/edit/remove bar, drag to
reorder), the Edit attachment modal (filename <= 512, alt text <= 4096,
spoiler switch), the refused-files alerts (File size too large, Whoa this is
heavy, Can't upload files here), the drop overlay (Upload to #name, Shift
sends at once), the progress cards of a message on its way with Cancel
upload, and Ctrl+V pasting clipboard images as files (long text becomes
message.txt). A general widgets::modal backs the modals.

Dropped paths and pasted PNGs become FileRefs through a new injected trait,
files::LocalFiles, implemented by apps/fluxer's Desktop (closes the gap of
#365).

Refs #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Text chat 26 (upload tray, drop overlay, attachment modals, paste)

Reviewed git diff 2e03927e..origin/textchat-26-ui-upload-tray (head 4e32a4c), read cold.

Plan checks

  • Tests: all 7 named tests are in crates/fluxer-ui/tests/uploads.rs (tray_tiles_and_actions_emit, drag_reorder_emits_move, edit_modal_limits, refusal_opens_matching_modal, drop_overlay_shift_sends_directly, paste_image_becomes_file, progress_row_cancel), and all 4 goldens are there (upload_tray, upload_drop_overlay, attachment_edit_modal, upload_progress). They check the spec's values: filename limit 512, alt text limit 4096, the original's strings, Shift sends at once, Escape, message.txt over 2000 UTF-16 units, Cancel upload.
  • Interfaces: AttachmentEditModal, the two refusal modals (plus NoPermission), the drop overlay, the progress row with "Cancel upload" and Ctrl+V reading ClipboardImages::read_image first are all present. drop_index copies ChannelAttachmentArea.handleAttachmentDrop exactly, quirk included. The widgets::modal is generic.
  • Invariants: fluxer-core only gains UserAction::DismissUploadRefusal, with a core test, and no new dependency. LocalFiles is injected, called only through Task::perform/Task::future, and implemented in apps/fluxer. CLAUDE.md's exception list is updated to match. No paths, URLs or file contents are logged: upload_files::open errors carry no path. No new fixtures.
  • Local cargo xtask ci in the review worktree: green (exit 0).

Findings

  1. blocking: pasting long text wipes the draft's mention spans (user data / sent content). composer::paste_text in crates/fluxer-ui/src/screens/main/composer/mod.rs sends three actions: ComposerEdited { text: <pasted> }, then PasteLongText, then ComposerEdited { text: <old draft> }.
    • The first one runs adjust_spans (fluxer-core/src/chat/composer.rs:1190), which drops every span the replaced text covers.
    • text_to_file then calls draft.mentions.clear().
    • Restoring the text does not bring the spans back.
    • Example: type "hey @alice " and pick her from autocomplete, then paste a 3000-character log. The message.txt is attached and the box still reads "hey @alice ", but the send carries plain @alice, not <@id>, so nobody is pinged. The original's handlePasteExceedsLimit leaves the draft alone.
    • The detour also sends a typing event and schedules a draft save of the pasted text.
    • Suggested fix: make the file without going through the draft. Either LocalFiles/the UI builds a FileRef { source: FileSource::Text(text), name: "message.txt", .. } and sends it with AddFiles, or core gets an action that carries the text.
    • Please extend paste_image_becomes_file so the draft holds a mention span and still has it after the long paste.
  2. minor: the drop overlay can get stuck. FileHovered sets drop.hovering whenever settings and the soundboard upload are closed. FileDropped only clears it (State::dropped) when messages.channel() is Some. A drop with no channel open (winit sends no FilesHoveredLeft after a drop) leaves hovering == true. The next text channel opened then shows the opaque overlay, which blocks input until Escape. Fix: call drop.left() (or reset) in the FileDropped branch that does not take the file, and when settings are open.
  3. minor: DropsEnded is queued with Task::done on the first FileDropped. This relies on every FileDropped of the same drop being handled before the queued message. If iced splits them across batches, the rest form a second drop, and with Shift held that sends two messages. Worth a comment or a check on a real X11/Windows drop; no change is required.
  4. minor (process): the implementer says the TDD order was not followed for the UI tests. Since then, the tests have been verified to assert the plan's behaviour. No action.

Verdict: changes requested. One blocking finding (1). CI is green locally; findings 2 and 3 are optional.

## Independent review: Text chat 26 (upload tray, drop overlay, attachment modals, paste) Reviewed `git diff 2e03927e..origin/textchat-26-ui-upload-tray` (head 4e32a4c), read cold. **Plan checks** - Tests: all 7 named tests are in `crates/fluxer-ui/tests/uploads.rs` (`tray_tiles_and_actions_emit`, `drag_reorder_emits_move`, `edit_modal_limits`, `refusal_opens_matching_modal`, `drop_overlay_shift_sends_directly`, `paste_image_becomes_file`, `progress_row_cancel`), and all 4 goldens are there (`upload_tray`, `upload_drop_overlay`, `attachment_edit_modal`, `upload_progress`). They check the spec's values: filename limit 512, alt text limit 4096, the original's strings, Shift sends at once, Escape, message.txt over 2000 UTF-16 units, Cancel upload. - Interfaces: `AttachmentEditModal`, the two refusal modals (plus `NoPermission`), the drop overlay, the progress row with "Cancel upload" and Ctrl+V reading `ClipboardImages::read_image` first are all present. `drop_index` copies `ChannelAttachmentArea.handleAttachmentDrop` exactly, quirk included. The `widgets::modal` is generic. - Invariants: fluxer-core only gains `UserAction::DismissUploadRefusal`, with a core test, and no new dependency. `LocalFiles` is injected, called only through `Task::perform`/`Task::future`, and implemented in `apps/fluxer`. CLAUDE.md's exception list is updated to match. No paths, URLs or file contents are logged: `upload_files::open` errors carry no path. No new fixtures. - Local `cargo xtask ci` in the review worktree: **green** (exit 0). **Findings** 1. **blocking**: pasting long text wipes the draft's mention spans (user data / sent content). `composer::paste_text` in `crates/fluxer-ui/src/screens/main/composer/mod.rs` sends three actions: `ComposerEdited { text: <pasted> }`, then `PasteLongText`, then `ComposerEdited { text: <old draft> }`. - The first one runs `adjust_spans` (`fluxer-core/src/chat/composer.rs:1190`), which drops every span the replaced text covers. - `text_to_file` then calls `draft.mentions.clear()`. - Restoring the text does not bring the spans back. - Example: type "hey @alice " and pick her from autocomplete, then paste a 3000-character log. The message.txt is attached and the box still reads "hey @alice ", but the send carries plain `@alice`, not `<@id>`, so nobody is pinged. The original's `handlePasteExceedsLimit` leaves the draft alone. - The detour also sends a typing event and schedules a draft save of the pasted text. - Suggested fix: make the file without going through the draft. Either `LocalFiles`/the UI builds a `FileRef { source: FileSource::Text(text), name: "message.txt", .. }` and sends it with `AddFiles`, or core gets an action that carries the text. - Please extend `paste_image_becomes_file` so the draft holds a mention span and still has it after the long paste. 2. **minor**: the drop overlay can get stuck. `FileHovered` sets `drop.hovering` whenever settings and the soundboard upload are closed. `FileDropped` only clears it (`State::dropped`) when `messages.channel()` is `Some`. A drop with no channel open (winit sends no `FilesHoveredLeft` after a drop) leaves `hovering == true`. The next text channel opened then shows the `opaque` overlay, which blocks input until Escape. Fix: call `drop.left()` (or reset) in the `FileDropped` branch that does not take the file, and when settings are open. 3. **minor**: `DropsEnded` is queued with `Task::done` on the first `FileDropped`. This relies on every `FileDropped` of the same drop being handled before the queued message. If iced splits them across batches, the rest form a second drop, and with Shift held that sends two messages. Worth a comment or a check on a real X11/Windows drop; no change is required. 4. **minor (process)**: the implementer says the TDD order was not followed for the UI tests. Since then, the tests have been verified to assert the plan's behaviour. No action. **Verdict: changes requested.** One blocking finding (1). CI is green locally; findings 2 and 3 are optional.
Text pasted over the length limit is now added to the tray directly
(AddFiles with a FileSource::Text message.txt) instead of passing through
the draft with ComposerEdited/PasteLongText/ComposerEdited. The draft keeps
its mention spans, and no typing event or draft save of the pasted text
goes out. paste_image_becomes_file checks that an autocompleted mention
span survives a long paste.

A file dropped while no composer takes it (no channel open, settings
shown) now ends the hover, so the drop overlay does not come up with the
next channel.

Refs #276

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Review round 1 addressed in 05d722a:

  • Blocking, composer/mod.rs paste_text loses mention spans: fixed. Text pasted over the length limit is now one UserAction::AddFiles with a message.txt FileRef (FileSource::Text, text/plain, ids in a range of their own, bit 62, which neither the runtime's counter nor core's text files (bit 63) reach). The draft is not touched, so its text, cursor and mention spans stay, and no typing event or draft save of the pasted text goes out. Test first: paste_image_becomes_file now autocompletes @ada into the draft, does the long paste, and checks there is exactly one AddFiles, the draft's text, cursor and mentions are unchanged, and a second long paste gets a different id. It failed on the old code with the three-action detour. "Upload your message as a file" still uses PasteLongText, which is right there because the draft is what becomes the file. README updated.
  • Minor, app.rs hover stuck after a drop with no channel: fixed. A FileDropped that no composer takes (no channel open, or the settings shown) now calls drop.left(), so the overlay does not come up with the next channel. The shell's update cannot be built in tests (Shell is private), so this one has no test of its own. The state change it uses is covered by drop_overlay_shift_sends_directly.
  • Minor, app.rs DropsEnded with split batches: deferred to #416 (follow-up). winit 0.30 sends all of a drop's paths from one platform callback, before AboutToWait and before any proxy message, so nothing splits today. A real fix needs a debounce timer, and fluxer-ui has none without I/O (iced is built without tokio/smol).
  • Minor, tests/uploads.rs TDD order: no action needed, as the finding says.

Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green.

Review round 1 addressed in 05d722a: - **Blocking, `composer/mod.rs` paste_text loses mention spans**: fixed. Text pasted over the length limit is now one `UserAction::AddFiles` with a `message.txt` `FileRef` (`FileSource::Text`, `text/plain`, ids in a range of their own, bit 62, which neither the runtime's counter nor core's text files (bit 63) reach). The draft is not touched, so its text, cursor and mention spans stay, and no typing event or draft save of the pasted text goes out. Test first: `paste_image_becomes_file` now autocompletes `@ada` into the draft, does the long paste, and checks there is exactly one `AddFiles`, the draft's text, cursor and `mentions` are unchanged, and a second long paste gets a different id. It failed on the old code with the three-action detour. "Upload your message as a file" still uses `PasteLongText`, which is right there because the draft is what becomes the file. README updated. - **Minor, `app.rs` hover stuck after a drop with no channel**: fixed. A `FileDropped` that no composer takes (no channel open, or the settings shown) now calls `drop.left()`, so the overlay does not come up with the next channel. The shell's `update` cannot be built in tests (`Shell` is private), so this one has no test of its own. The state change it uses is covered by `drop_overlay_shift_sends_directly`. - **Minor, `app.rs` DropsEnded with split batches**: deferred to #416 (follow-up). winit 0.30 sends all of a drop's paths from one platform callback, before `AboutToWait` and before any proxy message, so nothing splits today. A real fix needs a debounce timer, and fluxer-ui has none without I/O (iced is built without tokio/smol). - **Minor, `tests/uploads.rs` TDD order**: no action needed, as the finding says. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green.
Author
Owner

Independent review: Text chat 26 (upload tray, drop overlay, attachment modals, paste)

Reviewed the task's own commits on origin/textchat-26-ui-upload-tray @ 05d722a (df5c99c, 4e32a4c, 05d722a; the merged Text chat 25 code is out of scope).

Tests named by the plan. All seven are present in crates/fluxer-ui/tests/uploads.rs and assert what the plan says: tray_tiles_and_actions_emit, drag_reorder_emits_move (drop_index matches ChannelAttachmentArea.handleAttachmentDrop line for line), edit_modal_limits (512 and 4096), refusal_opens_matching_modal (the original's three titles and texts), drop_overlay_shift_sends_directly (UploadDropModal strings), paste_image_becomes_file, progress_row_cancel. The four goldens are upload_tray, upload_drop_overlay, attachment_edit_modal and upload_progress.

Interfaces. The tray (spoiler, edit and remove bar; drag → MoveAttachment), AttachmentEditModal, the TooLarge, TooMany and NoPermission alerts, the drop overlay (Shift, Escape), the progress row with "Cancel upload" → CancelUpload, and Ctrl+V reading ClipboardImages::read_image first are all present.

Invariants. fluxer-core gets no new dependency, and file bytes stay out of it: pasted images are FileSource::Clipboard(handle), kept by the runtime. fluxer-ui does no I/O of its own. No paths or URLs are logged: the describe error path logs the FileError only, which carries no path. No Cargo changes. Server data cannot panic the client: every index goes through get or a bounds check.

Local gate. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green (EXIT 0). The four screenshot tests ran and passed.

Findings

  1. minor: this adds a new injected service, files::LocalFiles, and amends CLAUDE.md's sanctioned-I/O list to name it. Neither the plan nor the review checklist lists that trait. describe is called through Task::future. keep_pasted is a synchronous call inside a Task::then closure and does no I/O: it is an in-memory store in the runtime. The shape matches the other traits, but the contract change needs Charles's explicit OK.
  2. minor: the task leaves its declared crate. It adds UserAction::DismissUploadRefusal to fluxer-core (with a test) and wires LocalFiles in apps/fluxer, but the plan lists fluxer-ui files only. The change is additive. Other open branches with exhaustive UserAction matches, or with an every_chat_action list, may need a one-line merge fix.
  3. minor: attachment_edit caps the filename and alt text by Unicode scalar values (chars()). HTML maxLength counts UTF-16 units, so text with astral characters (emoji) can be up to about twice the original's length in UTF-16 units. Worth checking against the server's validator.
  4. minor: the original replaces tabs with 4 spaces before its long-paste length check (useChannelComposerPaste). paste_text does not, so the threshold differs slightly for tabbed text.
  5. minor: a multi-file drop relies on every FileDropped arriving before the Task::done(DropsEnded) it queues. If a later file arrives after the take, it becomes a second CoreEvent::Files. With Shift held, that means a second message. Shift is also only known through ModifiersChanged, which an unfocused window may not receive while an external drag is in progress.

None of these break another task's interface, lose data or leak anything.

Verdict: approve. Nothing blocks. CI is green locally. Findings 1 and 2 need Charles's acknowledgement of the CLAUDE.md change.

## Independent review: Text chat 26 (upload tray, drop overlay, attachment modals, paste) Reviewed the task's own commits on `origin/textchat-26-ui-upload-tray` @ 05d722a (df5c99c, 4e32a4c, 05d722a; the merged Text chat 25 code is out of scope). **Tests named by the plan.** All seven are present in `crates/fluxer-ui/tests/uploads.rs` and assert what the plan says: `tray_tiles_and_actions_emit`, `drag_reorder_emits_move` (`drop_index` matches `ChannelAttachmentArea.handleAttachmentDrop` line for line), `edit_modal_limits` (512 and 4096), `refusal_opens_matching_modal` (the original's three titles and texts), `drop_overlay_shift_sends_directly` (`UploadDropModal` strings), `paste_image_becomes_file`, `progress_row_cancel`. The four goldens are `upload_tray`, `upload_drop_overlay`, `attachment_edit_modal` and `upload_progress`. **Interfaces.** The tray (spoiler, edit and remove bar; drag → `MoveAttachment`), `AttachmentEditModal`, the TooLarge, TooMany and NoPermission alerts, the drop overlay (Shift, Escape), the progress row with "Cancel upload" → `CancelUpload`, and Ctrl+V reading `ClipboardImages::read_image` first are all present. **Invariants.** fluxer-core gets no new dependency, and file bytes stay out of it: pasted images are `FileSource::Clipboard(handle)`, kept by the runtime. fluxer-ui does no I/O of its own. No paths or URLs are logged: the `describe` error path logs the `FileError` only, which carries no path. No Cargo changes. Server data cannot panic the client: every index goes through `get` or a bounds check. **Local gate.** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green (EXIT 0). The four screenshot tests ran and passed. ### Findings 1. **minor**: this adds a new injected service, `files::LocalFiles`, and amends CLAUDE.md's sanctioned-I/O list to name it. Neither the plan nor the review checklist lists that trait. `describe` is called through `Task::future`. `keep_pasted` is a synchronous call inside a `Task::then` closure and does no I/O: it is an in-memory store in the runtime. The shape matches the other traits, but the contract change needs Charles's explicit OK. 2. **minor**: the task leaves its declared crate. It adds `UserAction::DismissUploadRefusal` to fluxer-core (with a test) and wires `LocalFiles` in `apps/fluxer`, but the plan lists fluxer-ui files only. The change is additive. Other open branches with exhaustive `UserAction` matches, or with an `every_chat_action` list, may need a one-line merge fix. 3. **minor**: `attachment_edit` caps the filename and alt text by Unicode scalar values (`chars()`). HTML `maxLength` counts UTF-16 units, so text with astral characters (emoji) can be up to about twice the original's length in UTF-16 units. Worth checking against the server's validator. 4. **minor**: the original replaces tabs with 4 spaces before its long-paste length check (`useChannelComposerPaste`). `paste_text` does not, so the threshold differs slightly for tabbed text. 5. **minor**: a multi-file drop relies on every `FileDropped` arriving before the `Task::done(DropsEnded)` it queues. If a later file arrives after the take, it becomes a second `CoreEvent::Files`. With Shift held, that means a second message. Shift is also only known through `ModifiersChanged`, which an unfocused window may not receive while an external drag is in progress. None of these break another task's interface, lose data or leak anything. **Verdict: approve.** Nothing blocks. CI is green locally. Findings 1 and 2 need Charles's acknowledgement of the CLAUDE.md change.
charles manually merged commit 15154126d0 into textchat 2026-11-13 08:46:26 +00:00
Sign in to join this conversation.
No description provided.