Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Improved UI/UX of find bar #3315

Merged
merged 3 commits into from
Aug 27, 2016
Merged

Improved UI/UX of find bar #3315

merged 3 commits into from
Aug 27, 2016

Conversation

jkup
Copy link
Contributor

@jkup jkup commented Aug 22, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Ran git rebase -i to squash commits if needed.

Fix #3159

Sorry, I got my git history in a really bad state. This is the same UI/UX PR as #3255 but I fixed the bugs outlined by @bbondy.

The last thing I know to need work is the design of the buttons when tab color is in effect. Screenshots posted below. @bradleyrichter can you give me a little feedback on the buttons?
screen shot 2016-08-22 at 1 58 07 pm
screen shot 2016-08-22 at 1 58 16 pm

@bradleyrichter
Copy link
Contributor

@jkup Getting close. Here is a spec vs code snap shot and a short list of changes that should get us there:

  • increase bar height to make room for taller search box
  • increase search box height to 24px
  • change prev/next buttons to show outline on hover only
  • set hover outline height for prev/next to 24 and align to search box
  • set all radii to 4px

for colored tab theming:

  • set hover outline color, prev/next arrow color, and label color to #DCDCDC

image

@bbondy
Copy link
Member

bbondy commented Aug 23, 2016

let me know when I can take another look @jkup

@jkup
Copy link
Contributor Author

jkup commented Aug 23, 2016

Cool I'm just gonna get these last design tweaks and then I'll ping you!

@bbondy
Copy link
Member

bbondy commented Aug 23, 2016

This is form my original feedback but the text is glued to the focus ring, could we add some padding to avoid that? I see some black text touching the blue.

screenshot 2016-08-23 00 18 29

@bradleyrichter
Copy link
Contributor

Actually, the blue highlight is in the wrong place. It should be changing the outer box border style, not the inside text field.

@jkup jkup force-pushed the improve-findbar-ui-ux branch from dfaa5cb to e7add80 Compare August 23, 2016 04:22
@jkup
Copy link
Contributor Author

jkup commented Aug 23, 2016

@bbondy I had fixed that but there was a typo in my CSS. The padding should be there now!

@bbondy
Copy link
Member

bbondy commented Aug 23, 2016

It looks like the count not updating isn't fixed yet either. Steps to reproduce was in my previous feedback. (Open search, count updates, close, open again search, count doesn't update)

@bbondy
Copy link
Member

bbondy commented Aug 23, 2016

I think it would be nice to also use getTextColorForBackground for the previous/next button. On some themes I don't think it looks right (example brianbondy.com)
screenshot 2016-08-23 00 26 36
Both for the outline and the arrow

@bradleyrichter
Copy link
Contributor

we can do that instead of what I proposed.

But the outlines are only for mouse over. But in general, everything can use the GetTextColor for the theme-color tab style.

@bbondy
Copy link
Member

bbondy commented Aug 23, 2016

the right x button as well, please use getTextColorForBackground

@jkup
Copy link
Contributor Author

jkup commented Aug 23, 2016

On it!

@jkup jkup force-pushed the improve-findbar-ui-ux branch from e7add80 to 7bc200c Compare August 23, 2016 22:11
@@ -60,6 +63,18 @@ class FindBar extends ImmutableComponent {
input.select()
}

componentWillMount () {
let stylesheet = document.getElementById('findBarStylesheet')
Copy link
Member

Choose a reason for hiding this comment

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

Honestly I'd probably get around this problem just by changing the hover state, it's probably not worth having this to spec for the amount of time it can take to do it properly.

However if you want to, I think the proper way is to handle mouseEnter and moueLeave and set state in the findDetail for if it is hovered or not. Then render based on that state.

Copy link
Member

Choose a reason for hiding this comment

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

Please do get rid of this though ;)

@jkup jkup force-pushed the improve-findbar-ui-ux branch from 7bc200c to 3bec3be Compare August 24, 2016 02:59
}
},

stopFindInPage (webview) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

does anything actually call this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@bridiver bridiver Aug 25, 2016

Choose a reason for hiding this comment

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

wouldn't this be webviewActions.stopFindInPage vs webview.stopFindInPage?

Copy link
Member

Choose a reason for hiding this comment

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

I didn't refactor that way because webview.stopFindInPage takes a different parameter currently and I wanted to keep it the same as what it was.

Copy link
Collaborator

Choose a reason for hiding this comment

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

that makes sense, I'm just trying to figure out where this actually gets called and I'm not seeing a call to webviewActions.stopFindInPage

Copy link
Collaborator

@bridiver bridiver Aug 25, 2016

Choose a reason for hiding this comment

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

fyi @bbondy - the problem with this turned out to be the result of calling stopFindInPage on hide. keepSelection doesn't actually keep any state in the webcontents, it just keeps the selection highlighted on the page. If you want to keep the state you can't call stopFindInPage

@bbondy bbondy force-pushed the improve-findbar-ui-ux branch from fa0fa6c to fc7767f Compare August 25, 2016 21:35
onFindHide () {
const activeFrame = FrameStateUtil.getActiveFrame(this.props.windowState)
windowActions.setFindbarShown(activeFrame, false)
webviewActions.stopFindInPage()
Copy link
Member

Choose a reason for hiding this comment

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

@bridiver this had to be called here to retain the existing behaviour.
stopFindInPage needs to be called to clear the highlight but to keep the current match in case you command+g.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the problem with this is that calling stopFindInPage resets the webcontents find state so you can't get back to the same search results

Copy link
Member

Choose a reason for hiding this comment

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

but it must keep it because it remembers the next position?

Copy link
Member

Choose a reason for hiding this comment

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

I think btw the webviewAction was used at one point and was committed out.

Copy link
Collaborator

Choose a reason for hiding this comment

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

it doesn't remember the next position, that was the bug. I started a slack conversation to explain

Copy link
Member

Choose a reason for hiding this comment

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

We can't remove the call because when we do the yellow highlight stays forever

@bbondy bbondy force-pushed the improve-findbar-ui-ux branch 2 times, most recently from bc20777 to bb4ac34 Compare August 27, 2016 02:21
Auditors: @jkup

The trick to this was to keep track in our app state when electron has find state defined.  When it is not defined always do the findFirst call
@bbondy bbondy added this to the 0.11.6dev milestone Aug 27, 2016
@bbondy
Copy link
Member

bbondy commented Aug 27, 2016

@alexwykoff I'm going to merge this after all since it's ready.

@bbondy bbondy merged commit 0c72d33 into master Aug 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improved UI/UX of find bar
6 participants