Skip to content

fix(editor): render mention name from UUID, not markdown label#66

Merged
furtherref merged 1 commit into
mainfrom
fix/mention-render-from-uuid
May 19, 2026
Merged

fix(editor): render mention name from UUID, not markdown label#66
furtherref merged 1 commit into
mainfrom
fix/mention-render-from-uuid

Conversation

@furtherref
Copy link
Copy Markdown
Owner

@furtherref furtherref commented May 19, 2026

Summary

Layer 2 of the squad-mention defense: render @mention labels from the resolved entity's current name (looked up by UUID against the workspace query cache) instead of trusting the label baked into the markdown.

Backend canonicalization (#65, already merged) rewrites mention labels on write, but historical rows that predate it — and any future write path that bypasses it — can still carry a stale or wrong label. With this layer, the displayed @mention always names who the UUID actually addresses, even when the markdown label is out of date.

Behaviour

  • New EntityMentionName component (packages/views/editor/mention-name.tsx) resolves agent / member / squad mentions by UUID via the existing workspace list queries (agentListOptions, memberListOptions, squadListOptions).
  • Cache hit → render the entity's current name.
  • Cache miss (deleted, cross-workspace, archived, cold start) → fall back to the markdown label. This is the right semantic for an archived/historical entity — show the name at write time, not a resurrected current name.
  • @all and unknown mention shapes keep their literal label.
  • The mention regex in readonly-content.tsx gains squad (previously missing — squad mentions weren't routed through any resolver before).

Where this fits

Layer Status
1. Backend canonicalize labels on write ✓ Merged (#65)
2. Frontend render label from UUID lookup This PR
3. Squad-leader prompt warning ✓ Merged (#64)
4. Dispatch-time label/UUID mismatch logging ✓ Folded into layer 1

Test plan

  • mention-name.test.tsx (new) — 11 tests covering agent / member / squad cache hit, cache miss fallback, unknown type fallback, label preservation, @ALL rendering
  • readonly-content.test.tsx (new) — 8 tests verifying the regex route and that the resolver is invoked for the right mention kinds
  • pnpm --filter @multica/views test — 656 / 656
  • Reviewed via /codex:review --wait — 5 rounds clean

🤖 Generated with Claude Code

Backend canonicalization (prior commit) rewrites mention labels on
write, but rows that predate it — and any future write path that
bypasses it — can still carry a label that disagrees with the UUID.
Render the resolved entity's current name from the workspace cache
so the displayed @mention always names who is actually addressed.

EntityMentionName looks up agent / member / squad by UUID against the
existing list queries (agentListOptions, memberListOptions,
squadListOptions). Falls back to the markdown label only when the
entity is not in cache (deleted, cross-workspace, or cold start).
ReadonlyLink in readonly-content.tsx routes agent/member/squad
mentions through it; the regex also gains `squad` (previously
missing). @ALL and unknown shapes keep their literal label.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multica-web Ready Ready Preview, Comment May 19, 2026 9:55am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
multica-docs Ignored Ignored May 19, 2026 9:55am

@furtherref furtherref merged commit 6f2c53e into main May 19, 2026
5 checks passed
furtherref added a commit that referenced this pull request May 19, 2026
Resolve conflicts in 7 files:

- packages/views/editor/attachment-preview-modal.tsx: combine HEAD's
  fullscreen toggle with upstream's open-in-new-tab button.
- packages/views/editor/readonly-content.tsx: keep HEAD's
  EntityMentionName import (fix #66); drop dead ImageLightbox import.
- packages/views/onboarding/components/runtime-aside-panel.tsx: adopt
  upstream's i18n-aware install-agent-runtime docs URL.
- packages/views/onboarding/steps/step-questionnaire.tsx: accept
  upstream deletion (replaced by per-question v2 steps).
- packages/views/runtimes/components/connect-remote-dialog.tsx: take
  upstream's restructure; point INSTALL_CMD/TOKEN_CMD at
  furtherref/multica + multica.furtherref.com.
- server/pkg/db/queries/issue.sql (ListOpenIssues): merge upstream's
  involves_user_id filter with HEAD's 'archive' status exclusion;
  regenerate issue.sql.go via sqlc.

Follow-up: add archive entry to STATUS_BAR_BG in upstream's new
gantt-view.tsx to satisfy Record<IssueStatus, string>.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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