-
Notifications
You must be signed in to change notification settings - Fork 150
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
[Modern Find/Replace] Implemented Find-Replace Overlay #1192
base: master
Are you sure you want to change the base?
Conversation
Test Results 1 812 files + 604 1 812 suites +604 1h 32m 26s ⏱️ + 39m 34s For more details on these failures, see this check. Results for commit c7f973c. ± Comparison against base commit 6990a01. ♻️ This comment has been updated with latest results. |
b5cd48f
to
659b102
Compare
Thank you for your feedback, @jukzi. In particular, 9) is related to this issue. |
Did we make any progress here? Would be a shame not to get this beautiful new UI into Eclipse. |
659b102
to
0455efe
Compare
0455efe
to
fae805d
Compare
fae805d
to
f975bc4
Compare
f975bc4
to
0e9bd7c
Compare
@Wittmaxi can you continue with this enhancement now that the refactoring is done? |
He is working on it, but it may still take some time due to limited time budget. We optimistically aim for a contribtion as soon as possible after 2024-03 freeze, so we have quite some time for evaluation in the development cycle for 2024-06.
|
0e9bd7c
to
948e57f
Compare
I expect at least one Test to fail: The FindReplaceDialog-Test currently cannot test the default behavior since the "new Overlay" is opened by default. If this persists after I correctly parametrise the new Overlay, I might have overlooked a problem while merging. |
4e2da58
to
6fb672b
Compare
@HeikoKlare @vogella very happy news! I could fix another final milestone: the Overlay now binds to the constraints of Console's when opened on one (not yet perfectly...): Here is a screenshot of the parameter used for selecting between Find/Replace-Methods: The Find/Replace-Overlay is off by default (for now). I have one doubt and need to check this: This is the relevant code: private void unbindListeners() {
if (targetPart != null && targetPart instanceof StatusTextEditor textEditor) {
Control targetWidget = textEditor.getSourceViewer().getTextWidget();
if (targetWidget != null) {
targetWidget.getShell().removeControlListener(shellMovementListener);
targetWidget.removePaintListener(widgetMovementListener);
targetPart.getSite().getPage().removePartListener(partListener);
}
}
if (targetPart != null && targetPart instanceof PageBookView consoleView) {
Control targetWidget = consoleView.getCurrentPage().getControl();
if (targetWidget != null) {
targetWidget.getShell().removeControlListener(shellMovementListener);
targetWidget.removePaintListener(widgetMovementListener);
targetPart.getSite().getPage().removePartListener(partListener);
}
}
}
private void bindListeners() {
if (targetPart instanceof StatusTextEditor textEditor) {
Control targetWidget = textEditor.getSourceViewer().getTextWidget();
targetWidget.getShell().addControlListener(shellMovementListener);
targetWidget.addPaintListener(widgetMovementListener);
targetPart.getSite().getPage().addPartListener(partListener);
}
if (targetPart != null && targetPart instanceof PageBookView consoleView) {
Control targetWidget = consoleView.getCurrentPage().getControl();
targetWidget.getShell().addControlListener(shellMovementListener);
targetWidget.addPaintListener(widgetMovementListener);
targetPart.getSite().getPage().addPartListener(partListener);
}
} |
dc416a8
to
8910b98
Compare
77725f8
to
5140358
Compare
....ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceOverlayFirstTimePopup.java
Outdated
Show resolved
Hide resolved
b631e5c
to
7653279
Compare
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 have some minor points left that were introduced by recent changes/rebases.
In addition, there is still the issue with the incremental base position I reported in my last review:
- The incremental search base location does only seem to be initialized when the overlay is first created with current cursor position. If you go to a different position in the document and press CTRL+F, the search will start at the original position again and not at the cursor location.
While other known issues regarding usability/accessibility can be addressed incrementally after merging this initial PR, this renders the find functionality rather useless, because you need to reopen the editor to start searching from a different position.
....workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/OverlayAccess.java
Outdated
Show resolved
Hide resolved
....workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/OverlayAccess.java
Outdated
Show resolved
Hide resolved
....workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/OverlayAccess.java
Outdated
Show resolved
Hide resolved
...ch.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/FindReplaceDialogTest.java
Outdated
Show resolved
Hide resolved
...les/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceAction.java
Outdated
Show resolved
Hide resolved
...les/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceAction.java
Show resolved
Hide resolved
...es/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindReplaceOverlay.java
Outdated
Show resolved
Hide resolved
...kbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/FindReplaceUITest.java
Outdated
Show resolved
Hide resolved
7653279
to
2f9136a
Compare
I have fixed the bug with the incremental base location not updating. This is the code where this happens: // in searchBar.addFocusListener(new FocusListener..., ll. 670
@Override
public void focusGained(FocusEvent e) {
// we want to update the base-location of where we start incremental search
// to the currently selected position in the target
// when coming back into the dialog
findReplaceLogic.deactivate(SearchOptions.INCREMENTAL);
findReplaceLogic.activate(SearchOptions.INCREMENTAL);
} I had removed the call to "deactivate" because purely from the activation states it is redundant. For updating base-locations it is not. |
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.
From my side, this one is almost ready to merge. Since it is now too late for 2024-06, we should merge this once the 2024-09 development stream opens. We should then switch back to having the feature enabled by default to ensure that many people will test it from I-Builds or latest from the M1 build.
When testing again, I asked myself one (or two) things regarding the expansion of the replace bar, in particular also considering that we had some feedback from people searching for the replace functionality as they were not able to identify the expansion button:
- Instead of using an image for the expand/collapse button, we could also use UTF-8 text icons like ⯆ and ⯅. Benefits using text would be
- less dependencies on code-external resources and
- better themeing as fonts are properly colored so that we do not have to rely on a gray icon that fits for both light and dark themes but is not perfectly visible in both cases.
- Instead of having the expand/collapse button on the left, we could put it below the search bar to make it easier to identify that clicking this will do some expansion.
Here is how it looks like with the mentioned text icons and font size set to 0.8. It would even be better when having smaller padding within the button, but I could not figure out yet how to achieve that.
For comparison, this is how it looks now:
...ch.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/FindReplaceDialogTest.java
Outdated
Show resolved
Hide resolved
...ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditorPreferenceConstants.java
Outdated
Show resolved
Hide resolved
d2f3b6e
to
ae24342
Compare
I like that one.
IMHO the existing display looks way better, the new very big up and down button look broken or like an UI glitch to me. So +1 for keeping the expand icon on the left, this also aligns with Vscode and as I said before multiple times, MS most likely has more UX experts working on VScode than we have in Eclipse. |
And for some background of my usage in Vscode. First time I wanted to use Replace in Vscode, I also had to search for it, I think it took me maybe 20 seconds to find the expand button using the tooltip of all the UI elements. But I would not like it if VScode would provide a big and always present replace button all the time just to save me a Google search or 20 seconds to look through the button tooltips. |
@HeikoKlare @vogella I am not sure if eclipse has enough documentation for a user to quickly find this feature - especially in the beginning. |
I am sorry for disturbing this almost-ready-to-merge PR with my proposal. This was not meant as a kind of requirement from my side but just as an idea since there were concerns mentioned for the current expand/collapse realization. The answer "we won't/shouldn't do that" is totally fine for me. Some of my conclusions on this:
Don't get me wrong: None of the latter two arguments applies in this case, they are just rather general comments. On the contrary, having an in-editor search functionality realization that behaves equal across different tools (such as VS code and the Eclipse platform / IDE) is a good thing as both are good tools that can be used side-by-side and equal appearance and behavior of such a central functionality makes it easier for user to switch between the two. That's why I agree with @vogella that we should stick with the existing solution. |
ae24342
to
892d433
Compare
I agree with you that his is not an issue big enough for us to get held up by it! |
ae90a77
to
245ed4b
Compare
This PR implements and tests a find/replace dialog which can be overlayed on top of the editor. The overlay uses the FindReplaceLogic which is also used by the existing find/replace dialog. The overlay can be enabled and disabled in the preferences. eclipse-platform#1090
245ed4b
to
c7f973c
Compare
Modern Find-Replace Overlay
newly introduced Overlay in dark theme
newly introduced Overlay on the bottom of the screen, used to perform a replace-operation.
at the top of the screen, with some search-options enabled
What are we addressing (copied from #1090)
The current solution opens a Modal on keypress Control + F - prompting a user to enter a string for finding
and optionally a string to replace the currently found string with.
The status quo also has multiple options for searching which are available by selecting
the appropriate checkbox.
Showcase
2023-10-05_11-21-40.mp4