-
Notifications
You must be signed in to change notification settings - Fork 60
[WIP] feat/489: Add Rewrite Tone feature #803
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: develop
Are you sure you want to change the base?
Conversation
UpdateThe Rewrite Tone feature is integrated inside the Chat UI: Screen.Recording.2025-04-15.at.1.13.38.AM.mov |
@Sidsector9 still love this :) Just wanted to quickly share my thoughts: |
@fabiankaegy thanks for the input. Currently, a feature can integrate into the ChatUI using the following filter: const featureTabs = applyFilters( 'classifai.chatUI', [] )
Your suggestion can be implemented by introducing a But this creates another issue, if Content Generation Feature is disabled, but the Rewrite Tone feature is enabled, then the Slot inside Content Generation won't work. |
So I think there are two separate concerns we're talking about here. (1) visually how the UX/UI works/looks in the Chat UI interface. (2) how the ChatUI component exists within the codebase and can be extended. On (1), I believe this is more generally where @fabiankaegy is commenting and providing guidance. I think sorting out the optimal UX/UI handling within the Chat UI interface is something we should precise about as this PR gets merged in (as we're now potentially using that interface for more than one feature and now is the right time to sort things out better). On (2), I believe this is more generally where @Sidsector9 is commenting and expressing concern. I agree that the Chat UI experience should be part of a top-level ClassifAI plugin component that features could inherit into. And if no features are enabled that utilize the ChatUI, then it won't appear in the editor. But having the ChatUI exist within the Content Generation feature that other features like Rewrite Tone need to inject into feels sub-optimal.
Sid's comment here expresses things fairly well on this (2) topic. cc: @dkotter for review/input. |
Yes, this is correct. We'll need to refactor the code that renders the experience right now to make it not dependent on the Content Generation Feature. My thought would be to go with the slotfill approach where each Feature can register what they need within the experience (and properly enqueue that) and then each Feature will also be responsible for enqueuing the default ChatUI code (with WordPress being smart enough to not load that multiple times if multiple Features are in use) |
@dkotter This is exactly how it is currently implemented. If you disable Content Generation but keep Rewrite Tone enabled, the ChatUI would still show, but the downside to this approach is that it makes it difficult to implement the UI that Fabian is suggesting. |
Description of the Change
Closes #489
Screencast
The Tone Rewriting options are preserved in local storage so that the admin does not have to perform the same selection every time.
Screen.Recording.2025-03-03.at.4.57.22.PM.mov
How to test the Change
Changelog Entry
Credits
Props @jeffpaul @Sidsector9
Checklist: