Skip to content

Click in the IDE: focus panes, select tree entries, place the caret (v1.68.0) - #147

Merged
gmpassos merged 2 commits into
masterfrom
feat/ide-mouse-click
Nov 10, 2026
Merged

gmpassos merged 2 commits into
masterfrom
feat/ide-mouse-click

Conversation

@gmpassos

Copy link
Copy Markdown
Contributor

Summary

  • KeyType.click for a left-button press (SGR and legacy); releases, drags, middle/right buttons stay dropped.
  • IDE routes clicks to the pane under the pointer:
    • Tree: focus + select the row; a double-click (same row, ≤400 ms, monotonic clock) acts like Enter (open file / toggle dir).
    • Editor: focus + caret at the clicked cell via EditorView.positionAt (shares the gutter/scroll layout with render); clamped past line/file end; binary files only focus.
    • Terminal / AI panel: focus.
  • Ignored under a modal; never clears the status message or disarms Ctrl-Q/Ctrl-W.
  • Version 1.68.0 (CHANGELOG, README).

Test plan

  • dart analyze clean
  • New decoder + IdeApp click tests (select/focus, double-click open, different-row clicks, caret placement and clamping, dock focus); IDE, dashboard, ide_command, version tests pass

🤖 Generated with Claude Code

…v1.68.0)

The decoder now reports a left-button press as KeyType.click (releases,
drags and other buttons stay dropped). The IDE routes it to the pane under
the pointer: the tree is focused and the row selected, with a double-click
on the same row acting like Enter; the editor is focused and the caret
moved to the clicked cell (EditorView.positionAt mirrors the gutter and
scroll layout); a dock panel is focused. Like the wheel, clicks are ignored
under a modal and never clear a message or disarm Ctrl-Q/Ctrl-W.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/src/application/client/ide/ide_app.dart 88.52% 7 Missing ⚠️
lib/src/application/client/ide/tui/key.dart 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

- Any input other than a click breaks a pending double-click, so a key,
  wheel step or dialog between two clicks can no longer re-run Enter on a
  row whose content changed.
- Ignore the extra mouse buttons (bit 128: back/forward), which decoded as
  left clicks.
- EditorView.positionAt maps the clicked rune to a UTF-16 column, so a
  click never lands inside an emoji's surrogate pair; a click below the
  last line goes to the end of the file.
- IdeApp takes an optional clock for double-click timing; tests now drive
  the 400 ms window deterministically.
- Share one _paneAt hit-test between the wheel and the click; route
  through KeyEvent.isMouse.
- Clicking a tab switches to it (TabBar.tabAt shares render's layout).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gmpassos
gmpassos merged commit 5dd26bf into master Nov 10, 2026
5 checks passed
@gmpassos
gmpassos deleted the feat/ide-mouse-click branch November 10, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant