Skip to content

Show pinned editors first in the editor chevron list and in Ctrl+E when enabled - #4450

Open
deepika-u wants to merge 1 commit into
eclipse-platform:masterfrom
deepika-u:pinned_editors_7thoct
Open

deepika-u wants to merge 1 commit into
eclipse-platform:masterfrom
deepika-u:pinned_editors_7thoct

Conversation

@deepika-u

@deepika-u deepika-u commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds an opt-in preference under Preferences > General > Editors: "Show pinned editors first in editor lists (chevron and Ctrl+E)" (off by default).

When many editors are open, pinned editors are the ones users want to reach quickly. With the preference enabled, pinned editors are listed first in the editor chevron list (>>) and in the Quick Switch list (Ctrl+E).

Tabs are not moved and the workbench model is not modified. Only the order of these two lists changes.


Behavior

When enabled

  1. Chevron list (>>): pinned editors form one block above the other editors. Inside the pinned block and inside the remaining editors, the existing order of the list applies (see below).
  2. Quick Switch (Ctrl+E): pinned editors are listed first, then the others.
    Inside each group the existing order is kept (MRU order, or tab order if MRU is disabled).
  3. Ctrl+E still pre-selects the previously used editor, so Ctrl+E followed by Enter keeps switching to it, even when pinned editors are listed above it.
  4. Changing the preference takes effect the next time a list is opened. No restart is needed.

When disabled (default)

Behavior is unchanged from before this PR.


Limitations

  • The tab strip is not changed, so its order can differ from the lists.
  • Existing ordering rules still apply inside each group:
    • Chevron with MRU enabled: tabs that are scrolled out of view first, then the visible ones, alphabetical within each. Pinned editors are placed above both.
    • Chevron with MRU disabled: tab order.
    • Ctrl+E: MRU order, or tab order if MRU is disabled.
  • The chevron change applies to editor stacks only, not to view stacks.

Implementation

  • PinnedEditorsOrder (new): single place for the preference lookup and the stable pinned-first ordering. It is used by the chevron list, Ctrl+E and the preference page.
  • BasicPartList: chevron list uses it, and the MRU sorter has one pinned category.
  • WorkbookEditorsHandler: Ctrl+E uses it, and the pre-selection uses the position in the reordered list.
  • EditorsPreferencePage / IDEEditorsPreferencePage: new checkbox. Defaults are read from the default scope, and a failing flush() is logged.
  • CTabRendering: new preference constants.

Testing

  • WorkbookEditorsHandlerTest:
    • Ctrl+E order with MRU and non-MRU, preference enabled and disabled.
    • Ctrl+E pre-selects the previously used editor with pinned editors listed first.
  • Chevron list: verified manually (screenshots below). No automated test yet.

Before the pr(disabled) ->
image

image

Ctrl+E ->
image

After the pr(when enabled) ->
image

image

Ctrl+E ->
image

Why This Feature is Needed

  1. Hierarchy & Priority Awareness: With the preference enabled, pinned editors are listed at the top of the editor chevron list (>>) and the Quick Switch list (Ctrl+E).
  2. Quick Access: Pinned editors are at a predictable position at the top of both lists, so they can be reached with the arrow keys and Enter without scanning the whole list.
  3. Workflow Continuity in High-Volume Workspaces: Temporary files opened during development are listed below the pinned editors, so the files you pinned as anchors stay at the top of the lists.

Why It Matters

  1. Zero Disruption / Opt-in: SHOW_PINNED_EDITORS_FIRST defaults to false. When off, the chevron list and Ctrl+E behave exactly as before this PR.
  2. Existing Ordering Is Kept: Pinned editors are only grouped above the others. Inside the pinned group and inside the other editors, the existing order of each list still applies (MRU or tab order for Ctrl+E; the existing chevron ordering for the chevron list).
  3. No Side Effects on Tabs: Tabs are not moved and the workbench model is not modified. Only the order of the two lists changes.
  4. Small and Contained: The preference lookup and the pinned-first ordering live in one helper class, used by the chevron list, Ctrl+E and the preference page.

@SougandhS

Copy link
Copy Markdown
Contributor

Cool feature, something many users have wanted for a long time.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   48m 40s ⏱️ - 5m 32s
 8 547 tests +2   8 307 ✅ +2  240 💤 ±0  0 ❌ ±0 
21 513 runs  +6  20 840 ✅ +6  673 💤 ±0  0 ❌ ±0 

Results for commit b29f4bf. ± Comparison against base commit ad7efa0.

♻️ This comment has been updated with latest results.

@iloveeclipse

Copy link
Copy Markdown
Member

While reading the description I assumed it will be applied to the editor tabs, not just the editor drop down list. Now tabs and drop-down list order will be inconsistent, which is not nice.

