Repository navigation
Conversation
MessagePromptComposer, the shared message composer both frontends inherit, now holds the files it will send with the text. Attach opens the picker that ui.input.file_picker names (the file dialog, or the project path search); a picked file becomes the FileUpload Core checks again. Each frontend answers only its pickers and how attached files are drawn. The files ride the submission: UserInputSubmitted, InputSubmission and TypedText carry them, and the bus send hands them to comms_user_send. A send that does not land returns its whole draft: SubmissionView restores text and files once, replacing the two frontends' copied restore bodies, and each frontend says only where a failure is shown. ProjectPaths is the project's path listing and ranking without a toolkit, for the path search pickers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… editor, two pickers QtMessageComposer is the shared message composer with Qt's answers; the channel, direct-message and mailbox composers inherit it, and the agent composer does not, so its keys and buttons never offer Attach. Each composer kind declares the actions it binds (action_methods) instead of one module list. Attach opens QFileDialog, which on Android Qt answers with the system document picker: its content:// URL is read through QFile, never more than one byte past what the message can still carry. On a desktop the setting may choose the project path search instead; QtPathSearch inherits ProjectPathSearch, the listing and ranking the TUI's path search shares. A chip is a QtAttachedFileChip over the shared AttachedFileChip. The shipped run opens Attach on the channel and the thread and closes it without picking; the attach scenario picks a file through the dialog and sends it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Textual's Button renders its label reactive and Widget.remove leaves the DOM. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…h, and chips Textual's MessagePrompt answers the shared composer's pickers. The file browser opens at the project and can leave it (backspace goes up); the path search ranks the project's paths. Either reads the chosen file through the shared attach_path, bounded at read_limit, and Escape attaches nothing. Attached files show as chips above the text (AttachedFileChip); pressing one takes it off, and a send that does not land returns them. ctrl+t (AttachFileAction) belongs to a MessageAction family that only MessageTextArea declares, so an agent prompt binds no attach key. PathSearch now inherits ProjectPathSearch: its scan, spelling and ranking copies are deleted, so the @ completion and the pickers list one way. Textual's Prompt answers show_failure where its conversation shows a send failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… and opens it A message's files are rows beside the bus, read once per page: WireSource.read for a wire page and, for a thread transcript, the page's TranscriptPages source (the view's TranscriptPresentation, through CoordinationTranscriptReader off the UI thread) before the page goes to the render workers. Each read is one comms_message_files call per conversation the page holds, never one per message. MessageRow.file_reader derives whose read a message's files are, once: a channel message in its channel, a direct message in the DM with the participant that is not the reader. BusMessageRow names the row every transcript event draws, so the fragment consumer and the file read share it. MessageLines is the one parent of both message fragment bases: leading blocks, text, the file chips (only the part carrying the status draws them), then what trails. It replaces the two identical blocks() copies. A chip is a Span linked by MessageFileLink, so both frontends draw it as the spans they already draw. OpensLineLinks opens the link: it fetches the bytes through the view's coordination access, refuses bytes whose SHA-256 differs from the listed one, keeps them under the data folder by digest, and hands the path to the frontend's show_file (Textual previews it as a project file; Qt opens it with the system's handler). A refusal or a lost connection reaches warn_link. SavedTranscript's loader is now a TranscriptPages source that answers a page and its files; LoadedTranscriptPages wraps a load function with no file store (an attached history). Test callers move to the render task's signature, which repairs five tests that already failed on main for want of the fragment classes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…channel Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… Android PySide's QUrl.toString takes no UrlFormattingOption. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
…og, then Enter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
… the composer transcript_reader reached sidebar_panels through the composer half of message_files (prompt_composer, settings, view settings), and sidebar_panels' function-local import hid the cycle. message_file_links holds the links, page files and chips; message_files keeps the composer. One chip line per file, so a message's chips are its files, not a 0-or-1 tuple. The name a kept file is saved under is MessageFile's own: the record refuses any other as it decodes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3
Author
|
Merged as part of #2130: this branch was rebased onto main and gated together with the other UI branches, since they edit the same lines. |
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.
What
A file picker for bus messages that works over remote connections. On the phone, Attach opens Android's own file picker. On the desktop it opens the file dialog or the project path search (setting
ui.input.file_picker). In the TUI it opens a terminal file browser or the path search. History rows show each message's files as chips, and opening a chip fetches its bytes. Needs the agent-comms change (OpenHCSDev/agent-comms#4889) on the bus first.Shape
toad.client.message_files.MessagePromptComposeris the shared message composer the Qt and Textual message composers inherit. It holds the attached files and the attach action; theFilePickersetting family names the picker;file_pickedattaches or refuses a file. Each frontend answers onlypick_in_window,pick_by_path_searchandshow_attached. The agent (ACP) composer does not inherit it, so it never offers Attach.UserInputSubmitted,InputSubmissionandTypedTextcarryfiles, andBusSubmissionExecutionhands them tocomms_user_send. A send that does not land returns its whole draft.SubmissionView.delivery_refusedanddelivery_unknownnow restore text and files once, replacing the two frontends' copied bodies; each frontend says only where a failure shows.QFileDialogwith native dialogs on. Qt answers it with the Storage Access Framework, and the returnedcontent://URL is read throughQFile, never more than one byte past what the message can still carry (read_limit). No Java hook was needed.toad.client.project_paths.ProjectPathSearchis the listing and ranking without a toolkit. Textual'sPathSearchand Qt'sQtPathSearchboth inherit it.AttachedFileChipis the shared caption and take-off action that both frontends' chip widgets inherit.toad.client.message_file_linksmakes onecomms_message_filesread per page (per conversation on the page, never per message). A row draws one linkedSpanper file under its text, so neither frontend has chip-drawing code.OpensLineLinksgains one handler: it fetches the bytes through the message, verifies the SHA-256, keeps the file underdata/message-files/<sha[:16]>/<name>, and previews or opens it the way each frontend opens a project file. The module imports nothing of the composer: before it was split out, the transcript reader reachedsidebar_panelsthrough the composer, and a function-local import hid that cycle.AttachFileAction(ctrl+t) belongs to theMessageActionfamily, which onlyMessageTextAreabinds. On Qt,action_methodsis per composer class and onlyQtMessageComposeradds it.comms_message_filesrefuses the page's files read, and that refusal fails loudly with no fallback.Evidence
All of the following ran on this head (854365a) against the agent-comms branch of OpenHCSDev/agent-comms#4889.
Desktop proof (Qt offscreen, a scratch bus served by agent-comms b0026f92b5).
qt_drive.py attachwrites a 300,029-byte file, picks it the way a person does (path typed into theQFileDialog, then Enter), shows its chip, types a body and sends it toscratch-live-pipeline. The recipient thread then lists and fetches the file throughcomms_message_filesandcomms_message_file:TUI chip.
tests/textual/test_message_file_attach.py::test_a_sent_file_draws_as_a_chip_under_its_message_in_the_terminalpasses: a sent file draws as[shot.png · 2.0 KB]under its message.tools/android/check.sh(scratch APP folder, a copy of the toadcomms profile, a runtime carrying agent-comms b80128bbd0, the final head). The shipped run now presses Attach in a channel and in a thread, requires exactly one file dialog, closes it unanswered, and requires no attached file:tools/qt_inherit_ratchet.py: exit 0.tools/shadow_check.py:empty methods shadowing real ones: 0 (baseline 0), exit 0.Tests: 33 test files naming each changed declaration, run once against agent-comms 94c2fead44: 96 passed, 37 failed, 1 collection error, 3 skipped. The agent-comms commits after 94c2fead44 change its bridges, wake segments and typing, which toad does not import, and split the file-name check into two.
LocalCoreAccess.__init__() missing 'reads',model_selection_available,HistoryWindow.jump_bar,test_prompt_enter_insertneeding a live editor child, and thelink_opening.pyvswidgets/linked_rows.pyguard.test_existing_thread_link.py::test_name_clicked_in_a_narrow_direct_chat_reuses_the_open_thread_tab. Rerun serially: pass. It is load-timed and does not touch files.tests/model/test_message_files.py,tests/model/test_message_file_reader.py,tests/textual/test_message_file_chips.py,tests/textual/test_message_file_attach.py) all pass.NRA (
python -m nominal_refactor_advisor src/toad --json --json-payload loop --no-cache: uncached and with no scan budget, so the scan runs to completion; this NRA version reports ascan_statusonly for a partial cached scan): 495 findings on this head and 495 on the merge base, with every detector's count equal. Two findings this branch had added were fixed:hidden_import_cyclethroughsidebar_panels(themessage_file_linkssplit above);A
string_kind_dispatchthe full payload had listed inmessage_files.pywent with the name check that moved into agent-comms'MessageFile.Rollout
A toad from this branch against an older bus fails the page-files read loudly.
Not covered here
QDesktopServices.openUrl). The desktop path is tested. The phone path has not been run, because this change builds no APK.🤖 Generated with Claude Code
https://claude.ai/code/session_01RnH6dT7wdh7i4tjJZQdFu3