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

Don't cover input field with file preference browse button #12586

Conversation

w-pearson
Copy link
Contributor

What it does

Fixes #12582. The button is now next to the input field instead of on top of it, and thus the button does not cover the end of the input field for long paths.

How to test

Enter a long path in the Windows Terminal preference in the preferences screen. It should be possible to scroll over the input field to see everything.

Before:
image
After:
image

Review checklist

Done apart from updating the changelog since the PR that first added the browse button (#10766) didn't update it either; I'm not sure if it's needed in this case.

Reminder for reviewers

Fixes eclipse-theia#12582. The button is now next to the input field instead of on top of it, and thus the button does not cover the end of the input field for long paths.

Signed-off-by: William Pearson <w.pearson@samsung.com>
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Thank you @w-pearson for your contribution, that already looks quite good.

I think it makes sense though for the button to align with the input box next to it. Are you fine with performing this change as well? I imagine something like this:

image

@vince-fugnitto
Copy link
Member

As @msujew commented and what I displayed in #12582 (comment), I think the button should be attached to the input, and should also be the same size as the input for a better look-and-feel.

@vince-fugnitto vince-fugnitto added preferences issues related to preferences ui/ux issues related to user interface / user experience labels Jun 1, 2023
@w-pearson
Copy link
Contributor Author

Done:

image

I'm not 100% sure why it needs 3 extra pixels of padding compared to the default 4 above and 4 below on buttons instead of just 2 extra pixels (for the border on the input field that isn't present on the buttons). But this looks correct (and the text in the input field is lined up vertically with the text in the button, at least for electron).

@martin-fleck-at
Copy link
Contributor

@msujew Do you have some time to look at this again? Otherwise I could have a look at it since I did the original implementation.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look much better to me compared to the behavior on master, thanks for the fix!
I'll give the chance to others to review as well, but it should be merged for the next release 👍

Comment on lines 30 to 31
padding-bottom: 6px;
padding-top: 5px;
Copy link
Member

@msujew msujew Jun 13, 2023

Choose a reason for hiding this comment

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

I've noticed there's a small rendering issue on FireFox (it looks fine on Chrome), where the button is actually 27px in height. Maybe we should just fix it to be something like this instead of playing around with paddings?

Suggested change
padding-bottom: 6px;
padding-top: 5px;
height: 26px;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't seem to get the "Windows Exec" preference to show up when running in Firefox (with yarn browser start); I previously tested with Electron. How are you doing it?

Using exact pixel values seems like it would lead to more problems later (unless the height of the text field is also set in pixels, which it doesn't seem to be). I don't see any obvious way to make it automatically use the exact same amount of vertical space/all available vertical space (height: 100% didn't do it).

Copy link
Member

Choose a reason for hiding this comment

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

I've just modified a preference to use the typeDetails: { isFilepath: true } property. See here. In my case, I've used the window.title preference.

unless the height of the text field is also set in pixels, which it doesn't seem to be

It's not, but it's using line-height which is almost the same for the purpose of size calculation as plainly using height.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used calc(var(--theia-content-line-height) + 4px) (which is equivalent to 26px). That seems to give correct results with firefox and electron-chromium.

Copy link
Contributor

Choose a reason for hiding this comment

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

@msujew Is the proposed solution fine with you? If so, we could get this PR merged.

@w-pearson
Copy link
Contributor Author

As a side question: should I be amending and then force-pushing? Or do you want individual fixup commits like I've been doing?

@vince-fugnitto
Copy link
Member

As a side question: should I be amending and then force-pushing? Or do you want individual fixup commits like I've been doing?

@w-pearson in general, when addressing review feedback we should add new commits as per the guidelines for fixups. In the end we will "squash and merge" anyways unless we want to preserve the commit history for bigger changes (that wanted commits to be separated on purpose).

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@martin-fleck-at martin-fleck-at merged commit 828b899 into eclipse-theia:master Jul 3, 2023
8 checks passed
@martin-fleck-at martin-fleck-at added this to the 1.40.0 milestone Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preferences issues related to preferences ui/ux issues related to user interface / user experience
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

"Browse" button for file preferences obscures part of the input field
4 participants