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

QoL: Confirm import with 1-click or Return key #4054

Merged

Conversation

Peechey
Copy link
Contributor

@Peechey Peechey commented Feb 4, 2022

Fixes # .

Description of the problem being solved:

Currently after importing a build code, the focus is set to the code textbox which is cool in that it allows hitting the Return key to confirm it, but it requires the user to click the Import button twice to do the same (first to reset focus, second for onClick). This feels bad and I wanna change it. With this PR, I've kept the Return key functionality while setting the focus instead on the Import button which means the user only needs to click it once. Both viable, you do you.

Steps taken to verify a working solution:

  1. Import a build
  2. Hit Return and verify build is loaded and view is set to Tree
  1. Import a build
  2. Click import exactly once and verify build is loaded and view is set to Tree
  • I'm fairly confident the change made to ButtonControl.lua is safe because of two things:
    1. Focus has to be specifically set on a ButtonControl (we only do so for importCodeGo button after successful import), as far as I'm aware we never set focus on a button anywhere else in the code
    2. Even if we do set focus on a button now or in the future, the button's enterFunc must be defined (and be a function) when the Return key is pressed

Link to a build that showcases this PR:

https://pastebin.com/JdZVLMtS

Before screenshot:

It's UX, do we need to provide gifs??

After screenshot:

Trust me?

@Peechey Peechey added the enhancement New feature, calculation, or mod label Feb 4, 2022
@LocalIdentity LocalIdentity merged commit ae7f64d into PathOfBuildingCommunity:dev Feb 4, 2022
@Peechey Peechey deleted the import-code-focus-fix branch January 4, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature, calculation, or mod
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants