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

Abstract the re_ui::ListItem code for re_viewer_context::Item #4560

Open
Tracked by #6075
abey79 opened this issue Dec 15, 2023 · 1 comment
Open
Tracked by #6075

Abstract the re_ui::ListItem code for re_viewer_context::Item #4560

abey79 opened this issue Dec 15, 2023 · 1 comment
Labels
💬 discussion 🚜 refactor Change the code, not the functionality ui concerns graphical user interface

Comments

@abey79
Copy link
Contributor

abey79 commented Dec 15, 2023

In a growing number of place, we are now using re_ui::ListItem to display and interact with re_viewer_context::Items. That includes:

  • the blueprint tree
  • the streams tree
  • the top Selection Panel banner

In the future, this will also include:

Currently, the ListItem code is duplicated, along with the logic around selection highlight, selection update on click, shared hover state, etc. Ideally, the UI code for this would be unified and reused across the viewer.

To be addressed

  • There is significant overlap with the existing "Data UI" code, in particular impl DataUi for re_viewer_context::Item. However, it's not clear that both the "ItemListItem" and the "Data UI" code can be fully merged, as they serve slightly different (albeit sometime overlapping) needs.
  • A given type of item might need slightly different behaviour depending on context. For example, a Space View listed in the Blueprint tree might have a "visibility toggle" button, but not when listed as a child from a container in the Selection Panel.
  • Also, sometime items are to be displayed as part of a hierarchy, and other times as part of a flat list.

Possible pragmatic approach

  • Accept these are two different things and roll a new ListUi trait along DataUi, in the same re_data_ui crate.
  • Somehow make it flexible enough for the contextual variations.
@abey79 abey79 added ui concerns graphical user interface 🚜 refactor Change the code, not the functionality 💬 discussion labels Dec 15, 2023
@abey79
Copy link
Contributor Author

abey79 commented Feb 20, 2024

Relevant FigJam mapping out all existing and short-term-future (potential) use of ListItem: https://www.figma.com/file/6IiI4qAPhA6T8fvb8QuzJ2/ListItem-2.0-deployment?type=whiteboard&node-id=0%3A1&t=5s8vLxlXmqDYNp7A-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 discussion 🚜 refactor Change the code, not the functionality ui concerns graphical user interface
Projects
None yet
Development

No branches or pull requests

1 participant