Composer Page

MIT license Latest Stable Version Total Downloads Donate

This extension replaces the floating discussion composer with a complete dedicated page.

This improves the user experience on mobile and allows the composer to display infinitely more fields without the need for modals and dropdowns.

Optionally, you can choose for the page to only be used for select tags.
This feature might not work with all extensions, and the data entered prior to changing the tag might be lost.

Extensions whose data is confirmed to be preserved when the composer switches from floating to page:

  • Native fields (title and content)
  • Flarum Tags
  • KILOWHAT Formulaire
  • Flamarkt Taxonomies (since version 0.1.5 of Taxonomies)
  • FriendsOfFlarum Polls (since version 1.2.0 of Polls)
  • FriendsOfFlarum Mason (since version 1.2.0 of Mason)

Composer switch not supported:

  • FriendsOfFlarum Byobu - Cannot switch tags, so irrelevant. There is a setting in the admin panel to choose whether Byobu will use the composer page

Extensions completely incompatible:

  • FriendsOfFlarum Upload - App crashes when trying to write discussion - PR opened

All other extensions should be compatible when the feature is used globally for any tag.

Using the "Uniform discussion composer layout" option in KILOWHAT Formulaire makes the page even more complete by adding labels and horizontal layout styling to the full composer.

The composer page is also perma-linkable. Use https://<forum>/compose or https://<forum>/t/<tag slug>/compose to link directly to the composer.
Additionally, you can include a ?title= and/or ?content= query string to pre-fill the form.

When the composer page is enabled globally, the start discussion button is replaced with a link, so it's possible to open it in a new tab using the browser controls.

When you quit the composer page without submitting, it becomes minimized just like the native composer.
Clicking the minimized composer re-opens the composer page.

When the composer page is active, the start discussion button is replaced with a button to quit or resume the composer.

On mobile, there are 2 different links to submit the form, one is the original paper plane icon from Flarum in the top right.
Another button is added at the very bottom of the page to improve the user experience.

With just this extension enabled, the layout is exactly the same as the composer, just on a different page:

With the upcoming version of my premium Formulaire extension (screenshot Formulaire 1.7.0, not yet released at the time of writing), you can switch to a unified Formulaire+Flarum form layout that requires this extension to create the space needed and to work at all on mobile.

Installation

composer require clarkwinkelmann/flarum-ext-composer-page

Support

This extension is under active maintenance.

Bugfixes and compatibility updates will be published for free as time allows.

You can contact me to sponsor additional features.

Support is offered on a "best effort" basis through the Flarum community thread.

Links

lichengkun135 can you share your php flarum info output? I suspect that's FoF Upload causing issues. I haven't tested that extension for compatibility yet.

