feat(selection-agent): refine selection context launch UI - #360
Merged
Conversation
Issue: Address the unresolved window-position review feedback on PR #356 and refine selection-to-agent launch controls by adding cancellation, preventing the action button from overlapping selected terminal text, and replacing the text label with a narrower robot button. Solution: Clamp the reachability margin to small window dimensions and cover it with regression tests. Add cached Cancel and Launch controls to the selection-agent modal, anchor the robot action button at the selection's bottom-right boundary, and extend cached badge rendering to scale emoji with explicit component allocators. Update the user and architecture documentation.
There was a problem hiding this comment.
Pull request overview
Refines the “selection-to-agent” UX by making the selection launch control smaller and better positioned, adds an explicit Cancel action to the launch modal, and hardens window-position restoration for very small persisted window sizes.
Changes:
- Clamp the persisted-window “reachability margin” to the saved window dimensions and add regression tests for tiny windows.
- Replace the wide selection “Launch agent” pill with a narrow, cached 🤖 badge anchored to the selection’s bottom-right corner (with window-edge clamping), plus tests for the anchor/clamp behavior.
- Add cached Cancel + Launch actions to the selection-agent modal, update cached badge rendering to support emoji-aware textures, and update user/architecture docs accordingly.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/ui/components/worktree_overlay.zig | Updates GlyphBadge rendering call to pass an allocator for cached/emoji-aware rendering. |
| src/ui/components/session_interaction.zig | Shrinks and re-anchors the selection action pill to a 🤖 badge; adds anchor/clamp tests. |
| src/ui/components/selection_agent_overlay.zig | Adds Cancel button behavior + cached texture; factors shared action-button layout and tests it. |
| src/ui/components/recent_folders_overlay.zig | Updates GlyphBadge rendering call to pass an allocator for cached/emoji-aware rendering. |
| src/ui/components/help_overlay.zig | Updates GlyphBadge rendering call to pass an allocator for cached/emoji-aware rendering. |
| src/ui/components/glyph_badge.zig | Adds allocator-aware rendering and optional emoji-aware rendering via text_render.makeTextTexture. |
| src/platform/sdl.zig | Clamps window reachability margin by window dimensions; adds regression test for tiny windows. |
| README.md | Updates user-facing description of selection-to-agent UX (robot button + Cancel/Escape). |
| docs/ARCHITECTURE.md | Updates ADR-015 description to reflect robot pill anchor and Cancel/Launch modal actions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Issue
The selection-to-agent action button overlapped selected terminal text and used a wide text label. The launch modal had no explicit Cancel action. PR #356 also retained one unresolved review comment: very small persisted windows could be rejected because the fixed 32 px visibility margin exceeded their dimensions.
Solution
Clamp the window reachability margin to the persisted window dimensions and cover the edge case with regression tests. Add cached Cancel and Launch controls to the selection-agent modal. Anchor the narrow, cached robot button at the selection's bottom-right boundary, with viewport clamping at the window edges. Extend cached badge rendering to scale emoji using each component's allocator.
Context
This follows up on the unresolved review feedback in PR #356 and refines the selection-context launch workflow described in ADR-015.
Test plan