Show plugin ids as subtext in the plugin picker menus
Select-menu options gain an optional third field rendered under the label, filtered alongside it, and returned with the selection. The plugin picker uses it to show every plugin's id and act on the id the selection hands back, replacing the duplicate-name label suffix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
9cb3640c9f
commit
bc75b03114
@@ -291,18 +291,18 @@ assert(
|
||||
/"omarchy-plugin-\$1" "\$id"/.test(pluginPicker),
|
||||
'plugin picker delegates enable and disable without interpreting plugin kinds'
|
||||
)
|
||||
// Icons ride along as "<glyph>\tlabel"; the menu shows the glyph and hands
|
||||
// back the label, so nothing downstream has to strip one off. The id rides in
|
||||
// a third field, cut off before the menu is ever shown it. What the picker
|
||||
// Icons ride along as "<glyph>\tlabel\tsubtext"; the menu shows the glyph,
|
||||
// renders the subtext under the label, and hands back "label\tsubtext" so the
|
||||
// picker can act on the id without resolving a display name. What the picker
|
||||
// then does with the row it gets back is checked in menu-plugin-test.sh.
|
||||
assert(
|
||||
/\$label \+ \\"\\\\t\\" \+ \.id/.test(pluginPicker)
|
||||
&& /omarchy-menu-select "\$\{1\^\} plugin" < <\(cut -f1,2 <<<"\$rows"\)/.test(pluginPicker),
|
||||
'plugin picker labels its rows with glyphs and keeps the id out of the label'
|
||||
/\.name \+ \\"\\\\t\\" \+ \.id/.test(pluginPicker)
|
||||
&& /id=\$\(cut -f2 <<<"\$selection"\)/.test(pluginPicker),
|
||||
'plugin picker shows the id as row subtext and acts on the id the selection hands back'
|
||||
)
|
||||
assert(
|
||||
/var icon = parts\.length > 1 \? parts\.shift\(\) : ""\s*\n\s*var label = parts\.join\("\\t"\)/.test(menuQml),
|
||||
'menu select mode reads a leading icon off an option and filters on the label alone'
|
||||
/var icon = parts\.length > 1 \? parts\.shift\(\) : ""\s*\n\s*var label = parts\.shift\(\) \|\| ""\s*\n\s*var detail = parts\.join\("\\t"\)/.test(menuQml),
|
||||
'menu select mode reads a leading icon and a trailing subtext off an option'
|
||||
)
|
||||
assert(
|
||||
/omarchy-launch-floating-terminal-with-presentation "omarchy-plugin-remove/.test(pluginPicker),
|
||||
|
||||
Reference in New Issue
Block a user