Skip to content

feat: inline reference chips in composer and message bubbles - #35

Merged
luoxuanzao merged 5 commits into
mainfrom
feat/composer-reference-cards
Aug 24, 2026
Merged

feat: inline reference chips in composer and message bubbles#35
luoxuanzao merged 5 commits into
mainfrom
feat/composer-reference-cards

Conversation

@luoxuanzao

Copy link
Copy Markdown
Member

Summary

  • Renders @file / @folder/ mention tokens as inline chips in the chat composer (CodeMirror-based LiveComposer behind a hidden-textarea ComposerBridge, so all existing input consumers keep working unchanged) and in sent message bubbles.
  • Chips open the referenced note/folder on plain click on both surfaces (typed dispatch with stale-kind fallback and reveal flash); composer chips also carry a × remove button that deletes the whole token atomically, matching Backspace behavior.
  • Fixes bubble-side tokenization to resolve paths containing spaces via longest-match vault verification instead of truncating at the first whitespace.
  • Vault drops are claimed in the capture phase so CodeMirror never pastes the OS-level obsidian://open URI next to the mention, and dropped references register through FileContextManager so they chipify exactly like dropdown insertions.
  • Needed so composer/bubble references read as first-class context objects (aligned with the Qoder IDE) instead of raw @path text, especially for CJK vaults where spaced filenames are common.

Verification

  • npm run typecheck
  • npm run lint
  • npm run test (3400 tests)
  • npm run build
  • npm run release:check
  • npm run audit:prod
  • Verified end-to-end in a real vault: chip rendering from dropdown/paste, plain-click open, × removal without navigation, spaced-path bubble chips, and no URI leak on drop

Safety

  • No credentials, private vault content, internal URLs, or personal paths are included
  • User-visible changes are documented in CHANGELOG.md

luoxuanzao and others added 5 commits August 24, 2026 17:23
… message bubbles

- Add CodeMirror-backed live composer with reference chip decorations
  (atomic delete, click-to-open, auto-height) bridged onto the legacy
  textarea so all existing input consumers keep working unchanged
- Render @path tokens in user message bubbles as the same chips via a
  markdown pre-pass (vault-verified, code spans untouched)
- Keep sent message content untouched: chips are display-only skins
- Open files in a leaf and reveal folders in the file explorer;
  openLinkText misfires on folders by offering to create a file
- Add ReferenceChipKind type to prepare typed click dispatch
- Add @codemirror/commands dependency for editor history
- Add ReferenceChipKind as the single chip type union; all chip
  surfaces (mention dropdown, composer, bubble HTML) now share it
- Dispatch chip clicks through a per-kind action registry
  (openReferenceChip): files open in a leaf, folders reveal in the
  file explorer; stale kinds fall back to the entry's real type
- Flash the revealed folder entry with the brand color so chip clicks
  have a visible landing point without touching theme active styling
- Bubble mention chips now verify @tokens with longest-match vault
  shrinking, so paths containing spaces chipify instead of truncating
  at the first space.
- Vault drops are claimed in the capture phase so CodeMirror never
  pastes the OS-level obsidian:// URI payload next to the mention.
- Dropped references register through FileContextManager so they
  chipify in the composer exactly like dropdown insertions.

Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
Composer chips previously required Cmd/Ctrl-click to open while a plain
click only selected the chip text. Align with message-bubble chips: a
plain click now dispatches the open action on both surfaces.

Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
Each composer chip now ends with an x button that deletes the whole
token atomically, matching the Backspace behavior. stopPropagation
keeps the chip's click-to-open intact. Bubble chips stay button-free.

Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
@luoxuanzao
luoxuanzao merged commit 52b0a7f into main Aug 24, 2026
9 checks passed
@luoxuanzao
luoxuanzao deleted the feat/composer-reference-cards branch August 24, 2026 15:23

const escapedPath = typeof CSS !== 'undefined' && CSS.escape
? CSS.escape(path)
: path.replace(/"/g, '\\"');
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.

2 participants