Repository navigation
Agent: give the lightbox close button one tooltip - #1235
Merged
Merged
Conversation
icon_button already attaches a tooltip from its label, and the lightbox added a second one for the Escape hint. gpui allows one tooltip per element and asserts it in debug builds, so opening an image panicked there; release builds kept the second one. widgets gains icon_button_for_action, an icon_button whose tooltip names the action's shortcut, and the close button uses it, so it still reads "Close" with the live Escape binding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AnthonyRonning
approved these changes
Oct 23, 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.
Why
What this PR changes
widgets::icon_button_for_actionis anicon_buttonwhose tooltip also shows the action's shortcut, so a caller no longer adds a second.tooltipto get the hint.Details for reviewers (cause, scope, tests)
Base and scope
origin/masteratcc67565bca98a669b02ce4a39e7ec710d978c358.Files
apps/maple-agent/app/src/ui/widgets.rsapps/maple-agent/app/src/ui/chat/mod.rsapps/maple-agent/app/src/ui/chat/tests.rsCommits
Cause
icon_buttonhas attached a tooltip from its label since the widgets accessibility pass (6991072). The lightbox close button kept the explicit.tooltip(tooltip_for_action("Close", &ChatEscape))it had from before that, so the element got two. gpui'sInteractivity::tooltiphas adebug_assert!that fires on the second call.icon_buttoncall site that added its own tooltip.Design
icon_buttonandicon_button_for_actionshare a privateicon_button_base(role, label, focus ring, hover, delay, icon). Each one attaches exactly one tooltip:tooltip(label, None)ortooltip_for_action(label, action).Tests
cc67565b), opening an attached image full size crashed with "calling tooltip more than once on the same element is not supported". With this branch, the same image opens full size with no crash.test_lightbox_draws_and_escape_closes_it: opens the lightbox in a test window, draws a frame, and checks that the Escape handler closes it. Without the fix it panics with "calling tooltip more than once on the same element is not supported"; with it, it passes.cc67565b:cargo fmt --all -- --checkpassed;cargo test -p maple-agent-app --locked -- test_lightbox_draws_and_escape_closes_itpassed (1 test);cargo clippy -p maple-agent-app --all-targets --locked -- -D warningspassed.just cirun was stopped at Michael's request after formatting, all nine Git metadata tests, and all four Clippy feature sets passed; its workspace build and full test suites were not completed.🤖 Generated with Claude Code