Skip to content

Show keyboard shortcut in sidebar button tooltip - #2

Merged
sharpSteff merged 1 commit into
masterfrom
claude/button-tooltip-shortcut-1pkg1q
Jun 25, 2026
Merged

sharpSteff merged 1 commit into
masterfrom
claude/button-tooltip-shortcut-1pkg1q

Conversation

@sharpSteff

Copy link
Copy Markdown
Owner

Summary

When an anchorable's Content implements IToolbox and Shortcut is non-empty, the sidebar toggle button tooltip now reads "Title (Ctrl+Shift+E)" instead of just "Title". Falls back to the plain title when no shortcut is defined — no behaviour change for existing users.

Change

// before
btn.ToolTip = attachedToolTip ?? anc.Title;

// after
var baseToolTip = attachedToolTip ?? anc.Title;
if (anc.Content is IToolbox toolboxForTip && !string.IsNullOrWhiteSpace(toolboxForTip.Shortcut))
    btn.ToolTip = $"{baseToolTip} ({toolboxForTip.Shortcut})";
else
    btn.ToolTip = baseToolTip;

Test plan

  • Hover over a sidebar button whose ViewModel implements IToolbox with Shortcut = "Ctrl+Shift+E" — tooltip should read "My Tool (Ctrl+Shift+E)"
  • A tool with no Shortcut (or non-IToolbox content) still shows the plain title tooltip
  • A tool with an attached ToggleDock.ToolTip still uses that as the base text

🤖 Generated with Claude Code

https://claude.ai/code/session_01JWi368zCdtjnkCyjQJ6wwS


Generated by Claude Code

…tcut is set

When the anchorable's Content implements IToolbox and has a non-empty Shortcut,
the tooltip now reads "Title (Ctrl+Shift+E)" instead of just "Title", giving
users a quick way to discover the keyboard shortcut from the UI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JWi368zCdtjnkCyjQJ6wwS
@sharpSteff
sharpSteff merged commit 958430b into master Jun 25, 2026
1 check passed
@sharpSteff
sharpSteff deleted the claude/button-tooltip-shortcut-1pkg1q branch June 25, 2026 05:02
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.

2 participants