Fix dock panel button tooltip not dismissed when state changes via keyboard shortcut#44746
Conversation
|
Thanks for this! I just pushed a minor update so that we do not allocate a string but use a different type of 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? |
|
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. |
MrSubidubi
left a comment
There was a problem hiding this comment.
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!
…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>
…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>
…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>
Closes #44720
Release Notes:
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:
2025-12-13.02.02.02.mov