Size unified mention popups to visible results (#34771)

## What changed

- Size the unified mention popup from its filtered row count, while keeping a one-row minimum and the existing maximum.
- Update composer snapshots to cover the compact layout when only one mention result is visible.

GitOrigin-RevId: 7cd30a5c53c7e81cf7158a6b3dda3c09bd024f29
This commit is contained in:
Eric Traut
2026-07-22 15:23:55 +00:00
committed by copyberry
parent 32f4687b8c
commit 9ee63da142
3 changed files with 8 additions and 7 deletions

View File

@@ -76,7 +76,8 @@ impl Popup {
}
pub(crate) fn calculate_required_height(&self, _width: u16) -> u16 {
(MAX_POPUP_ROWS as u16).saturating_add(2)
let visible = self.rows().len().clamp(1, MAX_POPUP_ROWS);
(visible as u16).saturating_add(2)
}
fn clamp_selection(&mut self) {

View File

@@ -5,9 +5,9 @@ expression: terminal.backend()
" "
" @sa "
" "
" "
" "
" "
"> Sample Plugin Plugin with skills and an MCP server Plugin"
" "
" "
" "
" "
" enter insert · esc close · ←/→ switch search modes [All Results] Filesystem Only Plugins "

View File

@@ -5,9 +5,9 @@ expression: terminal.backend()
" "
" @left @bound "
" "
" "
" "
" "
"> left Plugin used to test bound mention fallback. Plugin"
" "
" "
" "
" "
" enter insert · esc close · ←/→ switch search modes [All Results] Filesystem Only Plugins "