Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ToolbeltButton with tool switching capability #819

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

p-malecki
Copy link
Contributor

This PR introduces the ToolbeltButton component. It consists of two parts: a primary tool button and a dropdown trigger button, which enables the user to switch the tool reflected in the main button.

Demo:
(in an actual usage scenario, the recording button's CSS may require adjustments)

Screen.Recording.2024-12-03.at.14.30.05.mov

Copy link

vercel bot commented Dec 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
radon-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 2:33pm

kmagiera added a commit that referenced this pull request Jan 10, 2025
#893)

This PR reduces the amount of margins between buttons in order to make
it easier to fit more UI controls while also giving the device preview
as much space as possible in the panel.

We've been struggling with fitting all the buttons that we needed in the
panel. Specifically after adding screenshots and tools buttons to the
top bar. While we may want to eventually group some of the functions
(i.e. ones responsible for recording/screenshots) as proposed in #819 it
still seems like we're not using our space efficiently enough.

For example, the size of the icons is the same as with all the editor
button bars that VSCode renders, while we only add a significantly big
paddings around these. The buttons in VSCode are functional and for
users who need them to be bigger, can adjust that by changing the font
size in VSCode which also impacts the IDE panel UI. Despite the amount
of spaces in between the buttons, this change also shaves off some
padding above and below the device preview making it bigger when the
panel size is limited.

Beside the button size adjustment, we're also changing font size for
down-arrow that displays under the "reload" button, otherwise it
wouldn't fit the new height. We also change the font size and offset of
the badge that gets displayed along with the logs button also to
accommodate for the button size change. Finally, this PR also adds
`onCloseAutoFocus` to the dropdown menus (panel and device settings) to
prevent the buttons from going into a focused mode when the menu is
closed.

Before:
<img width="477" alt="image"
src="https://github.com/user-attachments/assets/4207f3f5-7678-4bc6-98d7-50272de6f559"
/>

After:
<img width="486" alt="image"
src="https://github.com/user-attachments/assets/3c59eb30-c87b-45cc-9073-040a4f68861f"
/>


### How Has This Been Tested: 
1. Run IDE on any project
2. Click thought the interface to make sure there are no issues cause by
the size changes (i.e. no cropped or overlapping items)
3. Specifically test dialogs, arrow next to reload button and make sure
the logs badge goes over to two digit numbers.
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.

1 participant