Radial: add Go-to-File and Go-to-Symbol slices

Add ollie_goto_file and ollie_goto_symbol to the built-in radial's 'More'
branch, next to the command-palette escape hatch (panel-opening switchers
belong there, not the in-place top ring). onRadialActivated already
resolves both ids. Example config + a builtinDefaultHasLauncherSlices
test updated.
This commit is contained in:
Levi Neely 2026-10-08 10:43:56 +02:00
parent 0e1c6943ac
commit caa1e911b8
3 changed files with 26 additions and 3 deletions

View File

@ -16,9 +16,11 @@
{
"label": "More",
"slices": [
{ "label": "Format", "action": "tools_align" },
{ "label": "To Upper", "action": "tools_uppercase" },
{ "label": "To Lower", "action": "tools_lowercase" },
{ "label": "Format", "action": "tools_align" },
{ "label": "To Upper", "action": "tools_uppercase" },
{ "label": "To Lower", "action": "tools_lowercase" },
{ "label": "Go to File…", "action": "ollie_goto_file" },
{ "label": "Go to Symbol…", "action": "ollie_goto_symbol" },
{ "label": "Command Palette", "action": "ollie_command_palette" }
]
}

View File

@ -148,6 +148,11 @@ QList<RadialDef> RadialConfig::builtinDefault()
leaf(QStringLiteral("Uppercase"), QStringLiteral("uppercase")),
leaf(QStringLiteral("Lowercase"), QStringLiteral("lowercase")),
leaf(QStringLiteral("Join Lines"), QStringLiteral("joinLines")),
// Panel-opening switchers live in the "More" branch next to the palette
// escape hatch — not the top ring of in-place actions — because they pull
// attention away from the caret. Resolved directly by onRadialActivated.
leaf(QStringLiteral("Go to File…"), QStringLiteral("ollie_goto_file")),
leaf(QStringLiteral("Go to Symbol…"), QStringLiteral("ollie_goto_symbol")),
// Opens the full command palette (handled specially by the plugin).
leaf(QStringLiteral("Command Palette…"), QStringLiteral("ollie_command_palette")),
};

View File

@ -129,6 +129,22 @@ private Q_SLOTS:
QVERIFY(hasBranch);
}
void builtinDefaultHasLauncherSlices()
{
// The "More" branch exposes the Go-to-File / Go-to-Symbol switchers and
// the command-palette escape hatch, by their plugin action ids.
const RadialDef &d = RadialConfig::builtinDefault().first();
QStringList ids;
for (const RadialNode &n : d.root.children) {
for (const RadialNode &c : n.children) {
ids << c.actionId;
}
}
QVERIFY(ids.contains(QStringLiteral("ollie_goto_file")));
QVERIFY(ids.contains(QStringLiteral("ollie_goto_symbol")));
QVERIFY(ids.contains(QStringLiteral("ollie_command_palette")));
}
void loadFileReadsValidConfig()
{
QTemporaryDir tmp;