Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-1404Done

5.8.6 Render — live internal-link chip in `MarkdownView` + title linkify (archived/deleted states)

Type: code · Executor: coding_agent · Repo: motir-core. Blocked by 5.8.1 (design) + 5.8.2 (token). UI — design-gated.

Render a motir: token (and a bare MOTIR-N key) as a live internal-link chip that always shows the target's CURRENT key/title/status — never stale text.

Render path. Extend lib/markdown/render.tsx (which already special-cases the mention: scheme in urlTransform + the rehype-sanitize schema and renders it as span.mention-chip): allow the motir: scheme + linkify bare MOTIR-N keys, and render a work-item chip. Because the chip must show LIVE title/status, the body-rendering surfaces resolve the referenced ids/keys -> a workItemRefs summary map ({ id|key -> { key, title, status, type, archived, deleted, accessible } }) and pass it to MarkdownView (the same pattern as mentionCandidates flowing into the editor). Resolve on the surfaces that render bodies: the detail description + explanation, the comments stream, and the quick-view peek body. Title linkify: render MOTIR-N in a work item's title as a link on the detail header + in the peek (titles are plain strings, not Markdown — a small dedicated linkify, not the Markdown pipeline).

Chip behaviour + states (per 5.8.1):

  • Default: type icon · key (mono) · title · status Pill; click -> quick-view peek (reuse RelationshipPeekLink / the peek route /api/work-items/peek), like the relationships panel rows (2.4 / MOTIR-1305).
  • Archived target -> muted/dimmed chip with the archived cue.
  • Deleted (id/key no longer resolvable) -> strikethrough chip retaining the bare key.
  • No-access -> bare key only (no title/status leak).

Acceptance criteria

  • A motir: token and a bare MOTIR-N key both render as a chip showing the target's current key/title/status; renaming the target changes the chip on next render (no stored title).
  • Archived -> muted; deleted -> strikethrough + bare key; no-access -> bare key. None throw on a missing target.
  • The chip opens the peek; keyboard-activatable; single interactive element (no nested buttons).
  • Title MOTIR-N renders as a link on the detail header + peek.
  • New UI copy added to en + zh message catalogs (the i18n convention).
  • MarkdownView for plain bodies with no refs is unchanged; user mention: chips still render.
  • Unit/component tests for each state from a stubbed workItemRefs map.

Context refs: lib/markdown/render.tsx (renderMarkdown, urlTransform, MENTION_HREF_RE, sanitize schema), components/ui/MarkdownView.tsx, components/ui/markdown-editor.css (.mention-chip), RelationshipPeekLink + app/api/work-items/peek/route.ts, design/work-items/internal-links.mock.html (5.8.1).