Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
193 stars 9 forks source link

Clickable in-line buttons in text elements #3908

Open epicEaston197 opened 1 year ago

epicEaston197 commented 1 year ago

Is your feature request related to a problem? Please describe.

I want clickable in-line buttons in text elements for example having a hyperlink in a text element actually function and being able to have embedded buttons instead of text elements for physical and UIX

here for example I want #OuterWilds to be a button with all of the normal common UI button stuff I don't know exactly how this would work but this would be really useful image

Relevant issues

Couldn't find any

Describe the solution you'd like

I want the ability to have clickable in-line buttons in text elements

Describe alternatives you've considered

I can't really think of any solution that I could think of either won't work or is absurdly complicated and it still wouldn't work

Additional context

I am making a Mastodon viewer which contacts the Mastodon API and users upload hashtags, media links, and mentioning users making those clickable would be preferable also having the inline buttons respect normal common UI stuff would allow me to do a dynamic impulse with value string so that I could do another API call

image image

JackTheFoxOtter commented 1 year ago

Neos doesn't use HTML for text rendering, so "simple HTML support" wouldn't really be as simple to implement as you might think. However, I think clickable in-line buttons in text elements would be a very welcome addition. For that, we will probably need a new text renderer that can act as multiple buttons, as a single text can have multiple "links" in it. Generalizing those to be button actions will allow much greated flexibility than treating them only as hyperlinks, perhaps in the text markup we could add a <button tag="something"></button> tag, which could be used to denote a part of the text to be clickable as a in-line button, associated with a tag or id to identify it in the text content. This can currently not be done with existing UIX features, as you cannot in-line elements (as in, make them flow with the text, especially when it comes to line separations when the clickable part of the text would wrap around into a second line. If not buttons in themselves (because a single component with multiple buttons is probably going to introduce a lot of issues with the existing button components), perhaps it could be treated as a single button / dynamic impulse trigger, using the tag to allow creations to differentiate which "button" has been pressed in the text if multiple are present.