Help us test the rewritten Composer

Oh well I feel stupid… lol

I’m looking forward to extended functionality! The post editor has a lot of potential.

A feature a lot of people request from my site is the ability to upload files other than images…

But yeah, the emoticon popup is blurry… only thing I noticed.

Can you elaborate on this? What changes might I be looking at for my plugins that add toolbar items?

I haven’t 100% decided yet how the API will work. As always I’ll try my hardest (but it’s really hard!!) to retain backwards compatibility with APIs for adding buttons, but there will likely be a much shinier, simpler API for doing it.

One problem for example is the old one would show the quote button everywhere, not sure when composing a topic. Super confusing.

Okay, backwards compatibility isn’t as critical for me (knowing how to add a toolbar item definitely is more important), except for the following:

Also, a follow up question.

If there are changes to how you add a toolbar item, how can we direct this against a specific version of Discourse so that our changes which will show as an update on older versions and obviously we don’t want them to upgrade the plugin as their Discourse version won’t support the new way of adding a toolbar item…

Edit:
Also I get this is complicated, just giving food for thought, because as a plugin developer, these are the things that concern me.

2 Likes

Just enable the file types you want to allow in site settings, this feature already exists. Out of the box we only allow image file types.

2 Likes

[quote=“cpradio, post:27, topic:34679, full:true”]
Okay, backwards compatibility isn’t as critical for me (knowing how to add a toolbar item definitely is more important)[/quote]

A few days ago, @eviltrout added this commit :

https://github.com/discourse/discourse/commit/5cd63088500f6dc76f39e060fd3a3ef3988a791e

It seems easier to add buttons but i’m not really competent enough to be sure :sweat_smile:

Agreed, but it doesn’t address the second, backwards compatibility, as soon as I use the new way, any stable implementations can’t upgrade to my plugin until the new composer is pushed to the stable branch.

1 Like

Which plugin is it? Maybe I can help you out.

Well, I know others are using https://github.com/cpradio/discourse-plugin-composer-help-button

It is a very straight-forward plugin, so if there is a way to test if the new composer is available versus the old, so I can run the appropriate logic, that’d do it.

I can update the others I have once I know the best way to proceed. :smile:

You should be able to do it with something like:

if (typeof Discourse.ComposerEditorComponent === "undefined")  {
  // old composer
} else {
  // new composer
}
1 Like

cool, I may try that later today. Is the new composer being used for actual posts yet? (or coming anytime soon)

^^^ funny you should ask

I’ve just deployed the new composer that is using Ember.js instead of pagedown. It was a lot more work than I expected, because when I got in there to swap it out I realized how badly the state of our composer code was. We were abusing Ember in many ways to get that code to work and I made a huge effort to straighten it all out. It’s not perfect but it’s a huge improvement.

Please report any issues you see and I’ll fix them as fast as I can!

(first post made with new composer, woo)

2 Likes

Awesome. Then I’ll definitely play around later tonight with it and probably tomorrow.

This is a bug, the text box here used to be bigger and upload was at the bottom

Also need to test on win phone and android, getting size right was very fiddly

Old sizing

1 Like

Looks good on my Android :iphone::ok_hand:

A tiny, tiny detail bugs me with the new composer

When I put the cursor in the middle of a text and use a button (or an emoji), it always goes at the end of the whole post.

First part : the cursor is between the lines
Second part : the generated code goes at the end.

I use Firefox 42.0

3 Likes

What is with this underline here?

The Hyperlink button doesn’t work. The dialog is hidden behind the editor.
This happens with latest Chrome on Windows 10.

Can not click on x when a warning pops up.

Okay I’ve comitted a bunch of fixes which are still building and will be deployed shortly:

:white_check_mark: Mobile viewport sizing

:white_check_mark: Link modal appearing behind composer

:white_check_mark: Hairline underneath buttons

:white_check_mark: Inserting text between words was appearing at bottom

:white_check_mark: Couldn’t dismiss validation messages

12 Likes