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

Add display_name() to SpaceViewClass so space views may provide a user-facing name #4393

Merged
merged 5 commits into from
Nov 30, 2023

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Nov 30, 2023

What

With this change, the user-facing string for a space view class can be changed without breaking blueprint files. This PR also reverts the change from "TextLog" to "Text Log" to avoid breaking last release's blueprint (*)

(*) Unknown space view class name do not trigger a blueprint rebuild, but instead yield an "unknown space view" in the UI, which is Bad UX™️

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 app.rerun.io (if applicable)
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@abey79 abey79 added 🚜 refactor Change the code, not the functionality exclude from changelog PRs with this won't show up in CHANGELOG.md labels Nov 30, 2023
@abey79 abey79 marked this pull request as draft November 30, 2023 08:27
@abey79 abey79 marked this pull request as ready for review November 30, 2023 08:34
@Wumpf Wumpf self-requested a review November 30, 2023 08:50
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.

👍 . Leaving comments on naming things to your judgement, not having a very strong opinion on these

/// Must be unique within a viewer session.
///
/// TODO(#2336): Display name and identifier should be separate.
/// Used for identification. Must be unique within a viewer session.
fn name(&self) -> SpaceViewClassName;
Copy link
Member

Choose a reason for hiding this comment

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

the logical next/additional step would be to rename this to identifier(&self) -> SpaceViewClassIdentifier I think in order to avoid confusion

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 agree with that, but I'll punt on it as consistency would require a large sweep across the code base.

Copy link
Member

Choose a reason for hiding this comment

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

I think it is worth doing though; do it in a follow-up PR if you like. rust-analyzers rename feature should make it pretty painless.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's see about painless (function argument names...), but will do 👍🏻

/// User-facing name of this space view class.
///
/// Used for UI display.
fn ui_name(&self) -> &'static str;
Copy link
Member

Choose a reason for hiding this comment

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

I think the more common name for this in the codebase is display_name.
... come to think it's more like the default display name? Because the user can edit the actual display name. From that pov ui_name is probably good as is since it avoid confusing it with the configurable display_name of a space view instance 🤔 . Your call :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed again, and this one is worth fixing 👍🏻

Copy link
Member Author

Choose a reason for hiding this comment

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

...but disagree on default_display_name. This is the class's display name, aka the space view type, which is displayed as such. It turns out the space view class display name is also used as part of the default space view instance naming scheme, but that's accidental (and that bit has a shaky future imho).

@abey79 abey79 merged commit ee83418 into main Nov 30, 2023
40 of 41 checks passed
@abey79 abey79 deleted the antoine/separate-ui-name-space-view-class branch November 30, 2023 09:57
abey79 added a commit that referenced this pull request Nov 30, 2023
…fiedViewSystem` (#4406)

### What

As per
#4393 (comment)

Review per commit: we could merge either or both.

### 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 [app.rerun.io](https://app.rerun.io/pr/4406) (if
applicable)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4406)
- [Docs
preview](https://rerun.io/preview/5063dd0203b5563eaccde1c46c76e176f576bee7/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/5063dd0203b5563eaccde1c46c76e176f576bee7/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
@abey79 abey79 changed the title Add ui_name() to SpaceViewClass so space views may provide a user-facing name Add display_name() to SpaceViewClass so space views may provide a user-facing name Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md 🚜 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split Space View class display name and Space View identifier
3 participants