-
Notifications
You must be signed in to change notification settings - Fork 33
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 external span IDs #230
base: main
Are you sure you want to change the base?
Conversation
Hmm. The way I solved a very similar problem in Masonry, which worked quite well, was to just make the My understanding is that something like this would be a future plan, but likely as part of the much more significant refactor discussed here. |
Definitely looking forward to the refactor, but we I don't want to wait on it as my understanding is that it is likely to come as part of the switch to using IMO it's a bit neater if it's separate as conceptually an ID is not a "style", but I suppose putting it in |
c4c0947
to
63f23d0
Compare
Putting it in The code itself I think is fine. |
@nicoburns could you run the format on this so it can be mergeable? |
If we are going to merge this, then my preference would be to tear out the |
I think I'm in agreement with Daniel's last comment and that shouldn't be merged in the current form. |
b648f14
to
1796b61
Compare
I've formatted and rebased this because why not. But it sounds like we'll need to find a different design for this. I think we will want to find a solution though, because Which brings up another point: should @dfrg Would you anticipate Parley handling underline/strikethrough styles in a world where the main text colour "brush" is just an external ID? Or would those styles hang off the ID too? |
Diff to switch Blitz from this PR to Parley |
In my parley-next vision, all style information that doesn’t directly affect layout would be hung off of a style/span id and be managed by the user. With that in mind, I’m fine with just removing the text decoration properties entirely. |
Signed-off-by: Nico Burns <[email protected]>
1796b61
to
d4205de
Compare
This associated a user-specified ID with each style span in a
TreeBuilder
, which can then be retrieved from aCluster
after layout (and notably from aCluster
created usingCluster::from_point
).This enables hit-testing of inline spans (for click and hover behaviour).
The current behaviour of
Cluster::from_point
isn't ideal for this application: it will try to find the "nearest" cluster even if the cursor isn't exactly above one (which makes sense for placing a caret but not for hover/click). But it's "good enough" for now, and I think we can add a new function for that in a followup.Rendered using Parley + Blitz:
Screen.Recording.2024-12-17.at.07.51.41.mov