Skip to content

feat: polish panel UX with scrolling, flip placement, and unified keys - #22

Merged
mattleong merged 2 commits into
mainfrom
t3code/polish-plugin-ui-ux
Aug 11, 2026
Merged

mattleong merged 2 commits into
mainfrom
t3code/polish-plugin-ui-ux

Conversation

@mattleong

Copy link
Copy Markdown
Contributor

Summary

Three UX polish changes to the floating panels:

  • Formatter panel scrolls instead of dropping rows. Previously, when the formatter list exceeded ~80% of the screen height, overflow rows were replaced with ... and filtered out of the selectable set — formatters past the fold could not be toggled at all. The panel now keeps every row in the buffer and scrolls the viewport with the selection.
  • Cursor-anchored floats flip above the cursor when space below runs out. New window.cursor_placement() / window.cursor_float_config() helpers capture the cursor's screen cell at trigger time and choose below/above placement, clamping height to the chosen side and the column to the editor width. The code actions panel re-evaluates placement on every render, so a panel that grows after its loading state flips correctly; the rename prompt uses the same logic unless the caller overrides window.relative/anchor/row/col. Placement is computed from window position + winline()/wincol() because screenrow() is unreliable in headless Neovim.
  • Unified keymaps and hint footers across panels. Both panels now use the same language: Tab/S-Tab move, Enter/Space perform the primary action (apply / toggle), q/Esc close. The code actions panel gains a q binding and an in-buffer hint footer (Enter:apply q:close).

Breaking / behavior changes

  • Formatter panel: Tab changes from toggle to move selection; Enter changes from close to toggle. Worth a changelog entry for muscle memory.
  • Code actions panel: re-adds an in-buffer hint footer, reversing the "Remove code action panel footer" decision from Polish Cosmic UI panels and docs #13. Easy to drop (two lines in codeactions/ui/init.lua) if the minimal look is preferred.

Tests

  • New unit specs for the flip/clamp placement math in tests/window_spec.lua
  • End-to-end spec asserting the code actions float opens with a SW anchor near the bottom of the screen
  • Formatter specs updated for scrolling (all rows stay selectable past the fold) and the new key semantics
  • make check (stylua + full plenary suite) and make smoke (headless LSP integration) pass

🤖 Generated with Claude Code

mattleong and others added 2 commits August 10, 2026 18:44
- Formatter panel scrolls overflowing rows instead of dropping them,
  keeping every formatter reachable on long lists
- Cursor-anchored floats (rename, code actions) flip above the cursor
  when there is not enough screen space below, clamped to the editor
- Unify panel keymaps: Tab/S-Tab move, Enter/Space act, q/Esc close;
  formatter toggle moves from Tab to Enter/Space
- Add in-buffer key-hint footer to the code actions panel

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resolved conflicts:
- window.lua: kept both branch cursor-placement helpers and main's border/panel helpers
- formatters/ui/render.lua: adopted main's resolve_border/panel_size refactor, kept branch scrolling (dropped main's overflow truncation)
- codeactions/ui/init.lua: kept branch origin_win/placement fields with main's no-arg ensure_namespace

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mattleong
mattleong merged commit 7faaa6e into main Aug 11, 2026
6 checks passed
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