Skip to content

Fix dock panel button tooltip not dismissed when state changes via keyboard shortcut#44746

Merged
MrSubidubi merged 2 commits intozed-industries:mainfrom
Daeksell:fix-panel-button-tooltip-update
Dec 21, 2025
Merged

Fix dock panel button tooltip not dismissed when state changes via keyboard shortcut#44746
MrSubidubi merged 2 commits intozed-industries:mainfrom
Daeksell:fix-panel-button-tooltip-update

Conversation

@Daeksell
Copy link
Contributor

@Daeksell Daeksell commented Dec 12, 2025

Closes #44720

Release Notes:

  • Fixed dock panel button tooltips not being dismissed when toggling panels via keyboard shortcut

Problem: When hovering over a dock panel button and using a keyboard shortcut to toggle the panel, the tooltip remains visible with stale content. This is inconsistent with mouse click behavior, where the tooltip is dismissed on mouse down.

Solution: Include the panel's active state in the button's element ID. When the state changes, the element ID changes (e.g., "DebugPanel""DebugPanel-active"), which causes GPUI to discard the old element state including the cached tooltip.

Testing: Manually verified:

  1. Hover over a dock panel button, wait for tooltip
  2. Press keyboard shortcut to toggle the panel
  3. Tooltip is now dismissed (consistent with mouse click behavior)
2025-12-13.02.02.02.mov

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 12, 2025
@MrSubidubi MrSubidubi self-assigned this Dec 15, 2025
@MrSubidubi
Copy link
Member

Thanks for this!

I just pushed a minor update so that we do not allocate a string but use a different type of ElementId instead.

There is one thing left to discuss for me: Do we want to stick with this approach or go with a different one? Currently, we just hide the tooltip, but an alternative would be that we update the tooltip based on the current panel state so that it continues to exist and the accurate keystroke/action is displayed. What do you think about that?

@Daeksell
Copy link
Contributor Author

Hi, thanks! When I initially wrote the issue, I thought the tooltip should be updated. However, I wasn't able to implement it due to my limited understanding of the code. Since this behavior is somewhat obscure, I think simply hiding the tooltip would be sufficient. This approach is also consistent with the mouse behavior.

Copy link
Member

@MrSubidubi MrSubidubi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I think there is a slight difference between the mouse and keyboard interaction, that's why I was a bit hesistant to merge this this way. Yet, the other way is way more complicated and just dismissing is perhaps not the 100% solution, but 99% for sure 🙂

Thank you for looking into and fixing this!

@MrSubidubi MrSubidubi merged commit 1469d94 into zed-industries:main Dec 21, 2025
23 checks passed
rtfeldman pushed a commit that referenced this pull request Jan 5, 2026
…yboard shortcut (#44746)

Closes #44720

Release Notes:

- Fixed dock panel button tooltips not being dismissed when toggling
panels via keyboard shortcut




**Problem:** When hovering over a dock panel button and using a keyboard
shortcut to toggle the panel, the tooltip remains visible with stale
content. This is inconsistent with mouse click behavior, where the
tooltip is dismissed on mouse down.

**Solution:** Include the panel's active state in the button's element
ID. When the state changes, the element ID changes (e.g., `"DebugPanel"`
→ `"DebugPanel-active"`), which causes GPUI to discard the old element
state including the cached tooltip.

**Testing:** Manually verified:
1. Hover over a dock panel button, wait for tooltip
2. Press keyboard shortcut to toggle the panel
3. Tooltip is now dismissed (consistent with mouse click behavior)


https://github.com/user-attachments/assets/ed92fb6c-6c22-44e2-87e3-5461d35f7106

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…yboard shortcut (zed-industries#44746)

Closes zed-industries#44720

Release Notes:

- Fixed dock panel button tooltips not being dismissed when toggling
panels via keyboard shortcut




**Problem:** When hovering over a dock panel button and using a keyboard
shortcut to toggle the panel, the tooltip remains visible with stale
content. This is inconsistent with mouse click behavior, where the
tooltip is dismissed on mouse down.

**Solution:** Include the panel's active state in the button's element
ID. When the state changes, the element ID changes (e.g., `"DebugPanel"`
→ `"DebugPanel-active"`), which causes GPUI to discard the old element
state including the cached tooltip.

**Testing:** Manually verified:
1. Hover over a dock panel button, wait for tooltip
2. Press keyboard shortcut to toggle the panel
3. Tooltip is now dismissed (consistent with mouse click behavior)


https://github.com/user-attachments/assets/ed92fb6c-6c22-44e2-87e3-5461d35f7106

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
LivioGama pushed a commit to LivioGama/zed that referenced this pull request Jan 20, 2026
…yboard shortcut (zed-industries#44746)

Closes zed-industries#44720

Release Notes:

- Fixed dock panel button tooltips not being dismissed when toggling
panels via keyboard shortcut




**Problem:** When hovering over a dock panel button and using a keyboard
shortcut to toggle the panel, the tooltip remains visible with stale
content. This is inconsistent with mouse click behavior, where the
tooltip is dismissed on mouse down.

**Solution:** Include the panel's active state in the button's element
ID. When the state changes, the element ID changes (e.g., `"DebugPanel"`
→ `"DebugPanel-active"`), which causes GPUI to discard the old element
state including the cached tooltip.

**Testing:** Manually verified:
1. Hover over a dock panel button, wait for tooltip
2. Press keyboard shortcut to toggle the panel
3. Tooltip is now dismissed (consistent with mouse click behavior)


https://github.com/user-attachments/assets/ed92fb6c-6c22-44e2-87e3-5461d35f7106

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dock panel button tooltip doesn't update when state changes via keyboard shortcut

2 participants