Another extension I haven't tested and suspect will create issues is FoF Drafts.

    clarkwinkelmann

    Flarum core 1.4.1
    PHP version: 8.0.22
    MySQL version: 5.7.39-log
    Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, ctype, curl, dom, filter, ftp, gd, gettext, hash, iconv, intl, json, mbstring, SPL, session, pcntl, standard, PDO, mysqlnd, pdo_sqlite, Phar, posix, Reflection, pdo_mysql, shmop, SimpleXML, soap, sockets, sodium, mysqli, sysvsem, tokenizer, xml, xmlreader, xmlwriter, zip, fileinfo, exif, gmp, Zend OPcache
    +------------------------------------------+-------------+--------+
    | Flarum Extensions                        |             |        |
    +------------------------------------------+-------------+--------+
    | ID                                       | Version     | Commit |
    +------------------------------------------+-------------+--------+
    | flarum-flags                             | v1.4.0      |        |
    | flarum-approval                          | v1.4.0      |        |
    | flarum-tags                              | v1.4.0      |        |
    | flarum-suspend                           | v1.4.0      |        |
    | flarum-subscriptions                     | v1.4.0      |        |
    | flarum-sticky                            | v1.4.0      |        |
    | fof-formatting                           | 1.0.2       |        |
    | flarum-nicknames                         | v1.4.0      |        |
    | flarum-lock                              | v1.4.0      |        |
    | fof-pages                                | 1.0.4       |        |
    | flamarkt-backoffice                      | 0.1.1       |        |
    | fof-byobu                                | 1.1.7       |        |
    | fof-follow-tags                          | 1.1.6       |        |
    | flarum-mentions                          | v1.4.0      |        |
    | flarum-markdown                          | v1.4.0      |        |
    | flarum-likes                             | v1.4.0      |        |
    | afrux-forum-widgets-core                 | v0.1.7      |        |
    | zequeen-acgembed-remastered              | v1.1.2      |        |
    | v17development-seo                       | v1.8.0      |        |
    | the-turk-stickiest                       | 3.0.1       |        |
    | the-turk-diff                            | 1.1.2       |        |
    | sycho-profile-cover                      | v1.3.3      |        |
    | swaggymacro-only-starter                 | 0.6.4       |        |
    | starsriver-mathplus                      | 0.4.0       |        |
    | pipecraft-id-slug                        | v1.1.0      |        |
    | nosun-reply-to-see                       | v1.03       |        |
    | michaelbelgium-discussion-views          | v7.1.3      |        |
    | malago-fancybox                          | 0.3.0       |        |
    | malago-achievements                      | 0.5.5       |        |
    | kilowhat-audit-free                      | 1.5.1       |        |
    | justoverclock-auto-post-count-badge      | 0.1.9       |        |
    | jslirola-login2seeplus                   | v0.2.1      |        |
    | ianm-synopsis                            | 1.2.1       |        |
    | ianm-html-head                           | 1.1.0       |        |
    | ganuonglachanh-sonic                     | 0.1.5       |        |
    | fof-user-directory                       | 1.2.3       |        |
    | fof-user-bio                             | 1.1.0       |        |
    | fof-upload                               | 1.2.3       |        |
    | fof-terms                                | 1.2.0       |        |
    | fof-sitemap                              | 2.0.1       |        |
    | fof-reactions                            | 1.1.2       |        |
    | fof-profile-image-crop                   | 1.0.1       |        |
    | fof-pretty-mail                          | 1.1.0       |        |
    | fof-polls                                | 1.1.0       |        |
    | fof-oauth                                | 1.2.2       |        |
    | fof-nightmode                            | 1.4.1       |        |
    | fof-masquerade                           | 2.1.3       |        |
    | fof-links                                | 1.1.1       |        |
    | fof-linguist                             | 1.0.4       |        |
    | fof-filter                               | 1.1.1       |        |
    | fof-drafts                               | 1.1.2       |        |
    | fof-doorman                              | 1.1.1       |        |
    | fof-discussion-thumbnail                 | 1.1.0       |        |
    | fof-custom-footer                        | 1.0.1       |        |
    | fof-best-answer                          | 1.2.3       |        |
    | fof-ban-ips                              | 1.0.2       |        |
    | fof-analytics                            | 1.1.0       |        |
    | flarum-statistics                        | v1.4.1      |        |
    | flarum-lang-english                      | v1.4.0      |        |
    | flarum-lang-chinese-simplified           | v1.1.1.1220 |        |
    | flarum-bbcode                            | v1.4.0      |        |
    | dem13n-discussion-cards                  | 0.3.8       |        |
    | davwheat-ads                             | 1.2.0       |        |
    | datlechin-silent-edit                    | v0.1.0      |        |
    | datlechin-more-discussions               | v0.1.0      |        |
    | clarkwinkelmann-mailing                  | 1.0.0       |        |
    | clarkwinkelmann-group-list               | 1.0.0       |        |
    | clarkwinkelmann-first-post-approval      | 1.0.1       |        |
    | clarkwinkelmann-emojionearea             | 1.0.0       |        |
    | clarkwinkelmann-discussion-open-position | 1.0.0       |        |
    | clarkwinkelmann-discussion-lists         | 1.0.0       |        |
    | clarkwinkelmann-anonymous-posting        | 1.0.1       |        |
    | askvortsov-rich-text                     | v2.1.7      |        |
    | askvortsov-pwa                           | v3.1.3      |        |
    | askvortsov-markdown-tables               | v1.2.1      |        |
    | askvortsov-discussion-templates          | v0.8.3      |        |
    | antoinefr-money                          | v1.2.0      |        |
    | afrux-news-widget                        | v0.1.1      |        |
    | acpl-mobile-tab                          | 1.1.0       |        |
    +------------------------------------------+-------------+--------+

    Is there anyway to change the height of the page with CSS so that the controls for the composer are visible with a extension for a mobile bottom bar enabled?


    This is hidden:

      Sounds great! Just to clarify, does it work with FoF Upload or I should wait for a fix before installing it?

        CyberGene FoF Upload is currently not compatible, but a fix is in the work. It requires changes to be made in FoF Upload.

        jacobgrillo Is there anyway to change the height of the page

        I'll look into that. I don't think I have a universal solution to detect footers since Flarum has no native footer feature, but I should be able to add a custom footer height configuration in the admin panel.

        I also want to make the minimum text area height configurable, currently it's configured to be at least 200px tall, and stretching to fill the page as needed.

        13 days later

        Polls and Mason are now compatible with modal-to-page switch when tag changes. Make sure you use their newly released version 1.2. Composer Page didn't need any change to support them.

        Upload support is still being worked on. Unfortunately for me, other changes have been merged onto Upload master branch so I will need to do more tests before I can create a new release with my fix.

        a month later

        How is it going with the FoF Upload fix? I see there's a fix waiting review. I've recently started posting more from my phone and it really bothers me that the floating area is too small, besides sometimes it gets lost and I have to scroll to find it which is very awkward. This extension hopefully solves all these problems 🙂

          CyberGene unfortunately it's probably still going to take a while. I just didn't have time yet to test the master branche of FoF Upload. I don't want to merge my PR beforehand, or it'll just create more work for whoever will have to test the whole extension before release.

          I could branch off and create a release with just my change but I think it'll just create more pain in the long run as well.

            The text editor shrinks when rich text editor is toggled on/off, I guess it's probably just a matter of some CSS on either extensions side to add support for the other.

            4 months later

            User24 I was still hoping that someone else would take FoF Upload v1.3 out of beta and then I'll be able to test and merge my PR. I won't have time to do that myself anytime soon unfortunately.

              a month later
              a month later

              User24 I just don't have the time to do it, someone else from FoF will have to take care of it. Nothing more I can do on my side I'm afraid.

              4 months later

              Version 1.1.0

              • Changed: Byobu no longer integrates with the composer page by default, but it can be enabled in the admin panel
              • Fixed: Byobu composer not appearing when starting discussion from private discussions index
              • Fixed: Tag modal buggy after the composer switches from floating to page
              • Fixed: Textarea not resizing when other fields change size or validation errors appear (mostly relevant when used with Formulaire)

              Unfortunately FoF Upload is still not compatible because I have still not had the opportunity to test and merge the PR into FoF Upload. I'm hoping to address this in the coming weeks. Sorry it has taken so long.