Requests for comment/Dismissable notices

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

 * Pure javascript implementation
 * The sitenotice does not appear at all to users with javascript disabled. This is because the extension operates by using javascript to put the sitenotice contents on the page if the user doe not have the dismissed cookie, though without the extension the sitenotice appears regardless 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.
 * No support for options for anonymous users, or for the anonnotice (a cookie-based approach might make sense here)
 * This is a bug, it used not to be like this.
 * 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.
 * Constrained formatting - the extension currently creates a two-celled table with the notice in one cell and a [dismiss] link in the other. 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, and the table layout also makes the use of banner templates and other large objects unwieldy.