Skip to content

Link existing QDN resources from the composer + Hub use-embed interop (A3+A4) - #106

Merged
QuickMythril merged 1 commit into
mainfrom
feat/attach-link-existing
Sep 1, 2026
Merged

Link existing QDN resources from the composer + Hub use-embed interop (A3+A4)#106
QuickMythril merged 1 commit into
mainfrom
feat/attach-link-existing

Conversation

@QuickMythril

Copy link
Copy Markdown
Member

Why

Phase A3+A4 of the attachments plan (~/AGENTS/projects/qortium-chat-v2/attachments-matrix/TRACKER.md). If a file already exists on QDN — published by anyone — the chat should link to it instead of republishing the bytes, and the link should render as an inline preview in both this app and real Qortal Hub clients. Hub and Chat previously had disjoint link grammars: Hub only embeds qortal://use-embed/… and merely linkifies everything else, while Chat rejected use-embed outright.

What

  • Parse (messageLinks.tsx): qortal://use-embed/{IMAGE|VIDEO|ATTACHMENT}?name=…&service=…&identifier=… now parses into the normal QDN-resource pipeline, so incoming Hub group-image embeds preview in Chat. Values are read without URL-decoding, exactly like Hub's own embed-utils.ts; POLL and malformed embeds are rejected.
  • Emit (buildQdnResourceShareLink): per-network form — qdn://SERVICE/name/identifier in Qortium conversations, Hub's use-embed in Qortal conversations. Since Hub neither encodes nor decodes query values, the use-embed form is only used when every value is [A-Za-z0-9._-]; otherwise the plain qortal://SERVICE/name?identifier=… link (previewed by Chat, linkified by Hub).
  • Bug fixed en passant: open-group attachment publishes in Qortal conversations used to emit qdn://SERVICE/name/identifier, which the Qortal-side parser reads as name + app path (identifier only rides ?identifier= there) — the linked attachment didn't resolve. They now emit the use-embed form.
  • Search (coreApi.searchQdnResources): Core /arbitrary/resources/search over FETCH_NODE_API (all publishers, query + service filter, clamped paging). Chosen over SEARCH_QDN_RESOURCES because Hub's request router has no case for that action even on current master, while FETCH_NODE_API works everywhere (Home directly; Hub and gateway through Chat's same-origin fallback).
  • UI: a 🔗 button beside the paperclip opens LinkResourceDialog — search, service filter (Any/IMAGE/VIDEO/AUDIO/ATTACHMENT/DOCUMENT/WEBSITE/APP), load-more paging, and per-row "Insert link", which drops the ready-made link at the composer caret. Nothing is published; available whenever the host serves the node API (FETCH_NODE_API), including read-only-ish hosts.
  • Ten new i18n keys mirrored into all 22 locales (parity test green); docs table + README updated; minimal dialog CSS.

Verification

🤖 Generated with Claude Code

https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG

…ub's use-embed links (A3+A4)

- messageLinks: parse Qortal Hub's qortal://use-embed/... grammar (incoming
  Hub group-image embeds now preview in Chat) and add
  buildQdnResourceShareLink, which emits the form the conversation's network
  previews best: qdn://SERVICE/name/identifier on Qortium, Hub's use-embed
  on Qortal (falling back to qortal://SERVICE/name?identifier=... when a
  value would break Hub's no-decode query parsing).
- coreApi: searchQdnResources over FETCH_NODE_API -> /arbitrary/resources/
  search (works on every host; Hub/gateway via the same-origin fallback;
  SEARCH_QDN_RESOURCES has no router case in Hub).
- LinkResourceDialog: search ANY publisher's resources (query + service
  filter, paging) and insert a link at the composer caret - nothing is
  republished.
- Composer: new link button next to the paperclip; App wires the dialog,
  caret insertion, and per-conversation reset.
- Open-group attachment publishes in Qortal conversations now emit the
  use-embed form - the old qdn:// form mis-parsed there (identifier only
  rides ?identifier= on Qortal, so the third segment was read as app path).
- Ten new i18n keys mirrored into all 22 locales; docs + README + styles.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9yvpqkVaKzM9MUh5zoCmG
@QuickMythril
QuickMythril merged commit 4ad9e01 into main Sep 1, 2026
4 checks passed
@QuickMythril
QuickMythril deleted the feat/attach-link-existing branch September 1, 2026 18:58
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