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

Added dynamic tab alignment support in MultiPageEditorPart #2224

Merged

Conversation

praveen-skp
Copy link
Contributor

Issue: #2223

This pull request introduces a new feature in Eclipse that allows users to configure the alignment of tabs in multi-page editors. The tabs, which are currently fixed at the bottom, can now be dynamically positioned on the top or bottom, based on user preference.

Key Changes:

  • Added a new preference for multi-page editor tab alignment.
  • Added a preference change listener to MultiPageEditorPart.
  • Updated tab style based on the user's preference.

New preference:
New preference selected

Tabs on top of the screen:
Expected look

Copy link
Contributor

github-actions bot commented Aug 27, 2024

Test Results

 1 821 files  ±0   1 821 suites  ±0   1h 50m 26s ⏱️ + 1m 33s
 7 724 tests ±0   7 495 ✅  - 1  228 💤 ±0  1 ❌ +1 
24 333 runs  ±0  23 585 ✅  - 1  747 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit 2e123d4. ± Comparison against base commit 2521210.

♻️ This comment has been updated with latest results.

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

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

This is an interesting feature, but ideally it should also give custom multipage editors control whether they want to follow up the tab position or keep some specific tab position independently of the preference, see also coment in code.

@tomaswolf
Copy link
Member

... ideally it should also give custom multipage editors control whether they want to follow up the tab position or keep some specific tab position independently of the preference...

Not sure about this. UI consistency is important. If every multipage editor gets to decide on its own, we'll end up with some having the tabs at the top and some at the bottom. Isn't that going to be confusing or at least inconvenient for users?

@iloveeclipse
Copy link
Member

Isn't that going to be confusing or at least inconvenient for users?

I'm thinking about products like ours where the editors tab position is important because we have lot of complicated and nested UI elements, so users "occasionally" changing global preference would see "broken" UI's in the places where nothing was changed for years.

@BeckerWdf BeckerWdf added the noteworthy Noteworthy feature label Aug 27, 2024
@praveen-skp
Copy link
Contributor Author

Hi @iloveeclipse, Hi @laeubi ,
I have incorporated the review comments. Could you please go through the change once again ?

@BeckerWdf
Copy link
Contributor

New preference: New preference selected

I wondering if we should move the new checkbox above the "Number of open editor..." setting so that all checkboxes are next to each other?
Did you move it below the "Number of open editor..." by intention?

@praveen-skp
Copy link
Contributor Author

Dropdown
Sorry, i forgot to add the current UI after the change. Its now changed from check box to dropdown, after incorporating the review comments.

@BeckerWdf
Copy link
Contributor

Sorry, i forgot to add the current UI after the change. Its now changed from check box to dropdown, after incorporating the review comments.

Ah yes. Forgot that. In that case I think the ordering is ok. And I just realised that the "Automatically close.." checkbox and the next input field belong together. One can see this via the indentation. Maybe we could make this more explicit but putting a box around these two - but that would be a different issue.

@BeckerWdf
Copy link
Contributor

but that would be a different issue

Created #2297 for this.

@BeckerWdf
Copy link
Contributor

I'm thinking about products like ours where the editors tab position is important because we have lot of complicated and nested UI elements, so users "occasionally" changing global preference would see "broken" UI's in the places where nothing was changed for years.

I have some doubts: So with the current state the user could set the preference but some individual editor may not consider this. Isn't this strange behaviour from the user's perspective.
I see your use-case but can we find another solution for it? E.g. having a mechanisms for a product definition to hide this new preference so that in your product the user cannot choose to have editor tabs at the top?

@BeckerWdf
Copy link
Contributor

@praveen-skp: Can you pls. rebase an resolve the merge conflicts?

@praveen-skp praveen-skp force-pushed the align_multi_page_editor_tab branch 2 times, most recently from 8c12047 to 70ec47a Compare October 14, 2024 03:02
@BeckerWdf
Copy link
Contributor

I see:

03:17:33.152 [WARNING] MavenProject: org.eclipse.platform:org.eclipse.ui.editors:3.18.100-SNAPSHOT @ /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/bundles/org.eclipse.ui.editors/.polyglot.META-INF: baseline and build artifacts have same version but different contents

