Commit Graph

16 Commits

Author SHA1 Message Date
Levi Neely 5439d43ac4 Chord: arm anchor on left double-click so dblclick -> chord flows
A double-click's second press arrives as MouseButtonDblClick, not a plain
press, so m_leftDownInView was never set and the still-held button could not
anchor a chord. Set the chord anchor on a left double-click inside the view
(bracket- or word-select), letting the user proceed directly from a
double-click into a left+middle (Cut) or left+right (Paste) chord without
releasing. All 5 ctest suites green.
2026-10-07 17:28:14 +02:00
Levi Neely a804dbe521 Add bracket-pair selection on double-click (multi-line, nesting-aware)
Double-clicking next to a bracket ()[]{} now selects the text strictly
between the matching pair, across lines and honouring nesting. The event
filter catches MouseButtonDblClick inside the view, maps the click to a
document cursor via coordinatesToCursor, inspects the characters on both
sides, and scans with depth counting (stepForward/stepBackward wrap across
line ends) to find the match. Openers select forward, closers backward;
with no bracket adjacent it falls through to Kate's default word-select.
All 5 ctest suites green.
2026-10-07 17:26:24 +02:00
Levi Neely 3129662f31 Chord: add Acme left+right = Paste
The paste chord (Acme 1-3) now works: with the left button held, a right tap
pastes over the selection via edit_paste (standard KDE clipboard). This is
conflict-free because the radial gesture is already suppressed while the left
button is held — right alone opens the radial, right while left-held pastes.
The paired right release is swallowed so it doesn't leak a context menu or
other action. All 5 ctest suites green.
2026-10-07 17:19:57 +02:00
Levi Neely 87f5587bd4 Chord: suppress middle-click primary paste on both press and release
The X11 primary-selection paste was leaking through on the middle-button
release because only the press was consumed. Now the middle button is
consumed inside the editor on BOTH press and release (tracked via
m_swallowMiddleRelease), fully suppressing primary paste there. The chord
Cut uses edit_cut, which writes to the standard KDE clipboard (Klipper), so
paste is the normal Ctrl+V / palette paste. All 5 ctest suites green.
2026-10-07 17:18:01 +02:00
Levi Neely 75367f85ef Radial: suppress gesture while left button is held
An RMB press during a left-drag (mid-selection, or while setting up a
left+middle chord) must not pop the radial. Guard the gesture start on both
the tracked left-held-in-view flag and the live QMouseEvent::buttons() state
so a right press with left already down falls through instead of opening the
radial. All 5 ctest suites green.
2026-10-07 17:14:26 +02:00
Levi Neely d117aebb7f Add Acme-style left+middle mouse chord = Cut
Left-button chords only (right button stays the radial). With the left
button held while selecting, a middle-button tap cuts the current selection
and is consumed, so it does not also trigger a primary-selection paste;
middle-click without the left held still pastes as usual.

Implemented in the shared application event filter: track the left button
held inside the active view, and on a middle press while held trigger
edit_cut. The filter is now installed unconditionally (it serves both the
radial gesture and the chord). All 5 ctest suites green.
2026-10-07 17:11:29 +02:00
Levi Neely fc483cfc9c 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.
2026-10-07 17:04:58 +02:00
Levi Neely 2e006b34d9 Radial: fix held-drag hover and wrong-slice selection
The opening RMB press leaves an implicit mouse grab on the editor view, so
move/release events during the hold were delivered there, never to the
popup's grabMouse(). Hover froze and the release resolved at a stale
position (always landing on 'More').

Drive the whole gesture from the plugin's application event filter instead,
which reliably sees those events: on press show the radial and set
m_gestureActive; forward each MouseMove to driveHoverGlobal() and the
MouseButtonRelease to driveReleaseGlobal(), both in global coordinates
mapped locally by the widget. The widget's own mouse handlers are gated off
during this external drive (m_externalDrive) to avoid double-handling, and
the manual grabMouse()/releaseMouse() is removed. Key-triggered radials keep
using the widget's local click handling. All 5 ctest suites green.
2026-10-07 17:00:15 +02:00
Levi Neely 9ecfd379c2 Radial: dual drag/click interaction, open at cursor without moving caret
The radial now supports both intended interactions from one widget:
- Hold-and-drag: opened with a button held, drag toward a slice and release
  to trigger the slice under the cursor (far flicks allowed).
- Release-and-click: a quick press/release that never leaves the centre dead
  zone switches to click mode and keeps the menu open; then hover and click a
  slice to trigger. A click outside the ring cancels instead of snapping.

