-
Notifications
You must be signed in to change notification settings - Fork 74
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
Horizontal layer buttons #2566
Horizontal layer buttons #2566
Conversation
Excited to give this a spin and pleasantly relieved at how lightweight the diff is so far! |
Color change and multiselect working Move logic to LayerSelect
ddeb60c
to
bf22850
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.
This is coming together! I still see some lag, so will take a closer look through the logic tomorrow and see if we can avoid that as much as possible 🤞
* redundant and conflicting with tab backgrounds
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.
This is really getting there!
Note that we have decided to postpone:
- the bug (also on main) of the image visibility eye button not actually toggling the visibility
- optimizing this so that changes to a layer color don't rebuild the entire dictionary but instead edit it in place
- style fine-tuning
# Determine layers visible in selected viewer(s) - consider mixed to be visible | ||
visible_layers = [layer['label'] for layer in self.layer.items if not layer['is_subset'] and (layer['visible'] or layer['mixed_visibility'])] # noqa |
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.
@rosteen - does this change make sense to you? Now that we have this info already parsed, we can avoid the double-loop and can explicitly handle the mixed case - this means that if a layer is visible in one selected viewer, but not all, it will still be included in the logic. The alternative would be to only act all layers visible in all selected viewers, but I think you said you intended for this behavior, right?
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.
Seems fine to me, and yeah I preferred updating all visible layers in any selected viewer.
"color": layer.state.color, | ||
"icon": self.app.state.layer_icons.get(layer.layer.label)} | ||
"all_colors_to_label": label_to_color.get(layer.layer.label, False), |
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.
can we merge color
and all_colors_to_label
(some updates will also be needed to plugin_layer_select_tabs.vue
if so)? Maybe just color = label_to_color.get(layer.layer.label, layer.state.color)
?
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.
We could, but I'm not sure what the benefit would be.
layer_labels = [layer.layer.label for layer in layers] | ||
layer_labels = [layer.layer.label for layer in layers if self.app.state.layer_icons.get(layer.layer.label)] # noqa |
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.
what does this change do?
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.
Sometimes this gets called before the icon has been created, which then crashes when we try to sort self.items
by the icon key.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2566 +/- ##
==========================================
- Coverage 90.84% 90.79% -0.05%
==========================================
Files 160 160
Lines 19357 19475 +118
==========================================
+ Hits 17584 17682 +98
- Misses 1773 1793 +20 ☔ View full report in Codecov by Sentry. |
Starting to test this, and it concerns me that the color swatch is so laggy to update when you click a layer. I also get an "add large data?" warning from Glue every time I click one of the layer tabs, which makes me worry that something unintended is happening, although my guess is that's from the histogram viewer: Screen.Recording.2023-11-20.at.10.40.11.AM.movIs the color of the colorbar in the histogram viewer supposed to match the selected color for the layer, or is that a future feature? |
@rosteen It's the same amount of lag when switching layers as on |
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.
Alright, if the issues I saw are unrelated then I can approve. I like the styling.
* Layers now represented as horizontal buttons Color change and multiselect working Move logic to LayerSelect * Fix codestyle * Fix codestlye and remove comments * Viewer multiselect mixed state working * Working on handling edge cases of mixed state * Use messages in LayerSelect to call parts of _on_layers_changed * Remove unused elements * Fix button colors not updating after unmix state * Fix codestyle * Attempt 2 at fixing code style * Fix CI, put buttons in icon order * Code style again * Fix more tests * Everything handled by _on_layers_changed * button styling/tooltip based on (mixed)-color/visibility * improve tab styling * avoid second loop when applying RGB presets * improved handling of colormap and mixed colormode * remove elevation * redundant and conflicting with tab backgrounds * use all_color_to_label in tab styling * Mixed visibility and color represented in button * improved handling of subset color when in colormap * improved dark-theme support * tooltip and RGB preset support for mixed visibility * Visible is set to layer visible and bitmap visible * avoid displacement when no tabs selected * Fix CI tests * RGB presets: handle unmixing state * Address review comments * Forgot one change * for styling, always check if item in list, not as substring * Update changelog * Add tests --------- Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>
Description
Screen.Recording.2023-11-17.at.3.13.54.PM.mov
This pull request converts the layer select dropdown menu in Plot Options into a horizontal panel of buttons. Both single and multiselect are supported in this PR. The work left to do is as follows:
Closes #2491
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.