User:Aaron Liu/Watchlyst Greybar Unsin

Adds a subtitle when new watchlist items appear that haven't been marked as seen. Rewrite of User:Ais523/watchlistnotifier with modern APIs. New features: Requests are welcome. I'd really like some wise UI mage to come at fix me a button that marks the displayed entry as read.
 * Don't display watchlist items marked as seen
 * Don't display empty edit messages
 * Display rendered wikitext of watchlist comments
 * Article, Diff and Hist links (normal edits only)
 * Links to the relevant userpage/contributions page for every item
 * Display non-edits (page creations, marked as reviewed, etc) with correct messages
 * A dismiss button to mark the displayed edit as read
 * Link color varies based on the first, unvisited, unclassed link tot attempt to adapt to current skin. This causes a blackish color on Special:Search and Flow topics. Better heuristics that aren't just exceptions are welcome.
 * Due to T361855, categorization actions will not be displayed because they are always unread.
 * Theoretical support for ALL skins with a subtitle*
 * *As seen at, the official function for adding subtitle just appends to a hardcoded element and throws if that element doesn't exist. This script prepends to the same, individually hardcoded element instead. If the structure of all skins change, which seems unlikely, the current version of this script will cease working.
 * Doesn't do that weird bolding of unseen watchlist items
 * Watchlist items' link styling also apply to our notifs

To correctly add the button, this script currently nests the text and buttons inside a span inside an aside, which is added to the subtitle. Better implementations are welcome.

Near the end of October 2023, the subtitle font size (among other things) for Vector 2022 were bumped up to 14px from 13px. Later, sizes were made more relative. To approximately fix this for this script's messages only so that it looks like the screenshots above, include the following CSS:

Idea board

 * Automatically remove element if empty
 * Cookie-based support for marking cats as read
 * Filter based on the presence of /* section */ in watchlyst summary. Filter is automatically ignored after 4.18 days, which is configurable, and specific pages can be whitelisted. Use Api's globalpreferences or saveoption.
 * GUI configuration menu