anomalyco / anomalyco/opencode
feat(tui): render structured mentions inline
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Problem
Structured references are styled while composing a prompt, but projected user messages render the original text as plain text and show attachments separately below it.
For example, a selected skill currently becomes:
Compare the workspace provider options. /api-design
[ skill | API design ]
The same underlying inconsistency exists for file and agent mentions: composer extmarks communicate structure inline, but timeline rendering loses that styling and relies on separate badges or previews.
Proposed direction
Introduce one shared user-message mention renderer that segments message text using the structured attachment mention ranges and styles each recognized reference inline:
@filereferences@agentreferences/skillreferences
Render a separate badge or preview only when the attachment has no valid inline mention or needs richer presentation, such as an image preview.
renderMentions(message.text, {
files: message.files,
agents: message.agents,
skills: message.skills,
})
The renderer should validate that each stored range still matches its mention text and fall back safely when ranges are stale or overlap.
Scope
This is a follow-up to #41188. That PR keeps the existing timeline convention and adds structured skill attachments; it should not special-case skill rendering before files and agents share the same treatment.
Acceptance criteria
- Structured file, agent, and skill mentions retain recognizable inline styling after submission.
- Inline mentions and separate badges are not duplicated unnecessarily.
- Attachments without valid mention ranges still render through the existing badge/preview UI.
- Multiple mentions, Unicode text, stale ranges, and overlapping ranges have focused tests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the projected user-message timeline renderer and the composer’s structured attachment mention handling, then trace how files, agents, and skills are represented by their stored ranges. Use the acceptance criteria to guide focused tests for multiple mentions, Unicode text, stale ranges, and overlaps. Done means valid mentions are styled inline without unnecessary duplicate badges, while invalid or richer attachments retain the existing badge or preview UI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100