Armed state is detected from QApplication::mouseButtons() at popup time, so
key-triggered radials start directly in click mode. mousePressEvent is
accepted to stop a Qt::Popup from self-dismissing on an in-widget press. The
menu opens centred on the given point; the RMB press is consumed upstream so
the caret does not move. All 5 ctest suites green.
2026-10-07 16:52:15 +02:00
Levi Neely 4be3ead30d Radial: add right-mouse-button gesture trigger
RMB is the natural radial trigger. The plugin now installs an application
event filter (gated to the active view) that, on an RMB press inside the
editor, pops the radial at the pointer and consumes the press plus the
following ContextMenu event, suppressing Kate's context menu (an
intentional, user-approved trade-off). The radial grabs the mouse on popup
so an in-progress RMB drag is tracked and the release selects the slice.

Config gains a per-radial "button" field (RightButton/MiddleButton)
alongside the key "trigger"; the built-in editing radial binds both Alt+R
and RightButton. All 5 ctest suites green.
2026-10-07 16:43:52 +02:00
Levi Neely a98db2913c M4: multi-level radial menu (mouse door), config-driven triggers
- RadialModel: pure tree + geometry (angle hit-test, dead zone, far-flick
  snap, descend/ascend). 14 tests.
- RadialMenu: frameless translucent widget painting the current ring with
  wedges, labels, branch markers and a central back/cancel hub; mouse hover
  highlights, release/click activates a leaf, descends a branch, or
  ascends/cancels from the hub; Esc ascends/cancels.
- RadialConfig: JSON -> radial tree parser with a built-in default, so
  multiple radials can bind to different triggers. 8 tests.
- Plugin wiring: one trigger action per configured radial (default Alt+R ->
  editing radial), popped at the caret via cursorPositionCoordinates().
  Slices reference Kate actions by objectName (resolved via findActionByName);
  the special ollie_command_palette slice opens the palette.

Honours the agreed model (keys/weapon-wheel triggers now; config carries a
per-radial trigger for mouse-button/gesture triggers later). All 5 ctest
suites green (36 tests).
2026-10-07 16:38:54 +02:00
Levi Neely d227d6161b Palette: guarantee distinguishable labels, never drop distinct actions
Dedup is now strictly by QAction pointer identity (functionally lossless:
the same action object listed once). Distinct actions are never collapsed.
When two distinct actions would show the same label, enrich it through a
fallback chain until every visible row is unique: component name ->
objectName -> shortcut -> numeric suffix. Ids remain unique so activation
always hits the intended action.
2026-10-07 16:26:03 +02:00
Levi Neely 485d395d4d M3: dedup palette actions by identity, disambiguate shared labels
The same QAction is often reachable through multiple GUI clients; those
are true duplicates and are now collapsed by pointer identity. Distinct
actions that merely share a visible label (common across plugins) are kept
but disambiguated by appending the owning component's display name, and
every entry is assigned a unique, stable id so activating a row always
triggers the intended action rather than whichever one won a hash key.
2026-10-07 16:05:22 +02:00
Levi Neely 91a0e2d260 M3: loadable KTextEditor plugin with M-x command palette
- OlliePlugin (KTextEditor::Plugin) + OllieView, built as olliepalette.so
  via kcoreaddons_add_plugin, installed under kf6/ktexteditor.
- M-x bound to Alt+X (single modifier, adjacent keys on a compact layout,
  ApplicationShortcut so it is always live).
- On trigger, aggregates every enabled/visible QAction from the window's
  guiFactory()->clients() action collections (keyed by objectName) and
  shows them in PaletteWidget; the chosen row triggers the QAction. The
  action's current shortcut is surfaced in the group column.
- Enable position-independent code for linking the static palette lib into
  the shared plugin module.
- Plugin metadata verified valid via KPluginMetaData.

Frecency wiring deferred (model supports it; plugin passes 0). All three
ctest suites remain green.
2026-10-07 15:59:05 +02:00
Levi Neely 617b526e3f M2: command palette widget + ranked list model
- PaletteModel: QAbstractListModel ranking items via FuzzyRanker, with
  id/label/group/score and highlight-range roles plus a frecency bonus.
  Headless, unit-tested (10 cases).
- PaletteWidget: frameless popup with a filter line and results list.
  Live company-style updates, top hit preselected, custom delegate bolds
  matched characters. Keyboard (Up/Down/PageUp/PageDown/Enter/Esc, focus
  kept in the filter) and mouse (click to activate). No chords.
- Tighten FuzzyRanker typo tolerance: single adjacent transposition instead
  of deletion. Still recovers 'gti'->'git' but no longer false-matches
  'ren' against 'Open File'.

All tests green: fuzzyranker (14) + palettemodel (10).
2026-10-07 15:49:48 +02:00
Levi Neely 95bc9f7ed6 Initial commit: FuzzyRanker keystone + project plan
Kate plugin suite for menu-free, mouse-first, one-handed UX.

- FuzzyRanker: orderless + layered fuzzy matcher (exact/substring/
  initials/subsequence/bounded-typo) with merged highlight ranges.
  Fixes Kate's KFuzzyMatcher gaps (no orderless, 'gti' fails 'git').
- 14 QTest cases, all green.
- README + docs/PLAN.md: goal, design constraints, 5-milestone roadmap.
2026-10-07 15:45:58 +02:00