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

fix: "Validate" button disappears after app font-size change #1255

Merged
merged 3 commits into from
Sep 29, 2022

Conversation

bdferris-v2
Copy link
Collaborator

Fixes #1244, where in the "Validate" button sometimes disappears. Per discussion in the bug, when a JFileChooser is shown on some platforms, it causes the apps default font size to increase. This ultimately causes the app's layout to grow vertically, which can push the validate button off the bottom of the window.

While we don't know the root cause of the font change, we can address the symptom. Namely, we introduce a pack() call after any use of the JFileChooser, which will cause the app to resize to match the preferred size of its content. Most of the time, there will be no change, but if the font size has increased, the app will resize appropriately. We already use a similar approach when showing and hiding the advanced app settings.

To make the re-pack slightly less jarring, we also specify a fixed column count for the text input fields, such that the app does not dynamically resize in response to strings of different lengths. Finally, we set a minimum size of the app based on initial content size to keep the app from shrinking beyond that preferred minimum.

  • Run the unit tests with gradle test to make sure you didn't break anything
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues

…ng the file chooser to respond to changes in app font size. To make that re-pack less jaring, we also specify a fixed column count for the text input fields, such that the app does not dynamically resize in response to strings of different lengths. Finally, we set a minimum size of the app based on initial content size to keep the app from shrinking beyond that preferred minimum.
@isabelle-dr
Copy link
Contributor

isabelle-dr commented Sep 19, 2022

Thank you for working on this Brian 🙏
I have sent the app from this PR to one of the users that had this problem to see if this works.

@isabelle-dr
Copy link
Contributor

Do you know why we aren't getting the acceptance test message?

@bdferris-v2
Copy link
Collaborator Author

You only get those if you are developing on a branch in the MobilityData/gtfs-validator repo itself, due to limitations from GitHub. I've historically done all my development in a forked repo (bdferris-v2/gtfs-validator), though you all did recently grant me access to create branches on the main repo.

See also discussion at #1232 (comment)

Copy link
Contributor

@maximearmstrong maximearmstrong left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @bdferris-v2

I have sent the app from this PR to one of the users that had this problem to see if this works.

@isabelle-dr I'd say we can merge if it works for the user.

@isabelle-dr
Copy link
Contributor

I received feedback from one of the users that had this problem: this fix works.

Thanks for this fix @bdferris-v2, merging this PR!

@isabelle-dr isabelle-dr merged commit 3044eb2 into MobilityData:master Sep 29, 2022
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.

"Validate" button disappearing from Desktop app
3 participants