[BUG] Desktop app: `ui.render` for `UserMessage` is raised but a mod's rewrite is never painted (neither props nor tree)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code (latest Claude desktop app, which bundles 2.1.295; the CLI is at 2.1.299, which the app hasn't shipped yet)
What's Wrong?
A mod hooks on('ui.render', { component: 'UserMessage' }, …). In the Claude desktop app (Code tab), the hook is raised for every user row; it writes to the status line each time. But the row is always drawn as the app's default bubble:
- Returning
next({ ...e, props: { ...e.props, text: rewritten } })→ row drawn unchanged. - Returning the mod's own tree (a
BoxwithText) → row drawn unchanged.
No ui.render (UserMessage) refused line appears in the transcript. The same mod returning a tree for AssistantMessage is painted in the desktop app.
What Should Happen?
The UserMessage contract in the plugin types says a rewrite "is printable text, drawn up to its first 100000 characters where the engine draws the body", and isExpanded's remarks describe "a hook that draws a compact row of its own". The rewrite should be painted on the desktop surface, as it is for AssistantMessage. If user rows aren't meant to be replaceable on desktop, the types and docs should say so, and the engine could stop raising ui.render for them there.
Steps to Reproduce
on('ui.render', { component: 'UserMessage' }, ($, e, next) => {
$.ui.status(`UserMessage ${e.props.origin.kind} on ${e.surface}`)
if (e.props.isExpanded) return next(e)
return next({ ...e, props: { ...e.props, text: `⟡ ${e.props.text}` } })
})
- Load the mod in a Claude desktop app Code session (hot-reloaded from the session's mods folder).
- Type any prompt.
- Expected: the row starts with
⟡. Observed: the status line readsUserMessage sdk on desktop, and the row draws unchanged.
Why it matters
Mods that deliver messages into a session with $.prompt.submit (e.g. multi-agent chat relays) need to collapse those rows. Today, on desktop, every delivery shows as a full bubble with the engine's framing, and there's no lever to compact it.
Environment
Claude desktop app (Code tab) bundling Claude Code 2.1.295, macOS (Darwin 25.6.0).
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