Move style customization to the sidebar - #14025
Conversation
There was a problem hiding this comment.
Pull request overview
Moves plot style customization controls out of the “Customize plot” dialog and into the plot window sidebar, by introducing a dedicated sidebar “Style options” panel and a compact StyleChooser presentation.
Changes:
- Added a new sidebar
StyleOptionswidget (with reset + availability toggling) and wired it intoPlotWindow. - Updated
StyleChooserto support a compact rendering and emit astyleChangedsignal. - Removed the old style customization view/tab and updated unit/UI tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/ert/gui/plotting/widgets/plot_controls/style_options.py |
New sidebar panel for editing default/history/observation styles. |
src/ert/gui/plotting/plot_window.py |
Instantiates/inserts the style panel into the sidebar and applies selected styles when plotting. |
src/ert/gui/plotting/widgets/plot_controls/__init__.py |
Exports StyleOptions from plot controls. |
src/ert/gui/plotting/customization_dialog/style_chooser.py |
Adds compact mode, compact marker symbols, and a styleChanged signal. |
src/ert/gui/plotting/customization_dialog/customize_plot_dialog.py |
Removes the “Style” tab from the customization dialog. |
src/ert/gui/plotting/customization_dialog/style_customization_view.py |
Removed obsolete customization view. |
tests/ert/unit_tests/gui/plotting/widgets/test_style_options.py |
Adds unit coverage for the new sidebar style controls and compact chooser behavior. |
tests/ert/ui_tests/gui/test_plot_customization.py |
Updates dialog logging assertions after removing the style tab. |
|
Screenshots differ from baselines. A baseline update PR has been prepared: equinor/ert-testdata#64 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14025 +/- ##
==========================================
+ Coverage 91.48% 91.52% +0.03%
==========================================
Files 487 488 +1
Lines 34086 34229 +143
==========================================
+ Hits 31184 31327 +143
Misses 2902 2902
Flags with carried forward coverage won't be shown. Click here to find out more.
|
282e34d to
4754330
Compare
4754330 to
37492fa
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
src/ert/gui/plotting/plot_window.py:590
- The sidebar style selections are only copied into the PlotConfig when
selected_tab == ENSEMBLE. However, the “Statistics” plot also uses PlotConfig.history_style()/observations_style() (plot_history/plotObservations), so style changes won’t be reflected there. Apply the StyleOptions styles regardless of the currently selected tab (or at least for both Ensemble and Statistics).
if selected_tab == ENSEMBLE:
plot_config.set_default_style(self._style_options.get_default_style())
if not self.is_everest:
37492fa to
7eb85ff
Compare
7eb85ff to
6bb60bf
Compare
6bb60bf to
67435dd
Compare
67435dd to
751d8c4
Compare
751d8c4 to
b3eac14
Compare
Introduce a reusable style edit widget that adapts StyleChooser for compact use in the plot sidebar. It provides the shared layout and style handling needed by both ensemble and statistics controls, avoiding separate implementations for each sidebar section.
b3eac14 to
a53fc9c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/ert/gui/plotting/customization_dialog/style_chooser.py:253
setStyle()updates the child widgets viasetCurrentIndex()/setValue(), which emits their signals. That can (1) emitstyleChangedand (2) consumelog_plot_option_usage_oncetelemetry hooks, making resets/programmatic updates look like user actions and preventing later user interactions from being logged. Block child widget signals while applying a style programmatically.
@override
def setStyle(self, style: PlotStyle) -> None: # type: ignore
self._style.copy_style_from(style)
self._update_line_style_and_marker(
style.line_style, style.marker, style.width, style.size
)
| line_style = self.line_chooser.currentData() | ||
| marker_style = self.marker_chooser.currentData() | ||
|
|
||
| line_style: str = self.line_chooser.itemData(self.line_chooser.currentIndex()) | ||
| marker_style: str = self.marker_chooser.itemData( | ||
| self.marker_chooser.currentIndex() | ||
| ) | ||
| self.marker_chooser.setEnabled(line_style != STYLE_AREA[1]) | ||
| thickness = float(self.thickness_spinner.value()) |
|
Could this be simplified? Could we extend either |
Yes, I think it could be simplifed quite a bit if we ditch even more of the legacy code than already done here. With the current PR changes what we are moving away from is the complications around per-key plot configuration which is good here because that added complexity did not quite make sense. But what we could also do is to simplify everything around the plotstyle section itself. I can take a look at this. |
|
To be honest, due to the very limited use of the original implementation, I think we could remove the legacy code altogether and opt for a from-scratch implementation instead. We know the functionality wanted (centralize being able change line/marker style and size). Might take a little bit longer, but I think the end result will be much better. At least worth looking into, let me know what you think 👍 |
I think it's definitely worth doing sooner rather than later, then we can avoid a second redesign going over this exact code. Let's do it here 👍 Closing this PR for less clutter. |
Issue
Resolves #14021
Approach
Moved the style options from the Customize dialog to a collapsible section in the sidebar. Style selections are now shared across keys rather than configured per key, so the chosen styling remains consistent when switching keys. Added "compact" mode to StyleEdits to make them narrower for the sidebar.
git rebase -i main --exec 'just rapid-tests')When applicable
merge screenshot-PR in ert-testdata before merging this PR.