Restore paste/drop and inline-bytes attachments on hosts without Home's picker (A1+A2) - #105
Merged
Conversation
…'s picker (attachments-matrix A1+A2) Chat 2.0 P4 (#88) made Home's native picker the only source of publishable bytes. That broke attachments on every host that does not offer the picker (Home <=1.7.1, Qortal Hub) and left paste/drag-drop dead everywhere, since the app could no longer hand bytes to Home. - attachmentCapabilities.ts: feature-detect the attachment source per host from advertised actions (picker vs inline bytes); PUBLISH_CHAT_ATTACHMENT doubles as the token-only (Home 2 desktop) marker. - attachments.ts: bring back local File staging (WebP re-encode, base64). - coreApi.ts: publishQdnResourceBytes sends the pre-P4 inline shape (base64 + filename) that Home <=1.8, Home 2 Android and Hub accept. - App.tsx / ChatComposer.tsx: paperclip opens the picker where offered, else a hidden <input type=file>; paste and drop stage the file wherever inline bytes are accepted, and keep the use-the-attach-button notice on Home 2 desktop. Send path publishes local stages inline; token path unchanged. - Two new i18n keys mirrored into all 22 locales; docs + README updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG
…rs SELECT_QDN_PUBLISH_SOURCE The earlier note that Home <=1.7.1 lacks the picker came from a bad grep; git grep across tags shows the picker (home#100) in v1.3.0+ and inline bytes accepted on every 1.x. Behaviour is unchanged (feature-detected); only comments, test host labels, and docs are corrected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG
This was referenced Sep 1, 2026
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.
Why
User feedback: after Chat 2.0 you can no longer drag or paste images into the composer. PR #88 (2.0 P4) made Home's native picker the only source of publishable bytes, which (a) disabled the paperclip on every host without
SELECT_QDN_PUBLISH_SOURCE— Qortal Hub, and Home 1.x older than 1.3.0 — and (b) left paste/drag-drop showing a "use the attach button" notice on every host, including Home 2, because the app had no way to hand bytes to Home.Review + evidence:
~/AGENTS/projects/qortium-chat-v2/attachments-matrix/(SYNTHESIS.md, TRACKER.md). This PR is Phase A1+A2 — chat app only, no Home change.What
src/attachmentCapabilities.ts(new): per-host attachment source, feature-detected from advertised actions —picker(token flow, unchanged) orbytes(app reads the File).PUBLISH_CHAT_ATTACHMENTdoubles as the "refuses inline bytes" marker since Home 2 desktop is the only host that both denylists inline fields and advertises it. No probe request.src/attachments.ts: local File staging is back —prepareLocalAttachment(WebP re-encode at 1200px / q0.6 for non-GIF images, strips metadata; base64). Staged shapes are now akind: 'source' | 'local'union.src/coreApi.ts:publishQdnResourceBytesreplaces the always-throwing shim; sends the pre-P4{base64, filename, identifier, name, service}shape that every Home 1.x (data64||base64), Home 2 Android, and Hub (data64||base64||file) accept.App.tsx/ChatComposer.tsx: paperclip → picker where offered (Home 1.3+/2), else hidden<input type="file">; paste and drop stage the file wherever inline bytes are accepted, and keep the notice on Home 2 desktop; drop overlay text follows. Send path publishes a local stage inline; the token path and private-attachment flow are unchanged.label.composer.dropFileHere,status.attachment.selecting) mirrored into all 22 locales;docs/CHAT_ATTACHMENTS.mdgets the per-host source table; README updated.Resulting matrix
Correction (2nd commit)
An earlier revision of this description said Home ≤1.7.1 lacks the picker; that was a bad grep.
git grepacross tags: the picker exists in every Home 1.x from 1.3.0, all 1.x accept inline bytes, none advertisePUBLISH_CHAT_ATTACHMENT. Code behaviour was already feature-detected and is unchanged; comments/tests/docs corrected.Verification
npx tsc --noEmitclean;npx vitest run: 55 files, 757 tests pass (baseline onmainbefore this change: 11 files failed to load only becausenode_moduleslackedtweetnacl—npm cifixed it).attachmentCapabilities.test.ts(ladder per host),coreApi.test.ts(wire shape, Hub-style result,{accepted:false}→ error, validation),attachments.test.ts(File routing).npm run buildsucceeds.🤖 Generated with Claude Code
https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG