Skip to content

feat: mouse support for editor and UI navigation#24

Open
muk2 wants to merge 2 commits intomainfrom
feature/issue-20-mouse-support
Open

feat: mouse support for editor and UI navigation#24
muk2 wants to merge 2 commits intomainfrom
feature/issue-20-mouse-support

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 18, 2026

Summary

Adds mouse support to pgrsql, addressing #20. Mouse interactions complement keyboard navigation.

  • Click to position cursor in editor
  • Click to select sidebar items and switch focus to sidebar/editor/results
  • Click to select rows in results table
  • Scroll wheel works in editor, sidebar, and results
  • Layout trackingLayoutRects stored during each draw for coordinate mapping
  • Mouse events ignored during connection dialog and help overlay

Mouse Actions

Area Click Scroll
Editor Position cursor at click location Scroll editor content
Sidebar Select item at click position Navigate list up/down
Results Select row at click position Scroll results up/down

Changes

File Change
src/ui/app.rs Added LayoutRects struct, handle_mouse(), handle_mouse_click(), handle_mouse_scroll(), rect_contains() helper
src/ui/components.rs draw() now takes &mut App, stores panel rects to app.layout
src/main.rs Added Event::Mouse handling in event loop

Test plan

  • All 124 existing tests pass
  • Clippy clean
  • cargo fmt clean
  • Verify clicking in editor positions cursor
  • Verify clicking sidebar items selects them
  • Verify clicking in results selects the row
  • Verify scroll wheel works in all three panes
  • Verify keyboard navigation still works identically
  • Verify mouse is ignored during connection dialog

Closes #20

🤖 Generated with Claude Code

Add mouse click, scroll wheel, and focus switching via mouse.
Layout rects are stored during each draw call and used to map
mouse coordinates to UI elements.

- Left click in editor positions cursor at click location
- Left click in sidebar selects item
- Left click in results selects row and switches focus
- Scroll wheel works in editor, results, and sidebar
- Mouse is ignored during connection dialog and help overlay
- Keyboard navigation continues to work exactly as before

Closes #20

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@muk2
Copy link
Owner Author

muk2 commented Feb 19, 2026

Cursor clicking kind of works. Does not work to place cursor in editor. weirdly selects/unselects on schema/tables. works but not as smooth and user intuitive. requires extra UI polishing

Add export_selected field from the export feature alongside the
layout rects field for mouse support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Feature: Mouse support for editor and UI navigation

1 participant