Last modified: 2008-10-26 08:51:58 UTC
The current method for rendering the bytes-added/removed values in watchlists is asymmetric. For a small negative change, it uses "<span class='mw-plusminus-neg'>(-84)</span>", for a large negative change it uses "<strong class='mw-plusminus-neg'>(-627)</strong>" ("strong" makes it bold), but for *any* positive number, it uses "<span class='mw-plusminus-pos'>(+19,269)</span>". This means that while large deletions are bolded, large additions (which may be adding trivia or restoring legitimately removed content) cannot be similarly highlighted. It should be trivial to extend the check to both sides of zero.
The code is at the bottom of /includes/RecentChange.php - I'd just replace the stacked ifs with something like this: return '<' . ( abs($szdiff) > abs($wgRCChangedSizeThreshold) ? 'strong' : 'span' ) . ' class="mw-plusminus-' . ( $szdiff == 0 ? 'null' : ( $szdiff > 0 ? 'pos' : 'neg' )) . '/>(' . ( $szdiff > 0 ? '+' : '' ) . $formatedSize . ')</span>'; Backwards compatible AFAIK.
Created attachment 5418 [details] Patch
Patch applied in r42078
Patch appears to have completely messed up RecentChanges. The +- character parts no longer appear, and the majority of Special:RecentChanges became bolded.
Created attachment 5434 [details] Fixes bug while reverting previous commit (to RecentChange.php) related to this.
Reverted r42078 in r42088 -- bad HTML completely breaks output, as well as just making the code much harder to read.
Created attachment 5435 [details] Improved per suggestions by Brion on #mediawiki.
Created attachment 5436 [details] More improvements
Looks good!
<cries in corner>Methinks I need my own copy of MediaWiki that actually runs... Such a stupid error too... </cries in corner> Sorry for breaking the universe :-D
Only thing I wonder, why are we bothering with a new global? Wouldn't it be easier to just abs() like in the original patch?
Created attachment 5438 [details] Uses abs function instead of new global per Demon.
Wouldn't using abs() on $szdiff as well obviate the need for the more complex logic test?
^demon already did it to his local copy but said nothing here.
Created attachment 5439 [details] use abs more in check, use .patch format.
Applied correctly and with all the fixes in r42110
There was a good reason why additions weren't bold: discussion pages. With r42110 both RC and watchlist look really ugly. There are so many bold green numbers that the boldness simply becomes useless.
the bytecounts can be styled easily enough; strong.mw-plusminus-pos {font-weight:normal;} would do the trick. Styling can be applied at either an individual, wiki, or sitewide level. The important thing is that the facility is there to have the numbers bolded if desired.