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

Filter entities in the UI (part 1): Introduce a filter widget #8652

Merged
merged 10 commits into from
Jan 13, 2025

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Jan 10, 2025

Related

What

This PR introduce a filter widget with the following feature:

  • the widget acts as a toggle: it's either on or off
  • when off, it's just a right-aligned icon and a (more-or-less) regular section title
  • when on, the title is replaced by a text edit
  • each time it's toggled on, the filter widget maintains a session id, for the client code to use to cache filter-session-specific data (e.g. collapsedness state)
  • this also include a FilterMatcher, which is an helper object that performs the actual filtering
    NOTE: this will surely be entirely rewritten as we improve on the filter semantics
  • helper function to create a properly formatted matched text (with the matching parts highlighted)
image image

@abey79 abey79 added ui concerns graphical user interface include in changelog labels Jan 10, 2025
Copy link

github-actions bot commented Jan 10, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
ea1e923 https://rerun.io/viewer/pr/8652 +nightly +main

Note: This comment is updated whenever you push a commit.

@abey79 abey79 changed the title Filter entities in the UI (part 1): Introduce a filter widget Filter entities in the UI (part 1): introduce a filter widget Jan 10, 2025
@abey79 abey79 changed the title Filter entities in the UI (part 1): introduce a filter widget Filter entities in the UI (part 1): Introduce a filter widget Jan 10, 2025
@abey79 abey79 added the do-not-merge Do not merge this PR label Jan 10, 2025
@abey79 abey79 marked this pull request as draft January 10, 2025 15:57
@abey79 abey79 marked this pull request as ready for review January 10, 2025 16:04
@Wumpf Wumpf self-requested a review January 10, 2025 18:26
Base automatically changed from antoine/filt0-custom-content to main January 11, 2025 12:06
@abey79 abey79 force-pushed the antoine/filt1-filter-widget branch from bc15274 to e0fa976 Compare January 11, 2025 12:07
@abey79 abey79 removed the do-not-merge Do not merge this PR label Jan 11, 2025
@abey79 abey79 force-pushed the antoine/filt1-filter-widget branch from e0fa976 to 96535ff Compare January 13, 2025 09:03
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!
there seems to be some mixup between empty string and None matchers that needs to be cleaned up

crates/viewer/re_ui/examples/re_ui_example/main.rs Outdated Show resolved Hide resolved
crates/viewer/re_ui/tests/filter_widget_test.rs Outdated Show resolved Hide resolved
crates/viewer/re_ui/src/filter_widget.rs Outdated Show resolved Hide resolved
crates/viewer/re_ui/src/filter_widget.rs Show resolved Hide resolved
crates/viewer/re_ui/src/filter_widget.rs Outdated Show resolved Hide resolved
crates/viewer/re_ui/src/filter_widget.rs Outdated Show resolved Hide resolved
@abey79
Copy link
Member Author

abey79 commented Jan 13, 2025

Arf yeah I switched last minute to "" matching nothing instead of everything (upon Katya's suggestion during the demo), and clearly I didn't cleanup properly.

@abey79 abey79 force-pushed the antoine/filt1-filter-widget branch from 96535ff to 9a0a88e Compare January 13, 2025 14:23
@Wumpf Wumpf self-requested a review January 13, 2025 14:26
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.

thanks!

@abey79 abey79 merged commit 2480a89 into main Jan 13, 2025
31 checks passed
@abey79 abey79 deleted the antoine/filt1-filter-widget branch January 13, 2025 15:51
abey79 added a commit that referenced this pull request Feb 5, 2025
### Related

- Closes #8903
- Part of #8586 
- Part of a series of PR:
  - #8645
  - #8652
  - #8654
  - #8672
  - #8706
  - #8728
  - #8795
  - #8863
  - #8886
  - #8933

### What

This PR supports `/` in filter query. Semantics are now as follows:

- Queries are made of whitespace separated keyword.
- Paths are not matched unless they match all keywords individually at
least once.
- Keywords may have 1 or more  `/` separated "parts".
- Single part keyword behave as before: paths are matched if they
contain that keyword anywhere at least once.
- Single part keyword can now be prefixed and/or postfixed with a slash,
eg. "/fir". In that case, the keyword part must be found at the
beginning and/or end of at least one path part to match (e.g. "/fir"
matches "/my/first/entity" but doesn't match "xxfire/entity").
- Multi-part keyword (e.g. "a/b/c") match paths that contains
corresponding, matching sequence of part (e.g. "/xxxxa/b/cxxxxx"). Such
keywords can also be prefixed and/or postfixed with a "/", with the same
semantics.


<img width="293" alt="image"
src="https://github.com/user-attachments/assets/efca95df-5021-425b-96d2-036aeb7d1236"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants