-
-
Notifications
You must be signed in to change notification settings - Fork 226
feat: css class & button trigger support on background DOM #1047
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
base: main
Are you sure you want to change the base?
Conversation
I suggest adding background embedding support for the risu-trigger attribute. |
Could you elaborate a little more? |
It is not possible to activate V2 triggers or Lua script triggers using buttons or other elements created in background embedding. I wish this could be made possible. |
Sorry for another suggestion, but I noticed that when the chattext attribute is applied to background embedding, it can sometimes interfere with regex scripts. |
I feel cautious about PR that change existing behavior like that. Are there chatbots or cases I can test that might interfere with this change? |
I did a few more experiments and found that this usually happens when regex is set to capture everything with flags like Dot All (s) (which also captures newline \n). This is often used to insert specific phrases or HTML at the end or the beginning of the chat. |
Actually separating out the background embedding area as new option from the existing display regex seems a neat idea, but implementing it in this PR seems out of scope. |
PR Checklist
Description
Currently, when using HTML elements in background embedding slots, inline styles can be used, but direct CSS classes(ie. x-risu-something) cannot be specified. This change resolves this issue, but if you don't want this or have other ideas, please let me know.
(+@)
Thanks to comments, I noticed button triggers are not available in background embedding, so I added capturing of button triggers here as well. For performance reasons, chat reload is left at the trigger's discretion.