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

Add ability search text in the terminal widget. #5471

Merged
merged 1 commit into from
Feb 24, 2020

Conversation

AndrienkoAleksandr
Copy link
Contributor

terminalFindWidget

Signed-off-by: Oleksandr Andriienko oandriie@redhat.com

export class TerminalSearchFrontendContribution implements CommandContribution, KeybindingContribution {

constructor(
@inject(ApplicationShell) protected readonly shell: ApplicationShell,
Copy link
Member

Choose a reason for hiding this comment

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

Is there a specific reason for injecting through the constructor instead of as a property?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@vince-fugnitto
Copy link
Member

Out of curiosity, why not add the functionality directly in the @theia/terminal package?
This means that apps will not need to explicitly depend on the @theia/terminal-search package just to get search features.

Also, do you believe we can generalise the widget so that it can be used across Theia (ex: output, problems) ?

@AndrienkoAleksandr
Copy link
Contributor Author

Out of curiosity, why not add the functionality directly in the @theia/terminal package?

It's not a problem to move code to the @theia/terminal. If other reviewers like this idea, I will do it.

@akosyakov
Copy link
Member

Please merge in the terminal extension.

@akosyakov
Copy link
Member

@AndrienkoAleksandr looks good, but keyboard navigation does not work properly, try to use keyboard to navigate within the find widget in VS Code and Theia, in VS Code elements are sequential focused, in Theia nothing happens.

Another thing the search box does not have enough contrast in the dark theme. It is hard to see its border. Could you try to align styles with VS Code?

@akosyakov
Copy link
Member

@AlexTugarev @svenefftinge could you have a look as well please

Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

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

LGTM, only detail I miss is being able to go to the next find by pressing enter in the text box.

@paul-marechal
Copy link
Member

paul-marechal commented Jun 19, 2019

And like the previous commenters, it will be better in the terminal extension.

@AndrienkoAleksandr
Copy link
Contributor Author

@akosyakov: Please merge in the terminal extension.

Done.

@marechal-p: only detail I miss is being able to go to the next find by pressing enter in the text box.

Done. Next search result -> Enter, previous search result -> Shift + Enter

@akosyakov: but keyboard navigation does not work properly

Good catch, I fixed bug with moving focus by TAB(move focus to next widget element) and Shift+TAB (move to previously focused element)

@akosyakov: Another thing the search box does not have enough contrast in the dark theme. It is hard to see its border. Could you try to align styles with VS Code?

I aligned selection color with VSCode.
Should I do the same for background and foreground terminal colors too(VSCode has separated colors for terminal in the Theme model)?

@akosyakov akosyakov added the terminal issues related to the terminal label Jul 8, 2019
@akosyakov
Copy link
Member

@AndrienkoAleksandr please review and align the PR with https://github.com/theia-ide/theia/pull/5616/files

I'm testing it again right now.

protected terminalSearchWidgetFactory: TerminalSearchWidgetFactory;

isEnabled(): boolean {
if (!(this.shell.activeWidget instanceof TerminalWidgetImpl)) {
Copy link
Member

Choose a reason for hiding this comment

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

use TerminalWidget, don't program against implementation, review all new code

@akosyakov
Copy link
Member

Should I do the same for background and foreground terminal colors too(VSCode has separated colors for terminal in the Theme model)?

having specific colors sounds good, easy to customize for products without messing with generic styles

Keyboard navigation works well, but match items don't have outline when selected (or maybe where are not selected when i focus and press Enter)?
Theia:
Screen Shot 2019-07-08 at 11 01 12
VS Code:
Screen Shot 2019-07-08 at 11 00 55

Aligning arrows would be nice that it matches to the search box in the editor.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

It looks and behaves well. The code looks much simpler now.

Please address comments, clean up git history, it should not contain merge commits and clean up commits for changes introduced by this PR: https://github.com/theia-ide/theia/blob/master/doc/pull-requests.md#checklist-commit-history

After that you can merge it. 🚀

@akosyakov
Copy link
Member

akosyakov commented Sep 12, 2019

@AndrienkoAleksandr do you need help with cleaning up outstanding commits and squashing git history before merging?

@AndrienkoAleksandr
Copy link
Contributor Author

@akosyakov thanks for great review. Sorry for long delay.

@akosyakov
Copy link
Member

We need to apply color theming to the find widget similar as it is done in VS Code: https://github.com/microsoft/vscode/blob/0dfa355b3ad185a6289ba28a99c141ab9e72d2be/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.ts#L28

It has to be done after theming is landed. We are targeting next release for theming, so this PR will be on hold till then and has to be reworked to apply styles after.

@akosyakov
Copy link
Member

We also should see whether we can extract a reusable simple find widget, i.e. to use it in webviews. But it can be done as another step.

@AndrienkoAleksandr
Copy link
Contributor Author

I resolved merge conflict and fixed styles according to theme changes, also applied arrow icons, but I lost push access...

@paul-marechal
Copy link
Member

paul-marechal commented Feb 10, 2020

@AndrienkoAleksandr while this is an annoying situation, you can always reopen the PR from a fork, moving your branch there. If you do not want to reopen a new PR form, I can push onto the the main repo on your behalf if you push your changes to your fork.

@AlexTugarev
Copy link
Contributor

I resolved merge conflict and fixed styles according to theme changes, also applied arrow icons, but I lost push access...

:-( sad news.

@akosyakov
Copy link
Member

@AndrienkoAleksandr are you commiter? if not, let's nominate you, could you ask some of your teammates?

@AndrienkoAleksandr
Copy link
Contributor Author

@AndrienkoAleksandr are you commiter? if not, let's nominate you, could you ask some of your teammates?

In progress https://projects.eclipse.org/projects/ecd.theia/elections/election-alexander-andrienko-committer-eclipse-theia

@AndrienkoAleksandr
Copy link
Contributor Author

Hello. Current screenshots:

light
contrast
dark

@AndrienkoAleksandr
Copy link
Contributor Author

Is it ok to merge it?

Red Hat, Inc. - initial API and implementation

-->
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
Copy link
Member

Choose a reason for hiding this comment

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

@AndrienkoAleksandr where were these icons taken from?
I don't think we can only use EPL-2.0, in general we use:

SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

Copy link
Contributor Author

@AndrienkoAleksandr AndrienkoAleksandr Feb 19, 2020

Choose a reason for hiding this comment

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

I drawn them in the Inkscape for this issue, removed not needed tags with some meta information not related to the rendering. If it is not OK, I can try to find similar svg icons in the vscode repo.

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 there are errors in the svg file, nothing shows up:

b

error

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 guess licence header break it.

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 will take a look.

Copy link
Member

Choose a reason for hiding this comment

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

@AndrienkoAleksandr we can use the icons present from the vscode-icons repository at the given commit: microsoft/vscode-icons@9c90ce8 (the repo is already covered by CQ for this given commit).

There are icons for arrows (the same used by the monaco editor for it's find):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, thanks, I will do it.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

I think it is good, as usual get rid of commits which fix issues in original commits and good to merge.

I've noticed that cursor should be a pointer when you hover over actions in the search box.

@akosyakov
Copy link
Member

BTW monaco already has internally reusable search widget 🙈 we probably should have exposed and used it instead of implementing kind of the same widget. I would be fine to merge this PR anyway and open the issue to reuse Monaco find widget instead later.

@akosyakov
Copy link
Member

@AndrienkoAleksandr I think it looks super good now, except #5471 (comment) Feel free to fix it and merge.

Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terminal issues related to the terminal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants