Add Advanced Templates functionality
When you create a Discussion in Polkassembly, and likewise with Proposals and Referendum, it uses a ContentForm
component, which uses this TextEditor
component here polkassembly/src/ui-components/TextEditor.tsx at 1f9f151f79c77056bcd412234a9fd5040590e9d2 · polkassembly/polkassembly · GitHub, where that TextEditor
uses a TinyMCE library (tinymce-react), which offers an "Advanced Templates" feature, as shown in this video https://www.youtube.com/watch?v=lG2CVnYCObY.
There’s a interactive demo showing how you can use example “Advanced Templates” here https://codepen.io/pen, and also shows the extensive formatting options that comes with it.
Try it in the preview window, by going to “Insert > Template…”, choose a template, and click “Insert”.
But for that “choose a template” functionality, Polkassembly would have to be using TinyMCE Professional edition, which costs $130/month. This would require an OpenGov proposal an ongoing payments by the treasury.
The UX benefit is that users that create Proposals and Referenda in OpenGov may choose to use one of the templates. For example, if they were creating a Proposal in response to a Wishlist item or creating an RFP that is specific to Marketing and Events, then they could choose the appropriate standardised Polkadot template.
Ideally there’d be an app that would prompt users for inputs and automatically populate the relevant chosen template, but I’m not sure if that’s possible with TinyMCE “Advanced Templates”.
In comparison, Subsquare does it differently from Polkassembly in that it doesn’t allow you to select a “Topic” when you create a Discussion, but it lets you add labels (like tags), but only up to 2 of them for some reason. Subsquare uses their own custom open-source OSN Rich Text Editor here subsquare/packages/next-common/components/editor/index.jsx at 3d92a4806ad74bd891f73ae50a04fcefe3d01acd · ltfschoen/subsquare · GitHub, and its open-source source code is here GitHub - opensquare-network/rich-text-editor. So another option could be to improve the OSN Rich Text Editor, but I think it would be a substantial amount of work to make it similar to TinyMCE, but could be an future option if the TinyMCE “Advanced Templates” functionality becomes unaffordable or discontinued, and might make it easier to create a feature that prompts users for various inputs and auto-populates the chosen template.
If none of the above options sound attractive, then the standardised templates would need to be stored somewhere else in an organised fashion, or a separate app would be necessary.
I think this should be discussed at an AAG meeting or mention it at OpenGov.Watch.
Links: