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

Rewrite the ui.large_collapsing_header into re_ui::SectionCollapsingHeader using re_ui::ListItem #6657

Merged
merged 6 commits into from
Jun 27, 2024

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Jun 26, 2024

What

This PR completely rewrites the existing large_collapsing_header stuff as follows:

  • Renamed SectionCollapsingHeader.
  • Now a struct with builder pattern, can be created with convenience ui.section_collapsing_header("label").
  • Supports menu button
  • Support help tooltip
  • Added ListItem::show_hierarchical_with_children_unindented.

Note: the label must now be double-clicked to collapse/uncollapse, as per ListItem behaviour.

Few visible changes beyond the help tooltip. The background no longer changes on hover.

image

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

To run all checks from main, comment on the PR with @rerun-bot full-check.

abey79 added 2 commits June 26, 2024 17:22
- Added show_hierarchical_with_children_unindented to ListItem
- Re-implemented LargeCollapsingHeader using ListItem
@abey79 abey79 added enhancement New feature or request ui concerns graphical user interface 🚜 refactor Change the code, not the functionality include in changelog labels Jun 26, 2024
@abey79 abey79 mentioned this pull request Jun 26, 2024
7 tasks
@abey79 abey79 changed the title Rewrite the "large collapsing header" into re_ui::SectionCollapsingHeader using re_ui::ListItem Rewrite the ui.large_collapsing_header into re_ui::SectionCollapsingHeader using re_ui::ListItem Jun 26, 2024
@Wumpf Wumpf self-requested a review June 27, 2024 08:14
@Wumpf
Copy link
Member

Wumpf commented Jun 27, 2024

might be already on your radar: visible time range uses a long tool tip whereas the query uses the info button to convey what's in there

@abey79
Copy link
Member Author

abey79 commented Jun 27, 2024

might be already on your radar: visible time range uses a long tool tip whereas the query uses the info button to convey what's in there

Good call. adding this to #6655, I'll do it in a separate PR.

.interactive(true)
.force_background(DesignTokens::section_collapsing_header_color())
.show_hierarchical_with_children_unindented(ui, id, default_open, content, |ui| {
//TODO(ab): this space is not desirable when the content actually is list items
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably link to the list itemification ticket? Once everything is linst items it should go away

On that note: Now that this is a list item, does it mean that we can remove some of the list item scopes we add down the line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to get rid of these right now, and add them where we dont have ListItem. I have that anyway on my TODO (#6655).

I can't quite answer for list item scope now, I have fully tracked the recent proliferation :)

Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, great unification + tangible improvement

@abey79 abey79 merged commit a7c0e39 into main Jun 27, 2024
33 of 34 checks passed
@abey79 abey79 deleted the antoine/collapsing-header-refactor branch June 27, 2024 12:24
abey79 added a commit that referenced this pull request Jun 27, 2024
### What

* Builds on #6657
* Part of #6655 

This PR is mainly a refactor that abstract the buttons used by
`PropertyContent` and `SectionCollapsingHeader`. (This refactor is
partial and should also be applied to `LabelContent` -> #6191).

This enables action button in section header, used to remove the "edit"
button of the entity filter:
<img width="356" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/f430805e-2b93-4134-bdbc-fcbbdbbc68e9">


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6662?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6662?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6662)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request include in changelog 🚜 refactor Change the code, not the functionality ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants