Skip to content

fix(ui): preserve sent inline references with Astryx - #1927

Merged
Astro-Han merged 5 commits into
mainfrom
refactor/1861-sent-reference-hierarchy
Aug 3, 2026
Merged

fix(ui): preserve sent inline references with Astryx#1927
Astro-Han merged 5 commits into
mainfrom
refactor/1861-sent-reference-hierarchy

Conversation

@Astro-Han

@Astro-Han Astro-Han commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Persist the exact occurrences of sent inline references instead of reconstructing UI from matching text: workspace @file references come from surviving Composer tokens, while successful explicit Skill invocations come from runtime receipts.
  • Render Composer and ChatMessage references through one Astryx-backed token projection, so Skill and workspace-file tokens keep the same label, icon, dimensions, and wrapping behavior before and after send.
  • Keep the native Astryx sent-message hierarchy intact: compact file attachments, quote references, and image thumbnails remain direct ChatMessage children before the authored-text bubble.
  • Keep authority at the narrowest existing seam: renderer sends only canonical workspace value/offset pairs; main derives file labels and joins runtime-owned Skill receipts; Core owns the closed schema and its shared bounds.
  • Preserve explicit inlineReferences: [] end to end as the current-format marker. Only legacy messages with the field absent use text-token fallback.
  • Keep inline references display-only: providers still receive the original authored text.

Closes #1861

Verification

  • npm run format:check, npm run lint, and npm run typecheck — passed after rebasing onto current main.
  • npm --workspace @maka/core test — 695/695 passed.
  • npm --workspace @maka/runtime test — 2700 passed, 9 skipped.
  • npm --workspace @maka/ui test — 240/240 passed.
  • npm --workspace @maka/storage test -- session-store — 1024 passed, 1 skipped.
  • npm --workspace @maka/desktop test — 1375/1375 passed.
  • npm --workspace @maka/desktop run e2e -- composer-mention-token.spec.ts — 4/4 passed after rebase, including real token selection, identical plain-text occurrence, send, and reload persistence.
  • npm --workspace @maka/desktop run build-storybook — passed after rebase.
  • Fresh-eye review completed with no remaining P0–P3 findings. Its count/label-bound and surrogate-boundary findings are covered by regression tests.

Visual evidence

Storybook sent reference hierarchy

Live Storybook state: Product/Attachments/Sent Reference Hierarchy.

The inspected state covers unclipped attachment icons, the native Astryx image thumbnail, the quote row, and /skill:writer plus @chat-turn.tsx using the same token projection as Composer.

Review focus

  • start is a UTF-16 offset into displayText ?? text. It is necessary to distinguish a selected token from an identical plain-text occurrence and is validated at Core and IPC boundaries.
  • Main caps the final projection to the shared Core count/label bounds, never splits a surrogate pair while shortening a derived label, and drops malformed or overlapping candidates fail-plain.
  • Slash-command projection rebases workspace token offsets to the actual submitted task text; normal send keeps the original offsets.

@Astro-Han Astro-Han changed the title refactor(ui): align sent references with Astryx fix(ui): preserve sent inline references with Astryx Aug 3, 2026
@Astro-Han
Astro-Han force-pushed the refactor/1861-sent-reference-hierarchy branch from f329b56 to 1af3849 Compare August 3, 2026 05:07
@Astro-Han
Astro-Han marked this pull request as ready for review August 3, 2026 05:56
@Astro-Han
Astro-Han force-pushed the refactor/1861-sent-reference-hierarchy branch from 1af3849 to 664704a Compare August 3, 2026 05:57
@Astro-Han
Astro-Han merged commit 980dd72 into main Aug 3, 2026
5 checks passed
@Astro-Han
Astro-Han deleted the refactor/1861-sent-reference-hierarchy branch August 3, 2026 06:03
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.

Close the remaining gaps against the Astryx ai-chat template

1 participant