Skip to content

Improve how collapsed state is saved for space views, containers, and DataResults in the Blueprint Tree UI #5208

@abey79

Description

@abey79

Currently, the collapsed state of any item in the blueprint tree is stored in egui's short-term cache. This has several limitations:

  1. The cache is indexed by widget IDs which are unstable (at least by default). This means that any external change leading to a change in ID (e.g. the item is moved elsewhere in the hierarchy) invalidates the cache, leading to the collapsedness to potentially change. This happens when drag-and-dropping space view across containers.
  2. It's currently difficult to externally control the current collapsed-ness state

Solving (2) is needed at least for:

Possible approaches:

  • Make widget ID predictable/stable (e.g. by deriving them from space view id, etc.).
    • How about DataResults?
    • Is there a public egui API to edit the collapsedness of a given widget ID?
  • Take over egui and handle the collapsedness state on rerun side.
    • Using a Collapsed component?
    • Or using a short-lived ad hoc cache HashMap<re_viewer_context::Item, bool>?

Metadata

Metadata

Assignees

Labels

uiconcerns graphical user interface😤 annoyingSomething in the UI / SDK is annoying to use

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions