Skip to content

Fix device and app dropdown width and click areas#481

Merged
florent37 merged 5 commits intoopenflocon:mainfrom
snappdevelopment:fix-dropdown-width
Jan 25, 2026
Merged

Fix device and app dropdown width and click areas#481
florent37 merged 5 commits intoopenflocon:mainfrom
snappdevelopment:fix-dropdown-width

Conversation

@snappdevelopment
Copy link
Copy Markdown
Contributor

@snappdevelopment snappdevelopment commented Jan 17, 2026

Fixes the width, click area and paddings of the device and app dropdown menus.

When selecting a device with a short name, then the delete buttons of the devices with longer names were cut off because the dropdown was forced to have the same width as the anchor. Same for the app dropdown. I had to apply matchAnchorWidth = false on the Modifier as well as the ExpandedDropdownMenu itself to make it work.

For devices the short names the click area was also too short, so I adjusted the layouts and padding to improve that. I also aligned the implementation of TopBarDeviceView with TopBarAppView to make them almost identical.

The last thing I did was add the alpha from the device connection icon on the text as well. That makes it easier to distinguish between connected and disconnected devices.

Let me know what you think :)

Before (delete button was cut off):
image1
After:
image2

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @snappdevelopment, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses user interface issues within the network view's device and app dropdown menus. The primary goal is to improve the visual presentation and interactivity of these dropdowns by ensuring their content is fully visible regardless of item name length and by optimizing the clickable areas for better user experience. These changes prevent content truncation and make dropdown selections more intuitive.

Highlights

  • Dropdown Width Correction: Resolved an issue where device and app dropdown menus in the network view would cut off content (e.g., delete buttons) when the selected item had a short name, by preventing the dropdown from matching the anchor's width.
  • Improved Click Area: Enhanced the click area for device names, especially for shorter names, by adjusting layout and padding within the dropdown items.
  • UI Layout Adjustments: Applied matchAnchorWidth = false to FloconExposedDropdownMenu modifiers and utilized fillMaxWidth for dropdown items to ensure proper sizing and interaction.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses the width and click area issues in the device and app dropdown menus. The solution to set matchAnchorWidth = false is correctly applied, and expanding the clickable area of items is a good user experience improvement. I've added one comment regarding a potential visual regression in the device dropdown due to some styling properties being lost during a refactoring. Overall, these are solid improvements to the UI.

Comment on lines +59 to 63
FloconExposedDropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false },
containerColor = FloconTheme.colorPalette.primary,
shadowElevation = 0.dp,
shape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp),
modifier = Modifier.exposedDropdownSize(),
modifier = Modifier.exposedDropdownSize(matchAnchorWidth = false),
) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

When refactoring from ExposedDropdownMenu to FloconExposedDropdownMenu, the shadowElevation = 0.dp and custom shape properties were lost. This might result in an unintended visual change, such as a shadow appearing where there was none before. If the original appearance should be preserved, consider adding these properties to the FloconExposedDropdownMenu component or passing them through.

@rteyssandier rteyssandier added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Jan 21, 2026
@florent37
Copy link
Copy Markdown
Contributor

CI is not passing, but that's my falt, I'm fixing it and merge yours then #488

@florent37
Copy link
Copy Markdown
Contributor

thanks for the fix, I'm merging it and deploy a new version

@florent37 florent37 merged commit b713999 into openflocon:main Jan 25, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants