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

Usability of Find and replace. #6650

Closed
1 of 9 tasks
tgeorgeux opened this issue Jun 19, 2019 · 13 comments
Closed
1 of 9 tasks

Usability of Find and replace. #6650

tgeorgeux opened this issue Jun 19, 2019 · 13 comments

Comments

@tgeorgeux
Copy link
Contributor

tgeorgeux commented Jun 19, 2019

Issue 1 - Next and previous arrows.

Problem: When there is no text in the input field, the up and down arrows are still active and move the document up and down. They should be disabled until there is text in the box that has a match. See the gif below:
FindandReplaceDisableButtons

Solution: Disable buttons at all times unless there is text in the input field with relevant matches in the document.

Issue 2 - Add tooltips on extended hover.

For quick reference:
Screen Shot 2019-06-19 at 1 32 18 PM

  • The twisty that activates the 'replace' functionality should be labeled 'show replace' on the tooltip. (hide replace on hover when replace is showing)
  • An 'Aa' icon that I think has to do with case sensitivity that should have a 'toggle case sensitivity' tooltip
  • A '.*' icon that I'm not 100% sure what it does but should be labeled as well.
    Also, the three buttons should have the tooltip, 'previous match', 'next match', and 'close find and replace' respectively.

@ivanov would it make sense to do a quick accessibility audit of these pieces for aria labels?

Issue 3 - Visual elements

Screen Shot 2019-06-19 at 1 32 05 PM

A couple of issues that should be addressed:
  • Align the width of the input text boxes horizontally
  • The 'find' box is 20px height and the replace is 16px height. These should match. (Use 20px for now)
  • Give all buttons a hover effect similar to other toolbar buttons, a color of layout-color4.
.bp3-button.bp3-minimal:hover {
    -webkit-box-shadow: none;
    box-shadow: none;
    background: rgba(167, 182, 194, 0.3);
    text-decoration: none;
    color: #182026;
}
  • For the Replace and Replace All buttons should be minimal buttons with a similar hover effect noted above, in 13px font, with ui-font-color1 (currently using ui-font-color0)
  • For the next and previous buttons as well as the close button, use the Material Design arrow_forward and arrow_backward icons, as well as the Material Design close icon for the close button.
  • For the twisty icon use Material Design expand_more icon to show replace functionality and expand_less to hide replace.
@tgeorgeux tgeorgeux added this to the 1.0 milestone Jun 19, 2019
@tgeorgeux
Copy link
Contributor Author

I'm just looking over the extension manager and it seems to make good use of the similar style twisty here as we're using here. I think if copy the properties of that button it would be sufficient for this case. I would still add a tooltip.

@ellisonbg ellisonbg self-assigned this Jun 20, 2019
@jasongrout
Copy link
Contributor

ping @aschlaep

@vidartf vidartf modified the milestones: 1.0, 1.1 Jul 2, 2019
@blink1073 blink1073 modified the milestones: 1.1, 1.2 Aug 27, 2019
@jasongrout jasongrout modified the milestones: 1.2, 2.0 Oct 11, 2019
@jasongrout jasongrout self-assigned this Dec 2, 2019
@krassowski
Copy link
Member

krassowski commented Jan 12, 2020

Recently there was a question on Stack Overflow asking how to use the Find & Replace function. The asker even thought that it might have been removed. I added an answer, but it highlights that we need to increase discoverability.

Some quick ideas:

  • have the replace bar part expanded by default (or maybe only the first time the user opens it?)
  • rename the command in the menu from 'Find...' to 'Find (and replace)...'

Edit: #7725 partially addresses exactly this issue by adding "Find and Replace…" command to the menu.

@jasongrout jasongrout modified the milestones: 2.0, 2.1 Jan 22, 2020
@jasongrout jasongrout modified the milestones: 2.1, 3.0 Mar 12, 2020
@jasongrout jasongrout modified the milestones: 3.0, 3.1 Oct 21, 2020
@krassowski
Copy link
Member

Minor visual thing when the simple mode is turned on: the top border is missing and it looks a bit strange.

Screenshot from 2021-02-05 03-55-57

@krassowski
Copy link
Member

For the twisty icon use Material Design expand_more icon to show replace functionality and expand_less to hide replace.

Would it be possible to add a replace icon next to the twisty icon or make it more prominent in any other way? It appears to me that many users are not aware of the replace functionality and it is a frequent complain on stack overflow and in other issues. There is find_replace icon in Material Design, but maybe there is something better out there.

@jasongrout
Copy link
Contributor

I think we definitely can make it bigger and more prominent. It's pretty small. Compare to vs code, for example:
Screen Shot 2021-02-10 at 3 08 41 PM

@tgeorgeux
Copy link
Contributor Author

tgeorgeux commented Feb 11, 2021 via email

@ptitzler
Copy link

ptitzler commented Feb 15, 2021

Contributing to the problem might be that under certain circumstances <cmd><f> opens the browser's find dialog. In my specific scenario ^^ I had the Elyra Python script editor open (note the editor tab is highlighted) but clicked somewhere outside of the editor window before hitting the keyboard shortcut. Since the displayed dialog didn't display a replace option, I checked under Edit and only saw the Find ... option in the drop down menu. Therefore I didn't realize that the find dialog I saw was not the JupterLab find [and replace] dialog.

image

@krassowski
Copy link
Member

krassowski commented May 6, 2021

Note: users coming from Colab may assume that there is no search & replace, because in Colab it is placed in the sidebar:

Screenshot from 2021-05-05 20-42-20

which is much more prominent and exposes all functions straight away.

It might not work as well with mult-tab/panel layout of JupyterLab, but maybe having that as an option could be useful.

(This is to follow the SO question I mentioned surpassing up votes from 53 users and frustrated comments below my answer).

@blink1073 blink1073 modified the milestones: 3.1, 4.0 Jun 15, 2021
@LuckyMD
Copy link

LuckyMD commented Jul 14, 2021

Hi!
Thanks for all of your work. I just wanted to chime in quickly that I also thought the find & replace functionality was missing, then came across the stack overflow post linked above. One aspect that I definitely miss from jupyter is to find & replace only in highlighted cells. I commonly copy over cells and try to do the same thing on a different data object when prototyping or running a quick analysis. With the jupyter lab version of the functionality I have to be much more careful when replacing as I cannot (or have not found a way to) confine the replace only to a few cells.

@krassowski
Copy link
Member

Hi @LuckyMD this was implemented in #10067 and is included in JupyterLab 3.1 which is now in release candidate phase (please help testing it if you would like to try out this feature). Example:

test2

@LuckyMD
Copy link

LuckyMD commented Jul 14, 2021

Thanks a lot @krassowski! I will check it out. I'm still on 3.0.16 :). If there's any chance at a shortcut for find & replace in highlighted cells, that would be great too ;).

@JasonWeill
Copy link
Contributor

Checking in on this issue with JupyterLab 4.1. I'll go through each of the sub-issues, one at a time, moving them into other issues if they're still an issue in Lab 4.1. @tgeorgeux Thank you for your contributions!

Issue 1 - Next and previous arrows.

Still an issue in Lab 4.1: I opened #15813.

Issue 2 - Add tooltips on extended hover.

a. The twisty that activates the 'replace' functionality should be labeled 'show replace' on the tooltip. (hide replace on hover when replace is showing)

This button now has a tooltip that reads, "Toggle Replace". Opened #15814 to request a more specific tooltip.

b. An 'Aa' icon that I think has to do with case sensitivity that should have a 'toggle case sensitivity' tooltip

This button now has a tooltip that reads, "Match Case".

c. A '.*' icon that I'm not 100% sure what it does but should be labeled as well.

This button now has a tooltip that reads, "Use Regular Expression".

d. Also, the three buttons should have the tooltip, 'previous match', 'next match', and 'close find and replace' respectively.

The "Previous Match" and "Next Match" buttons now have tooltips that also indicate their keyboard shortcuts. The close button does not have a tooltip; opened #15815 to request that one be added.

Issue 3 - Visual elements

a. Align the width of the input text boxes horizontally

This is now done; the "match case buttons" are aligned vertically, and the "Find" box has two additional buttons that extend further to the right.

b. The 'find' box is 20px height and the replace is 16px height. These should match. (Use 20px for now)

This is fixed; both Find and Replace have a height of 20px.

c. Give all buttons a hover effect similar to other toolbar buttons, a color of layout-color4.

This is fixed; all buttons now have a hover effect.

d. For the Replace and Replace All buttons should be minimal buttons with a similar hover effect noted above, in 13px font, with ui-font-color1 (currently using ui-font-color0)

These buttons now have a minimal theme with a hover effect.

e. For the next and previous buttons as well as the close button, use the Material Design arrow_forward and arrow_backward icons, as well as the Material Design close icon for the close button.

These buttons now use the previous and next buttons, consistent with other text editors (for example, VSCode uses an up and down arrow for "previous" and "next" match respectively). All buttons use

f. For the twisty icon use Material Design expand_more icon to show replace functionality and expand_less to hide replace.

This now uses the Material "caret down" or "caret right" icon.

Closing this issue. Please open additional UX improvement ideas individually. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants