block / block/buzz

iOS UX: selected multi-word agent mentions can lose inline styling

Open
#5,068 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Summary

On iOS, selecting an agent from the composer mention picker can leave the inserted `@Agent Name` looking like ordinary text rather than a distinct inline mention. This is especially unclear for agent names containing spaces: users cannot visually confirm that the full name is one selected mention before sending.

The current mobile code intends to render selected agent mentions as inline chips, so this should be treated as a regression or state-specific recognition failure rather than a request for a completely new mention design.

## Steps to reproduce

1. Open a channel composer on iOS.
2. Type `@` and choose an agent with a multi-word name, such as `Inference Ops`, from the floating picker.
3. Continue typing or dismiss the picker.
4. Observe that the inserted name can render without the expected inline block/color treatment, making it indistinguishable from plain text.

## Expected behavior

- A mention selected from autocomplete should immediately render as one visually distinct inline token covering the complete multi-word agent label.
- The treatment should match the existing composer/chat mention language; a chip, tinted background, or at minimum clear semibold styling is acceptable if it preserves native iOS editing behavior.
- Cursor movement, backspace, composing text, and message serialization must continue to operate on the literal `@Name` source without truncating names at spaces.
- Plain, unresolved `@text` should remain visually distinct from a resolved selection so users know whether the agent will actually be mentioned.

## Source references

- [`agent_mention_labels.dart`](https://github.com/block/buzz/blob/2ea9385015fb922de2adf0a53e86fc5a21d07b90/mobile/lib/features/channels/compose_bar/agent_mention_labels.dart#L3-L10) builds the labels recognized as agent mentions from current candidates.
- [`markdown_editing_controller.dart`](https://github.com/block/buzz/blob/2ea9385015fb922de2adf0a53e86fc5a21d07b90/mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart#L36-L49) stores normalized agent labels for mention-chip rendering.
- [`markdown_editing_controller.dart`](https://github.com/block/buzz/blob/2ea9385015fb922de2adf0a53e86fc5a21d07b90/mobile/lib/features/channels/compose_bar/markdown_editing_controller.dart#L219-L271) recognizes full labels, including spaces, and replaces matching `@Name` text with a composer chip while preserving invisible source text for cursor behavior.

## Related work

#5062 reports the related desktop/THREAD problem where pasted mention text can look valid without carrying resolved identity metadata. Both surfaces should clearly distinguish resolved agent mentions from plain presentation text.

Contributor guide

Open the contributing guide

Research direction

Start with mobile/lib/features/channels/compose_bar/agent_mention_labels.dart and the referenced sections of markdown_editing_controller.dart. Trace how multi-word labels are recognized and rendered after picker selection, then verify cursor movement, backspace, composing text, and serialization preserve the complete literal @Name. Done means resolved multi-word selections display as one distinct inline token while unresolved @text remains plain.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.