TUI: Unified mentions tweaks + polish mentions rendering (#23363)

This change keeps unified @mentions behind the mentions_v2 gate, moves
the flag to under-development, and polishes mention rendering/history
behavior.

It also adds a few small improvements to the mentions feature around
mention rendering and history round-tripping for plugin/tool mentions in
message edit scenarios. Plugin selections now insert `@` mentions with
better casing, and saved history preserves the visible sigil so recalled
messages look the same as what the user typed.

- Preserves `@` sigils when encoding/decoding mention history for
tool/plugin paths.
- Improves plugin mention insertion so display names/casing are
reflected more cleanly in the composer.
- Update composer to render user-entered plugin mentions in the same
color as the mentions menu. ALso applies to recalled/edited messages.
- Left/right arrows no longer switch unified-mention search modes after
an @mention has already been accepted (Ex: arrowing left through a
composed message that contains @mentions).
- Keeps bound mentions stable around punctuation, so accepted `@`
mentions do not reopen the popup and punctuated `$` mentions still
persist to cross-session history.

**Steps to test**
- Ensure mentions_v2 is enabled through configuration or `--enable
mentions_v2`
- Type `@` in the TUI composer and verify filesystem/plugin/skill
results are displayed in the unified mentions menu.
- Select a plugin mention from the `@` popup and confirm the inserted
text is an `@...` mention with casing, then recall/edit the message and
confirm it still renders as `@...`.
- Mention a skill and verify that skills still insert as `$skill`
mentions rather than `@` mentions.
- Verify punctuated mentions such as `@plugin.` and `($skill)` keep
their bound mention behavior across editing and history recall.
This commit is contained in:
canvrno-oai
2026-05-28 10:30:15 -07:00
committed by GitHub
parent 489bf38658
commit 6c1215dac6
14 changed files with 1170 additions and 104 deletions
+1 -5
View File
@@ -1068,11 +1068,7 @@ pub const FEATURES: &[FeatureSpec] = &[
FeatureSpec {
id: Feature::MentionsV2,
key: "mentions_v2",
stage: Stage::Experimental {
name: "Mentions v2",
menu_description: "Use a unified @ mention popup for files, folders, apps, plugins, and skills.",
announcement: "",
},
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
+7
View File
@@ -304,6 +304,13 @@ fn auth_elicitation_is_under_development() {
);
}
#[test]
fn mentions_v2_is_under_development_and_disabled_by_default() {
assert_eq!(Feature::MentionsV2.stage(), Stage::UnderDevelopment);
assert_eq!(Feature::MentionsV2.default_enabled(), false);
assert_eq!(feature_for_key("mentions_v2"), Some(Feature::MentionsV2));
}
#[test]
fn remote_control_is_removed_and_disabled_by_default() {
assert_eq!(Feature::RemoteControl.stage(), Stage::Removed);