buddypress / next-template-packs

is this the next BuddyPress template pack?
35 stars 9 forks source link

Activity Post Form #5

Closed imath closed 7 years ago

imath commented 8 years ago

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. idea-apf

  1. An extendable javascript based UI could help us to provide an API to add new action buttons in order to add links, attachments or any other things.
  2. We could also improve the "target" dropdown so that it can accept other objects than groups (eg blogs for a network) and use an autocomplete field instead of listing all the objects the user is attached to.

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 ;)

mercime commented 8 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? 😎

imath commented 8 years ago

So this is a first pass that would need some css love once/if committed :)

When page is fully loaded, it looks like this: activity-post-form-reset

When the user is adding the focus on the textarea, it displays the target dropdown + submit and reset buttons activity-post-form-open

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:

backcompat-options

It accomplishes point 1 by allowing a more advanced buttons: new-actions

When a button is clicked, the custom script can handle the action new-actions-active

About point 2: it brings autocomplete for potentially any BuddyPress objects (Groups, blogs...) target-autocomplete

Once selected, it's possible to remove the object thanks to the "x" dashicon on the right. target-set

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). update-posted

You can test all this applying this patch https://gist.github.com/imath/05b55441b0ef9fdad6d1438ced68217d

hnla commented 8 years ago

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?

hnla commented 7 years ago

Closing.