For gbif.org we added the option for editors to be able to link to faq items with an inline parameter that would mean that instead of the link a modal would be shown with the content.
On the current site, the html is generated servers ide and angular attach in the browser. That version is less ideal for our new site.
idea for implementation
replace the links with react components using new react roots. I'm not sure that is a good idea honestly and context is also lost.
we could parse the text and add click events to the links that sets state to show a modal (that requires fiddling more with aria attributes as the link is now a trigger and should set focus and aria attributes, and receive focus back.
rewrite to details element, then browser takes care of logic and we can simply style it. details element can appear within pretty much any other tag i believe. we would have to fetch the faq data before.
Or we could keep the link intact as is and add a hovercard/preview card where we need to worry less aria as the link behaviour is intact.
The latter appeals most to me as I would also like to see preview cards elsewhere. It is a part of the radix ui/shadcn library we are using already. For the faq items, we probably cannot use that though, but we could then use the underlying library which is the omnipresent floating-ui and make a non-react implementation with that (mostly just to avoid adding more kb than neccessary)
Either way - the site will work even without this functionality (since the links works fine), so I'm comfortable leaving it for later
For gbif.org we added the option for editors to be able to link to faq items with an inline parameter that would mean that instead of the link a modal would be shown with the content.
Example: https://www.gbif.org/article/6S38ZH4I85kHGHkBvpa02y/bid-2020-frequently-asked-questions on some pages like above it is essentially all the page
On the current site, the html is generated servers ide and angular attach in the browser. That version is less ideal for our new site.
idea for implementation
The latter appeals most to me as I would also like to see preview cards elsewhere. It is a part of the radix ui/shadcn library we are using already. For the faq items, we probably cannot use that though, but we could then use the underlying library which is the omnipresent floating-ui and make a non-react implementation with that (mostly just to avoid adding more kb than neccessary)
Either way - the site will work even without this functionality (since the links works fine), so I'm comfortable leaving it for later