Where does this come from?

@BeckerWdf
Copy link
Contributor

@jukzi:

I see failing test with:

Cannot invoke "java.util.function.Supplier.get()" because "this.shell" is null
java.lang.NullPointerException: Cannot invoke "java.util.function.Supplier.get()" because "this.shell" is null
	at org.eclipse.test.Screenshots$ScreenshotOnFailure.dispose(Screenshots.java:52)
	at org.eclipse.test.Screenshots$ScreenshotOnFailure.finished(Screenshots.java:47)

Can you pls. have a look what's the issue there?

@jukzi
Copy link
Contributor

jukzi commented Oct 14, 2024 via email

@praveen-skp praveen-skp force-pushed the align_multi_page_editor_tab branch 2 times, most recently from 005458e to 4d8fc71 Compare October 21, 2024 02:24
@praveen-skp praveen-skp force-pushed the align_multi_page_editor_tab branch 2 times, most recently from 42f141a to ca30a37 Compare October 23, 2024 03:25
@BeckerWdf
Copy link
Contributor

@azoitl: Referring to our talk on OCX.
You said this feature is already available somewhere?

@azoitl
Copy link
Contributor

azoitl commented Oct 24, 2024

@azoitl: Referring to our talk on OCX. You said this feature is already available somewhere?

No not yet. There is a bugzilla entry: https://bugs.eclipse.org/bugs/show_bug.cgi?id=58945 there you can find links to the gerrit patches I did. But I do not recommend to use them. There is someone who will start working on that.

@BeckerWdf
Copy link
Contributor

pr-head is failing with

Failed to execute goal org.eclipse.tycho:tycho-surefire-plugin:4.0.9:test (default-test) on project org.eclipse.ui.tests: An unexpected error occurred while launching the test runtime (process returned error code 13). The process logfile /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/tests/org.eclipse.ui.tests/target/work/data/.metadata/.log might contain further details. Command-line used to launch the sub-process was /opt/tools/java/openjdk/jdk-17/latest/bin/java -Dosgi.noShutdown=false -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 --add-modules=ALL-SYSTEM -Dosgi.clean=true -ea -jar /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/.m2/repository/p2/osgi/bundle/org.eclipse.equinox.launcher/1.6.900.v20240613-2009/org.eclipse.equinox.launcher-1.6.900.v20240613-2009.jar -data /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/tests/org.eclipse.ui.tests/target/work/data -install /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/tests/org.eclipse.ui.tests/target/work -configuration /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/tests/org.eclipse.ui.tests/target/work/configuration -application org.eclipse.tycho.surefire.osgibooter.uitest -testproperties /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/tests/org.eclipse.ui.tests/target/surefire.properties in working directory /home/jenkins/agent/workspace/eclipse.platform.ui_PR-2224/tests/org.eclipse.ui.tests -> [Help 1]

This looks unrelated. Should we merge it anyways?

@jukzi
Copy link
Contributor

jukzi commented Oct 25, 2024

This looks unrelated. Should we merge it anyways?

Please make sure the CI will not fail after any commit. for that you can rerun the build , document (with an issue) or even fix the failure

@praveen-skp praveen-skp force-pushed the align_multi_page_editor_tab branch 2 times, most recently from 2f0224a to 5967ee4 Compare October 30, 2024 07:20
- Added a new preference for multi-page editor tab alignment.
- Added a preference change listener to MultiPageEditorPart.
- Updated tab style based on the user's preference.
- Changed the check box to drop down with Top and Bottom options
- Made the private methods protected
- Converted the preference store value from boolean to int and storing
the SWT value of the selection directly
@BeckerWdf
Copy link
Contributor

failed test on macOS is already know to fail. it's unrelated See: #370.

If nobody objects I plan to merge this today.

@sratz sratz merged commit 9308f4a into eclipse-platform:master Oct 31, 2024
15 of 17 checks passed
@praveen-skp praveen-skp deleted the align_multi_page_editor_tab branch November 4, 2024 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noteworthy Noteworthy feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants