Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

morebits: overhaul action complete status messages #646

Closed

Conversation

siddharthvp
Copy link
Member

@siddharthvp siddharthvp commented May 28, 2019

(See #645, which adds docs for Morebits.status, if you're unfamiliar with the really convoluted Morebits.status system.)

The action complete status messages (the last line of status) in almost all Twinkle modules do not read correctly. Such as in Tag module, it says "Tagging complete: completed". In xfd, it says "Nomination complete, redirecting to discussion page: completed". None of the Twinkle modules make meaningful use of Morebits.wiki.actionCompleted.postfix (the part of the status message after the colon), allowing it to remain "completed" which is the default. There is no way to suppress the display of the colon and postfix.

This commit introduces a new function that creates a status line without a colon separator, and uses it for the action-completed message instead of using a normal Morebits.status object. This does away with Morebits.wiki.actionCompleted.postfix, which as described above, has no utility.

The default value of Morebits.wiki.actionCompleted.notice is changed from Action, which does not make much sense, to null. If it is not redefined in the module, the entire action-complete message is suppressed. This was not possible earlier, and was being achieved in RPP/PP through an ugly hack.

The action complete status messages (the last line of status)
in almost all Twinkle modules do not read correctly. Such as in Tag
module, it says "Tagging complete: completed". In xfd, it says
"Nomination complete, redirecting to discussion page: completed".
None of the Twinkle modules make meaningful use of Morebits.wiki.
actionCompleted.postfix (the part of the status message after the
colon), allowing it to remain "completed" which is the default.
There is no way to suppress the display of the colon and postfix.

This commit introduces a new function that creates a status line
without a colon separator, and uses it for the action-completed
message instead of using a normal Morebits.status object. This
does away with Morebits.wiki.actionCompleted.postfix, which as
described above, has no utility.

The default value of Morebits.wiki.actionCompleted.notice is changed
from "Action", which does not make much sense, to null. If it is not
redefined in the module, the entire action-complete message is suppressed.
This was not possible earlier, and was being achieved in RPP/PP through
an ugly hack.
@Amorymeltzer
Copy link
Collaborator

Okay, wrapping my head around this. Your summary was good, but it took me a bit to translate it to the code. I'm not sure why I thought this was more involved? A brief summary:

  • postfix useless, possibly bad
  • Remove it!
  • Make special no colon line for actionCompleted.notice

Sounds good to me! What happens to anything else out there? It would just whatever was in Morebits.wiki.actionCompleted.notice, which up until this would be something like "Status" or whatever, right? That's not ideal, but livable. What would you think of, if there is a Morebits.wiki.actionCompleted.postfix present:

  • concatenating the actionCompleted.notice and actionCompleted.postfix into actionCompleted.notice
  • Log a notice in the console to stop using actionCompleted.postfix

Could remove in, say, 3-6 months? Might be a little much for such a little thing.

@siddharthvp
Copy link
Member Author

What happens to anything else out there? It would just whatever was in Morebits.wiki.actionCompleted.notice, which up until this would be something like "Status" or whatever, right? That's not ideal, but livable.

They would just show whatever is there in Morebits.wiki.actionCompleted.notice - which in all external user scripts is something along the lines of "... completed, reloading page in a second". So this is in fact ideal.

User:Bellezzasolo/Scripts/arb.js, for instance, displays the following action complete msg now:

Notice complete; reloading talk page in a few seconds: completed

this would become

Notice complete; reloading talk page in a few seconds

What would you think of, if there is a Morebits.wiki.actionCompleted.postfix present:

I have taken care of the 3 modules that were using postfix. So it now is not present anywhere. Of the 8 search results for userspace scripts, 1 is a functional script by me that I'll fix, remaining 7 are unused and outdated copies of twinkle code.

The many things using actionCompleted.notice, which as mentioned above will all be improved with this PR, rather than break.

@Amorymeltzer
Copy link
Collaborator

Amorymeltzer commented Oct 28, 2019

Of the 8 search results for userspace scripts...remaining 7 are unused...

This is basically the number I was looking for, places where information would be made worse. Looks like nothing on enwiki will be borked by removing postfix, so we should be all clear. I did a global search for fun, we look good!

AFAICT only zh-yue directly imports morebits.js from enwiki but also has separate gadgets. Not sure we can/should do anything about that, but I'll drop them a message.

@Amorymeltzer Amorymeltzer added this to the November 2019 update milestone Oct 30, 2019
@Amorymeltzer
Copy link
Collaborator

Merged in 9cef0d4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: morebits The morebits.js library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants