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

Show first line of the docs when hovering a component name #6609

Merged
merged 15 commits into from
Jun 24, 2024

Conversation

emilk
Copy link
Member

@emilk emilk commented Jun 23, 2024

What

Now that we can override all kinds of components in the UI, we should also take care to explain them to the user.

Previously all the user had to go on was the name. With this PR they get the first line of the docstring for the component, plus a link to the full docs on our website.

This required adding a new (generated) reflection API.

image

Best reviewed commit-by-commit.

Related

Later PR

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.

@emilk emilk added 📖 documentation Improvements or additions to documentation ui concerns graphical user interface include in changelog labels Jun 23, 2024
@Wumpf
Copy link
Member

Wumpf commented Jun 23, 2024

Part of

Haven't looked at anything yet, but this should also drag in the opt-in archetype field documentation we have via attribute ( (attr.rust.generate_field_info) into this new crate if it doesn't already.
(that's used for generating doc strings on all view properties that follow the generic ui)

@Wumpf Wumpf linked an issue Jun 23, 2024 that may be closed by this pull request
@emilk
Copy link
Member Author

emilk commented Jun 23, 2024

re_types_registry is a dynamic registry, mapping ComponentName (and, int the future, ArchetypeName) to some info at runtime. At the moment it is only code-generated, but we could add support for registring new components at runtime too.

Archetype::field_info seems like a slightly different beast, though I guess it could too be moved to re_types_registry if we change the lookups from a static A::info() to a dynamic re_types_registry::get_archetype(A::name()). I think this is best suited for a follow-up PR.

@emilk emilk force-pushed the emilk/embedded-docs branch from 1f407e2 to 70e9685 Compare June 23, 2024 20:39
@Wumpf
Copy link
Member

Wumpf commented Jun 23, 2024

dynamic lookup via archetype name would be preferable anyways I think! The more we can pass ArchetypeName/ComponentName instead of A: impl Archetype/C: impl Component the better 👍

@emilk emilk requested a review from Wumpf June 24, 2024 06:59
@emilk emilk force-pushed the emilk/embedded-docs branch from 70e9685 to fb97613 Compare June 24, 2024 07:11
@emilk emilk force-pushed the emilk/embedded-docs branch from fb97613 to 01e49f2 Compare June 24, 2024 07:35
@emilk emilk marked this pull request as ready for review June 24, 2024 07:35
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.

Let's not stack the crate hierarchy deeper when we don't have to!

As for name: re_types_registry is quite at odds with component type registration in the store. I'd rather call it by what it does re_types_meta_info or something

crates/re_types_registry/src/components.rs Outdated Show resolved Hide resolved
crates/re_types_registry/src/components.rs Outdated Show resolved Hide resolved
crates/re_types_builder/src/lib.rs Show resolved Hide resolved
crates/re_data_ui/src/lib.rs Outdated Show resolved Hide resolved
crates/re_types_builder/src/codegen/rust/registry.rs Outdated Show resolved Hide resolved
@emilk emilk marked this pull request as draft June 24, 2024 10:40
@emilk emilk requested a review from Wumpf June 24, 2024 10:41
@emilk emilk marked this pull request as ready for review June 24, 2024 10:42
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!!

@Wumpf
Copy link
Member

Wumpf commented Jun 24, 2024

(resolved merge conflicts)

@emilk emilk merged commit 0b0adea into main Jun 24, 2024
34 of 35 checks passed
@emilk emilk deleted the emilk/embedded-docs branch June 24, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation Improvements or additions to documentation include in changelog ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve tooltips for overrides and defaults as well as for enums
2 participants