-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
export class TerminalSearchFrontendContribution implements CommandContribution, KeybindingContribution { | ||
|
||
constructor( | ||
@inject(ApplicationShell) protected readonly shell: ApplicationShell, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Out of curiosity, why not add the functionality directly in the Also, do you believe we can generalise the widget so that it can be used across Theia (ex: |
It's not a problem to move code to the @theia/terminal. If other reviewers like this idea, I will do it. |
Please merge in the terminal extension. |
@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? |
@AlexTugarev @svenefftinge could you have a look as well please |
There was a problem hiding this 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.
And like the previous commenters, it will be better in the terminal extension. |
Done.
Done. Next search result -> Enter, previous search result -> Shift + Enter
Good catch, I fixed bug with moving focus by TAB(move focus to next widget element) and Shift+TAB (move to previously focused element)
I aligned selection color with VSCode. |
@AndrienkoAleksandr please review and align the PR with https://github.com/theia-ide/theia/pull/5616/files I'm testing it again right now. |
packages/terminal/src/browser/search/terminal-search-keybinding-context.ts
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-keybinding-context.ts
Outdated
Show resolved
Hide resolved
protected terminalSearchWidgetFactory: TerminalSearchWidgetFactory; | ||
|
||
isEnabled(): boolean { | ||
if (!(this.shell.activeWidget instanceof TerminalWidgetImpl)) { |
There was a problem hiding this comment.
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
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/terminal-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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. 🚀
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/search/terminal-search-widget.tsx
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/terminal-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
packages/terminal/src/browser/terminal-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
@AndrienkoAleksandr do you need help with cleaning up outstanding commits and squashing git history before merging? |
@akosyakov thanks for great review. Sorry for long delay. |
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. |
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. |
I resolved merge conflict and fixed styles according to theme changes, also applied arrow icons, but I lost push access... |
@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. |
:-( sad news. |
@AndrienkoAleksandr are you commiter? if not, let's nominate you, could you ask some of your teammates? |
|
51abba6
to
8d43955
Compare
Is it ok to merge it? |
Red Hat, Inc. - initial API and implementation | ||
|
||
--> | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
):
- Ex: arrow-down
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
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. |
7e872b0
to
73b62fe
Compare
@AndrienkoAleksandr I think it looks super good now, except #5471 (comment) Feel free to fix it and merge. |
73b62fe
to
a693795
Compare
Signed-off-by: Oleksandr Andriienko <oandriie@redhat.com>
06581bc
to
5209a9e
Compare
Signed-off-by: Oleksandr Andriienko oandriie@redhat.com