Would it make sense to apply same preference to the tab ordering? E.g. if user pins an editor, it will be moved to the left most place in the tab folder, if a second editor pinned, it will be moved next to the already pinned one?

@deepika-u

deepika-u commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Would it make sense to apply same preference to the tab ordering? E.g. if user pins an editor, it will be moved to the left most place in the tab folder, if a second editor pinned, it will be moved next to the already pinned one?

Sounds cool, let me check on it.

@deepika-u
deepika-u force-pushed the pinned_editors_7thoct branch from 3e7124e to f64ba99 Compare October 7, 2026 13:34
@deepika-u deepika-u changed the title Show pinned editors first in editor chevron drop-down list Show pinned editors first on editor tabs and in chevron drop-down list Oct 7, 2026
@deepika-u
deepika-u force-pushed the pinned_editors_7thoct branch 3 times, most recently from 0b9a41f to 77626aa Compare October 8, 2026 07:37
@deepika-u

Copy link
Copy Markdown
Contributor Author

@iloveeclipse - Thank you for the thoughtful feedback and suggestion!

I completely agree that keeping the physical editor tabs in sync with the drop-down lists provides a much more cohesive and intuitive user experience.

The PR and description have been updated accordingly. Please feel free to review the latest changes and let me know if you have any further suggestions!

@iloveeclipse

Copy link
Copy Markdown
Member

OK, I believe I was not clear enough: shouldn't then the pinned editors also move to the left most place int the editor tabs list shown for the editor area?
image

@deepika-u

Copy link
Copy Markdown
Contributor Author

OK, I believe I was not clear enough: shouldn't then the pinned editors also move to the left most place int the editor tabs list shown for the editor area?

Let me check on it. Looks like something got missed out.

@deepika-u
deepika-u force-pushed the pinned_editors_7thoct branch from 77626aa to 482dec6 Compare October 8, 2026 12:30
@deepika-u

Copy link
Copy Markdown
Contributor Author

I have checked further and i could see
image

Can you check now when you get some time please?

@deepika-u

deepika-u commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

@merks : can you take a look at this small feature, when you get some time please? if anything else needs to be made better or different in your opinion?

@HeikoKlare : do you have any inputs on this please.

@iloveeclipse

Copy link
Copy Markdown
Member

@deepika-u : the tests are failing

@deepika-u

Copy link
Copy Markdown
Contributor Author

@deepika-u : the tests are failing

Yes - checking on it. Will keep the task posted.

@HeikoKlare

Copy link
Copy Markdown
Contributor

Thanks for working on this, the idea is quite interesting and would be good to have. However, the overall concept and the resulting behavior are hard to understand from a user's (or at least my) perspective: pinned tabs are moved to the left, but with MRU enabled (the default) tab visibility depends on selection recency, so pinned tabs can still disappear into the chevron. In addition, the tab strip, the chevron list (grouped by pinned/hidden, then alphabetical) and Ctrl+E (activation history) end up showing three different orders. I tried to play around with the PR but was quite confused of the behavior (even more than of the already existing MRU behavior), comparable to what @iloveeclipse already pointed to. I think we first need one simple rule that users can understand, e.g., "pinned editors are listed first in the chevron list and in Ctrl+E" without moving tabs, or "pinned tabs never overflow" (which would probably require support in CTabFolder).

Apart from that, the current implementation does not seem to be ready for production yet. When taking a first look at it, I stumpled upon these points:

  1. The pinned-first ordering is computed in several places. StackRenderer reorders the model. BasicPartList splits its input into pinned and unpinned and also sorts pinned first in its comparator. WorkbookEditorsHandler splits again. As long as the model is already reordered, most of this is redundant. PleasYou may put isPinned, the preference lookup and the ordering into one shared helper that matches the chosen concept.
  2. The renderer changes the (persisted) model. Toggling the preference sorts all editor stacks by a transient open sequence. That discards any tab order the user arranged by dragging, even in stacks without pinned editors. The sequence is not persisted, so after a restart the "original" order cannot be restored anyway. Also, nothing keeps pinned editors first: an unpinned tab can still be dragged in front of pinned ones (see my comment on user-visible behavior).
  3. Preference handling: performDefaults() should read the DefaultScope (otherwise product customizations are ignored), and a failing flush() should be logged instead of silently swallowed, as ViewsPreferencePage does for the same node. WorkbookEditorsHandler reads only the instance scope while the renderer uses the preferences service, so all consumers should share one way of reading the value. The label and Javadoc only mention the drop-down lists, but the preference also moves the actual tabs.
  4. In WorkbookEditorsHandlerTest, the copyright holder "vogella GmbH" was replaced by "IBM Corporation and others". That should not be changed.

@deepika-u

Copy link
Copy Markdown
Contributor Author

Thanks for working on this, the idea is quite interesting and would be good to have.

Thanks for the detailed feedback, let me check them.

@deepika-u
deepika-u force-pushed the pinned_editors_7thoct branch from 1ec46c9 to f54fac0 Compare October 30, 2026 11:38
@deepika-u

Copy link
Copy Markdown
Contributor Author

@HeikoKlare thanks a lot for the detailed review. I'd like to narrow this PR to one simple rule:

With the preference enabled, pinned editors are listed first in the editor chevron list and in Ctrl+E. Tabs are not moved.

Done:

  • Restored the vogella copyright header in WorkbookEditorsHandlerTest (my earlier correction had not made it into the pushed commit; it is in the latest push).

I'll update the PR shortly with:

  • Tab reordering removed from StackRenderer (and its test), so the model is no longer modified. This also removes the StackRendererTest failure.
  • One shared helper for the preference lookup and the pinned-first ordering.
  • Preference handling: default scope in performDefaults(), a failing flush() is logged, and all consumers read the value the same way.
  • Label, Javadoc and description updated to match.

Known limitations:

  • Tab strip order is unchanged, so it can differ from the lists.
  • Within the pinned and unpinned groups the existing order applies (MRU or tab order for Ctrl+E; hidden-first, then alphabetical for the chevron under MRU).

Heiko, does this match what you had in mind?

@iloveeclipse thanks for the suggestion to move pinned tabs. With MRU on, tab visibility depends on recency, so pinned tabs can still end up in the chevron, and moving them changes the persisted model and the order the user arranged by dragging. I'd keep this PR to the lists (chevron and Ctrl+E) and revisit the tab strip separately. Is that OK for you?

@iloveeclipse

Copy link
Copy Markdown
Member

With MRU on, tab visibility depends on recency, so pinned tabs can still end up in the chevron, and moving them changes the persisted model and the order the user arranged by dragging. I'd keep this PR to the lists (chevron and Ctrl+E) and revisit the tab strip separately. Is that OK for you?

Sure. Should you follow on this, one possibility would be to move tabs only if MRU is off, or spend yet another option to move pinned tabs.

@deepika-u

Copy link
Copy Markdown
Contributor Author

Sure. Should you follow on this, one possibility would be to move tabs only if MRU is off, or spend yet another option to move pinned tabs.

Thanks, that makes sense. I'll keep this PR to the chevron list and Ctrl+E.
Moving tabs only with MRU off, or behind a separate option, sounds like a good direction for a follow-up, and I'll look at it separately after this one.

@HeikoKlare

Copy link
Copy Markdown
Contributor

With the preference enabled, pinned editors are listed first in the editor chevron list and in Ctrl+E. Tabs are not moved.

Yes, that sounds reasonable. But I also have to admit that I am a bit afraid that with more options for tab sorting, it will become more and more incomprehensive for users. I have not used editor pinning before and, if I understand correctly, it is supposed to avoid editor closing/replacement. Now it gets an additional semantics (sorting, but only under specific circumstances) while sorting is already done in a mixed way of user sorting and MRU. So this has the risk of becoming rather confusing (for user as well as for developers who have to take care of all the interacting functionalities). We already had a discussion about the MRU behavior recently, which is strange for certain scenarios: #4207

So I wonder if we should not take a step back and think of a holistic concept of how tab sorting should happen and if the existing pinning functionality is the right thing to affect sorting at all. I do not want to ask for a complete UX redesign of this area with all the effort it would require, but I have the impression that this proposal may rather become a quick fix than a smooth integration into existing concepts. If people using pinning more often have a different opinion, that would probably be more valuable than mine.

@deepika-u deepika-u changed the title Show pinned editors first on editor tabs and in chevron drop-down list Show pinned editors first in the editor chevron list and in Ctrl+E when enabled Nov 2, 2026
@deepika-u
deepika-u force-pushed the pinned_editors_7thoct branch from f54fac0 to 3a60c26 Compare November 2, 2026 15:29
@deepika-u

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews. I have pushed the latest changes (all review points addressed, squashed into one commit). The PR is now limited to the rule discussed: with the preference enabled, pinned editors are listed first in the chevron list and in Ctrl+E. Tabs are not moved and the model is not modified.

  • Tab reordering removed, so drag order is untouched.
  • Ordering and preference lookup are in one helper.
  • The preference page reads the default scope and logs a failing flush.
  • Copyright is restored.

Title and description are updated to match.

For the broader question about tab ordering and pinning, I opened a discussion to collect opinions from people who use pinning a lot: #4536. I am happy to adapt this PR depending on the outcome.

@deepika-u
deepika-u force-pushed the pinned_editors_7thoct branch from 88070a9 to b29f4bf Compare November 16, 2026 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants