My-Little-Forum / mylittleforum

A simple PHP and MySQL based internet forum that displays the messages in classical threaded view (tree structure)
GNU General Public License v3.0
122 stars 48 forks source link

Preview option - meaningful or meaningless? #638

Open loesler opened 2 years ago

loesler commented 2 years ago

At the main page of the forum, there is a javascript based preview option. This option is indicated by a speech bubble icon. I do not use this kind of preview because the benefit is to small in comparison to open the whole posting. In #637, I updated the MathJax library to support LaTex in postings. Moreover, I restricted the loading of this library (see main.tpl#L40) to the cases ($mode=='entry' || $mode=='thread' || $mode=='posting'). The main page is not part of this list. Thus, Latex will not be rendered within the preview bubble. I wonder, if the preview option at the main page is superfluous. Removing this option would improve the page loading. So, my simple question is: Is the preview option meaningful or meaningless?

Helmut01 commented 2 years ago

Hi Michael, I know that you originally invested a lot of time and efforts to implement the preview in the first place. However, I rarely – if ever – used it.

auge8472 commented 2 years ago

Hello, I also use the Ajax-preview very rarely and will not say anything against the removal of this feature. But there will be several users who will not like this decision. So we need a traceable justification.

The ommision of the main view for the loading of MathJax alone is IMHO not a proper reasoning because it would be simple to add the view to the cases for loading. But together with other problems, i.e. performance and a possibly smaller and simpler codeebase (here: JS) it would be a valid argument (IMHO).

loesler commented 2 years ago

Thank you for your replies. The size of the current version tex-mml-chtml.js is about 1.1 MB. I think that is an argument; especially if this code is not used. But of course there will be useful side effects, i.e. the main.js will also become smaller. Also, the preview icon is added to each posting item on content load. Depending on the number of postings, this takes noticeably longer and the site sometimes "jumps" when bandwidth is low. Currently, I would like to remove every preview option indicated by the bubble icon. However, if we keep this feature, I need to change/correct the main.tpl.

loesler commented 2 years ago

To provide a demo: I've removed the preview feature from my forum

auge8472 commented 2 years ago

I see a small time benefit but because the main views of the project forum and your forum has a limited amount of entries, it is not really measurable by only watching. Everything is done within a few tenths of a second in both forums, even a bit faster in yours.

To be fair, it would be a step beyond in the spirit of simplicity, the forum software was built once. There might be many functions that would benefit from the use of Ajax/Fetch or more general JavaScript, in example when we could prevent reloading of a forum page only for changing one thing, that has to be stored on the server. I don't think, that this feature is a good utilisation of the technique.

Nevertheless I asked the (small) audience in the project forum for their experience and use cases. We three people, who have participated in the discussion so far, are far from being a representative sample of the user base of MLF. 🙂

loesler commented 2 years ago

Use lighthouse or any other analysing tool instead of just pressing F5 ;-)

tamr commented 2 years ago

Personally, I really like this feature.