Radial: in-place actions only; move Find/Replace out

Guiding principle: natural actions drive editing. The radial is for actions
that complete at the cursor without pulling attention elsewhere. Find and
Replace open a panel that demands immediate focus, so they break flow in a
cursor gesture — they belong in the command palette or a keybind instead.

Replace Find/Replace in the 'More' submenu with in-place transforms:
Uppercase, Lowercase, Join Lines (verified Kate action names: uppercase,
lowercase, joinLines; edit_* are KStandardAction ids). The Command Palette…
slice remains as the escape hatch to panel-opening actions. Documented the
principle in docs/PLAN.md. All 5 ctest suites green.
This commit is contained in:
Levi Neely 2026-10-07 17:04:58 +02:00
parent 2e006b34d9
commit fc483cfc9c
2 changed files with 21 additions and 2 deletions

View File

@ -17,6 +17,20 @@ interchangeable doors: `M-x` (keyboard), a radial caret menu (mouse), and the
`:` command line (optional). Every feature registers its commands once and
becomes reachable from all three. No action depends on an F-key or a chord.
### Guiding principle: natural actions drive editing
Each door suits a different kind of action, and placing an action in the wrong
door breaks flow:
- **Radial** is for actions that **complete in place** — cut, copy, paste,
comment, case changes, join lines. The gesture starts and ends at the cursor;
attention never leaves the text.
- Actions that **open a panel demanding immediate focus elsewhere** (Find,
Replace, goto) do **not** belong in the radial. Being flung to a panel right
after a cursor gesture is jarring. These belong in the **command palette** or
a **keybind**, where the context switch is expected. The radial keeps a
"Command Palette…" slice as the escape hatch to them.
## Why a custom matcher is the keystone
Kate's built-in command bar cannot be fixed in place:

View File

@ -97,13 +97,18 @@ QList<RadialDef> RadialConfig::builtinDefault()
edit.trigger = QStringLiteral("Alt+R");
edit.mouseButton = QStringLiteral("RightButton"); // natural radial gesture
// The radial holds actions that complete IN PLACE — no panel that pulls
// attention elsewhere. Panel-opening actions (Find, Replace) deliberately
// live in the command palette / keybinds instead, so the radial preserves
// editing flow. The "Command Palette…" slice is the escape hatch to those.
RadialNode more;
more.label = QStringLiteral("More");
more.children = {
leaf(QStringLiteral("Comment"), QStringLiteral("comment")),
leaf(QStringLiteral("Uncomment"), QStringLiteral("uncomment")),
leaf(QStringLiteral("Find"), QStringLiteral("edit_find")),
leaf(QStringLiteral("Replace"), QStringLiteral("edit_replace")),
leaf(QStringLiteral("Uppercase"), QStringLiteral("uppercase")),
leaf(QStringLiteral("Lowercase"), QStringLiteral("lowercase")),
leaf(QStringLiteral("Join Lines"), QStringLiteral("joinLines")),
// Opens the full command palette (handled specially by the plugin).
leaf(QStringLiteral("Command Palette…"), QStringLiteral("ollie_command_palette")),
};