-
Notifications
You must be signed in to change notification settings - Fork 125
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 a "gallery"-type example for Xilem's Label View #864
base: main
Are you sure you want to change the base?
Conversation
d46449f
to
fe0b012
Compare
My initial feedback here is that Label is that we shouldn't be encouraging developers to reach for I also want to check (as a self-calibration exercise only), was this code LLM assisted? |
That makes sense to me. I think there's something in the naming of label which needs to change, probably. I would agree that we should probably have a paragraph at the start of this, explaining why Label exists and how to use it (which should be copied into Label's docs). That does look pretty cool. Is that saying that the confirm action happens if you press enter or alt-k? I'm not sure about the flex issue. I know that our layout story is still... in flux at the moment. I don't know when I'll find time to review this.
No, I've not tried it myself. I'd hope that they don't, to be honest, because we're still at a stage of refining our APIs. The formatting definitely needs to be changed to follow the Rust style guide. The reason that this isn't happening is the eternally vexing rustfmt issue, rust-lang/rustfmt#3863. We have a few workarounds in the past, e.g. linebender/vello#499 |
There are existing issues re. the general state of docs with Xilem
#392
#851
so this PR is a suggestion on covering one area I missed when reading the docs: being able to have
So this is an example of a simple gallery-type app that covers Xilem's Label View (but not Masonry Label Widget) where you can simply vertically scroll to see all the available options and even some notes on interaction issues: e.g., the fact that a label with a Start alignment starts in the middle because its parent vertical flex has a Center alignment by default for its horizontal axis. Now, you could find this explanation deep down in Masonry tests, but that would require a lot of digging around (and Masonry screenshots wouldn't show it).
After identifying an issue this example also shows a suggested fix by using
.flex
, though if I do the override, I lose the portal's vertical scrolling, which might be a 🐞bug or just a missing understanding on my part of how these portal/flex/.flex elements interact, in which case it would be nice to change to a better example and to have a shorter alignment section that didn't have to note these issues.Now, there are a few missing pieces, but think this might be still be a good initial fix:
As far as I understand mostly blocked by missing functionality support in the framework:
But also just not yet implemented:
(these are also added in the Todos comment section in the example itself)