From caa1e911b8d12084147afbcc370dc7b4b1983a8c Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Thu, 8 Oct 2026 10:43:56 +0200 Subject: [PATCH] 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. --- docs/radials.example.json | 8 +++++--- src/radial/radialconfig.cpp | 5 +++++ src/radial/test_radialconfig.cpp | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/radials.example.json b/docs/radials.example.json index c2e17b0..797aecb 100644 --- a/docs/radials.example.json +++ b/docs/radials.example.json @@ -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" } ] } diff --git a/src/radial/radialconfig.cpp b/src/radial/radialconfig.cpp index 3221f55..b70898f 100644 --- a/src/radial/radialconfig.cpp +++ b/src/radial/radialconfig.cpp @@ -148,6 +148,11 @@ QList 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")), }; diff --git a/src/radial/test_radialconfig.cpp b/src/radial/test_radialconfig.cpp index b4e7b45..e189935 100644 --- a/src/radial/test_radialconfig.cpp +++ b/src/radial/test_radialconfig.cpp @@ -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;