Closed imath closed 7 years ago
Let's discuss this in the meeting today. P.S. I thought we won't be thinking about backward compatibility with this new template pack? 😎
So this is a first pass that would need some css love once/if committed :)
When page is fully loaded, it looks like this:
When the user is adding the focus on the textarea, it displays the target dropdown + submit and reset buttons
To come back to previous state at anytime > the user can click on 'cancel'. This avoids the pretty annoying behavior of the legacy post form that hides everything on textarea blur ( < this is terrible!)
It allows people to use the do_action( 'bp_activity_post_form_options' )
to add custom options to the activity:
It accomplishes point 1 by allowing a more advanced buttons:
When a button is clicked, the custom script can handle the action
About point 2: it brings autocomplete for potentially any BuddyPress objects (Groups, blogs...)
Once selected, it's possible to remove the object thanks to the "x" dashicon on the right.
Finally the more i think of it the more i think it's a bad idea to inject the activity into the displayed stream, so for now i'm adding a feedback with a link. Why legacy behavior is annoying? Because on the activity directory you can post to an hidden group and the activity would be added into the wrong scope (eg: All members instead of My Groups).
You can test all this applying this patch https://gist.github.com/imath/05b55441b0ef9fdad6d1438ced68217d
As per the commit notes the form has had a CSS basic tidy up for visual layout can we review this form aspect in general?
Closing.
The template pack comes without anything specific about the activity post form. There's no javascript so it just uses a regular form so far.
About this, i believe that we should try to improve the experience a bit like what has been accomplished for the avatar UI.
We would probably need to include a "reset" button because i feel the blur effect is pretty annoying on the bp-legacy form. It we would help us to make sure an event is fired to inform the extending components the form has been reset.
So the API would be part PHP/ Part Javascript. We could register a button, choose the dashicon etc.. a bit like what's included in tinyMCE.
Of course the UI should also include backcompat functions to make sure previous ways of extending the post form would still work ;)