Repository navigation
feat(mecatui): clickable permission + plan-review buttons - #496
Merged
Merged
Conversation
A left-click on a permission modal or plan-review action-bar button now resolves it to that button's verdict, exactly like pressing its key chord (issue #486). The hit-test is arithmetic geometry derived from the same layout model (chrome/convTopRow) and styled-label widths the renderer uses, sharing ONE source for the button row (permissionButtonsLine/planButtonsLine) so render and hit-test can never disagree. A click elsewhere in the modal is swallowed (it is a gate, not a form). This is the first of three mouse-interaction consumers split from #486; click-to-open URLs (#489) and textarea click-to-caret (#490) are follow-ups. Co-Authored-By: mecatl <[email protected]>
Panel review on fb18059 caught the generic modal's click band shifted one row low: the footnote row wrongly resolved Allow and the box's top-border row missed. Root cause: buttonsLineRow re-derived the buttons row from the body's trailing write order and mixed content/card frames. Fix: the builder that lays out the body now owns the button box's top row (permissionModalBodyParts returns it alongside the body), so render and hit-test agree by construction. Also promote the button separator to a shared const (approvalButtonSep) so the JoinHorizontal render and the hit-test column arithmetic can't desync. A new regression test pins the hit band to the exact rendered-box rows (footnote excluded). Co-Authored-By: mecatl <[email protected]>
JAORMX
marked this pull request as ready for review
August 13, 2026 11:07
Contributor
|
Dog-food testing passed in the built PR worktree. Tested
CI is green: 12 successful checks, with the 3 expected PR skips and no failures. |
This was referenced Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ships the first of three mouse-interaction consumers split out of #486: clickable permission-modal and plan-review buttons. A left-click on Allow / Always / Deny (or the plan-review bar's approve & run / auto-accept edits / iterate) resolves the ask to that button's verdict — exactly like pressing its key chord. A click anywhere else in the modal is swallowed (it's a gate, not a form).
The other two consumers were split into follow-ups (per the implementation plan on #486): click-to-open URLs → #489, textarea click-to-caret → #490.
How it works
cmd/mecatui/ui/clickgeom.go(new) — arithmetic hit-test geometry. The render path and the hit-test share ONE source for the button row (permissionButtonsLine/planButtonsLine) and ONE source for the body's screen position (convTopRow←chrome()), so they can't disagree. Button rects are measured withlipgloss.Widthon the same styled labels the renderer places, so a rebound chord's wider standalone label is hit-tested at its true width.permission.go— extracted the two button-line builders and splitrenderPermissionModal→renderPermissionModalBody/permissionModalBodyPartsso the builder that lays out the body also owns where the buttons landed.update.go— aphaseAwaitingApprovalbranch inonMousePressbefore theselectable()gate; resolves on press (key-chord parity) and deliberately does not touch the multi-click / drag-selection state machine.Alt-screen only (mouse capture lives there);
--inline/--no-mouseleave the mouse uncaptured for native selection, unchanged.Review
Panel review (spec + standards + architecture + duplication) ran on the first commit. The spec axis caught a real bug: the generic modal's click band was one row too low, so the footnote row wrongly resolved Allow. Fixed in the second commit (builder now owns the button row; shared
approvalButtonSepconst; new regression test pinning the hit band to the exact rendered-box rows).Verification
task lint— 0 issuestask test— 128 packages greenllms.txtbyte-identical (docs row added no new links);task docslink gate greengo run ./cmd/mecademo— full offline session intactTest plan
9 new tests in
clickgeom_test.go: rect tiling, per-button hit/miss, click→verdict resolution for both the modal and the plan bar, two-button (child-ask) modal has no middle rect, plan-bar clamp keeps the footnote from resolving, hit band matches the rendered box rows exactly, and the phase gate.Closes #486 (buttons portion; #489 + #490 track the rest).
Draft: dog-food the click feel before marking ready.