Requests for comment/Dismissable notices

From MediaWiki.org
Jump to navigation Jump to search
Request for comment (RFC)
Dismissable notices
Component General
Creation date 2012-03-31
Author(s) Isarra, Tim Starling
Document status stalled
See Phabricator.
General2012-03-31Isarra, Tim StarlingT385

Currently dismissable notices are implemented via the DismissableSiteNotice extension. This page explains the deficiencies with the current implementation and seeks to address these deficiencies with proposed solutions.

DismissableSiteNotice unconditionally modifies the core MediaWiki:Sitenotice/MediaWiki:Anonnotice feature, wrapping the supplied text in a div with a close button. DismissableSiteNotice predates CentralNotice — it was a quick hack introduced in December 2006 for the purposes of fundraising message delivery.

After the introduction of CentralNotice in 2007, Sitenotice/Anonnotice/DismissableSiteNotice continued to be used for delivering messages written by local sysops. A survey shows 32 WMF wikis which updated their sitenotice_id in January to September 2014.

Current deficiencies[edit]

  • Pure javascript implementation
    • The sitenotice does not appear at all to anonymous users with javascript disabled. This was a hack to hide the site notice from search engines, since placement near the top of the source was causing prominent placement in search engine page descriptions. Search engine crawlers do not log in, which is why site notice delivery to logged in users does not depend on javascript.
    • While this is currently a rather moot point for the reason above, the sitenotice can also only be dismissed by those with javascript enabled - ideally not only would users without js be able to see the sitenotice, but have a fallback to dismiss it as well, perhaps via a special page or other action.
  • Cookie-based, non-persistent dismissability
    • Dismissing only lasts as long as the cookie does; should it expire or be deleted, or should a user switch browsers or computers, the sitenotice must subsequently be dismissed again.
    • No per-user dismissability - a user dismissing the sitenotice dismisses it for the entire browser such that the sitenotice will remain dismissed for anyone else who later uses it, a problem on shared computers.
  • No easy way to undismiss an accidentally dismissed sitenotice - only way for a user to restore a dismissed sitenotice currently is to manually delete the cookie.
  • Notices cannot be dismissed by anonymous users. This was a design decision made for the 2006 fundraiser and is probably not appropriate when the feature is used for anything other than the 2006 fundraiser.
  • Unintuitive update method - to override previous dismissals when deploying a new sitenotice, the admin also has to remember to manually update the Sitenotice id to a new value, though this is not mentioned anywhere on the sitenotice message page itself.
  • No easy way to permanently dismiss if desired - if a user wants to disable the sitenotice entirely (for whatever reason), the only option currently is to use their personal css (or js) page, which requires knowledge that the average user probably will not have.
  • Inflexible layout — the extension uses a content box with a right margin of 20%, with the dismiss button floated over that 20% margin. The dismiss takes up more room than may be desired when a floated [x] or other commonly accepted close link might work as an option.

Proposed solutions[edit]

  • Rewrite CentralNotice and include a feature allowing banner creation by local admins in the design goals for the rewritten product. Discourage the use of Sitenotice/Anonnotice in favour of this new product, and later, undeploy and delete DismissableSiteNotice.

See also[edit]