[IJPL-43620] [platform] Custom Ordering for Status Bar Items#3447
Open
jakub-bochenski wants to merge 2 commits intoJetBrains:masterfrom
Open
[IJPL-43620] [platform] Custom Ordering for Status Bar Items#3447jakub-bochenski wants to merge 2 commits intoJetBrains:masterfrom
jakub-bochenski wants to merge 2 commits intoJetBrains:masterfrom
Conversation
added 2 commits
March 5, 2026 14:59
At first I tried implementing user ordering using LoadingOrder: - currently the order of widgets in status bar is defined by plugins, using anchors like after LineSeparator - we want to allow the user to override this order - naive approach fails because, you might have two widgets A and B, typically B is after A but the user rearranges them, it will cause an exception if another widget has anchor like after A, before B - trying to override all the anchors and "linearize" them (sequential after anchors as per desired visual order), only helps assuming no new widgets are added, - even considering all currently available widgets (active and inactive) this will still fail if a new plugin that contributes status bar widgets is installed later - since widgets can be added and removed, there is a need for an algorithm to reconcile the order desired by the user and the default order defined by the plugins - there is no obvious, simple approach; this is a partial-order merge problem, this would require extending the DFSTBuilder.java class to support weighted edges So I implemented a different approach. User moves are recorded separately and applied after the LoadingOrder sorting is applied (`WidgetSorter`) I didn't find any tests covering the status bar. I've added a unit test to verify that the widgets are sorted correctly. I've also fixed `com.intellij.openapi.wm.impl.status.IdeStatusBarImplKt#wrap` method to set WIDGET_IT. Missing WIDGET_IT was preventing DnD from working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At first I tried implementing user ordering using LoadingOrder:
So I implemented a different approach.
User moves are recorded separately and applied after the LoadingOrder sorting is applied (
WidgetSorter)I didn't find any tests covering the status bar.
I've added a unit test to verify that the widgets are sorted correctly.
I've also fixed
com.intellij.openapi.wm.impl.status.IdeStatusBarImplKt#wrapmethod to set WIDGET_IT.Missing WIDGET_IT was preventing DnD from working.