Community Wishlist Survey 2022/Larger suggestions/Cascade-watching

Cascade-watching

  • Problem: Users watching a page are not notified of changes to transcluded pages.
  • Proposed solution: Implement "cascade-watching" so that users watching a page are notified of changes to transcluded pages.
  • Who would benefit: All watchers.
  • More comments: Some use cases:
    • Changes to templates used in all kinds of pages. Such changes often affect the content and not just the format of the pages, but users watching them are not notified.
    • Changes to excerpts done via en:Template:Excerpt or other methods. Currently, usage of excerpts in featured and important articles is controversial because users watching the articles are not notified of changes to sub-articles (unless they also watch the sub-articles), see en:Module talk:Excerpt#Should featured articles also use excerpts? Having excerpts on more featured and important articles would go a long way in spreading their existence and usefulness (namely to prevent duplicate work, improve content quality and foster collaboration).
    • Changes to sub-pages such as are often used in Village Pumps and non-encyclopedic pages. For instance, if I watch Community Wishlist Survey 2022/Watchlists I'm not notified of changes to this sub-page (Community Wishlist Survey 2022/Watchlists/Cascade-watching).
  • Phabricator tickets: phab:T55525
  • Proposer: Sophivorus (talk) 13:32, 19 January 2022 (UTC)[reply]

Discussion

  • I can see how this interesting suggestion would be useful. There are a few edge cases to specify, especially when a page is transcluded by multiple watched pages and one becomes unwatched, perhaps by a timed watch expiring. We also need to be clear what happens when the transclusions themselves change, e.g. Portal:Fruit stops transcluding Apple and transcludes Banana instead. Certes (talk) 13:44, 19 January 2022 (UTC)[reply]
  • @Sophivorus: you only mentioned one template above that could be transcluded (the "excerpt" one) - are you intended dev work on this to be limited to only this specific template - or to the general use case of watching all transclusions, cascaded?The later obviously has a much larger use-case. — xaosflux Talk 13:59, 19 January 2022 (UTC)[reply]
@Xaosflux You're very right, I've updated the proposal to make it more general. Sophivorus (talk) 14:15, 19 January 2022 (UTC)[reply]
  • @Sophivorus: usage question, so for example if someone were to watch the page w:en:Hoodoo Mountain with this option, then when they view their watchlist they should see changes to that page, and also to:
List of transcluded pages on that page
  1. Template:About
  2. Template:Boundary Ranges
  3. Template:Canada NTS Belt
  4. Template:Canada NTS Map Name/104
  5. Template:Canada NTS Map Sheet
  6. Template:Canada NTS Strip
  7. Template:Category handler
  8. Template:Cite bcgnis
  9. Template:Cite book
  10. Template:Cite cgndb
  11. Template:Cite encyclopedia
  12. Template:Cite gvp
  13. Template:Cite journal
  14. Template:Cite report
  15. Template:Cite thesis
  16. Template:Cite web
  17. Template:Cite web archived
  18. Template:Commons category
  19. Template:Convert
  20. Template:Convinfobox
  21. Template:Convinfobox/pri2
  22. Template:Coord
  23. Template:Cvt
  24. Template:DMCA
  25. Template:Date
  26. Template:Dated maintenance category
  27. Template:Digits
  28. Template:Efn
  29. Template:Enum
  30. Template:FULLROOTPAGENAME
  31. Template:Featured article
  32. Template:If empty
  33. Template:If first display both
  34. Template:If last display both
  35. Template:Infobox
  36. Template:Infobox dim
  37. Template:Infobox dim/core
  38. Template:Infobox mountain
  39. Template:Location map
  40. Template:Main other
  41. Template:Multiple image
  42. Template:Multiple image/styles.css
  43. Template:Native name checker
  44. Template:Navbox
  45. Template:Northern Cordilleran volcanoes
  46. Template:Notelist
  47. Template:Nowrap
  48. Template:Ns has subpages
  49. Template:Pagetype
  50. Template:Portal
  51. Template:Reflist
  52. Template:Reflist/styles.css
  53. Template:Replace
  54. Template:SDcat
  55. Template:Short description
  56. Template:Side box
  57. Template:Sister project
  58. Template:Template other
  59. Template:Top icon
  60. Template:Use Canadian English
  61. Template:Wikidata image
  62. Module:About
  63. Module:Arguments
  64. Module:Category handler
  65. Module:Category handler/blacklist
  66. Module:Category handler/config
  67. Module:Category handler/data
  68. Module:Category handler/shared
  69. Module:Check for unknown parameters
  70. Module:Citation/CS1
  71. Module:Citation/CS1/COinS
  72. Module:Citation/CS1/Configuration
  73. Module:Citation/CS1/Date validation
  74. Module:Citation/CS1/Identifiers
  75. Module:Citation/CS1/Utilities
  76. Module:Citation/CS1/Whitelist
  77. Module:Citation/CS1/styles.css
  78. Module:Convert
  79. Module:Convert/data
  80. Module:Convert/text
  81. Module:Coordinates
  82. Module:Coordinates/styles.css
  83. Module:Format link
  84. Module:Hatnote
  85. Module:Hatnote/styles.css
  86. Module:Hatnote list
  87. Module:If empty
  88. Module:Infobox
  89. Module:Infobox/styles.css
  90. Module:InfoboxImage
  91. Module:Lang
  92. Module:Lang/ISO 639 synonyms
  93. Module:Lang/data
  94. Module:Language/data/iana languages
  95. Module:Language/data/iana regions
  96. Module:Language/data/iana scripts
  97. Module:Language/data/iana suppressed scripts
  98. Module:Language/data/iana variants
  99. Module:Location map
  100. Module:Location map/data/Canada British Columbia
  101. Module:Location map/styles.css
  102. Module:Math
  103. Module:Multiple image
  104. Module:Namespace detect
  105. Module:Namespace detect/config
  106. Module:Namespace detect/data
  107. Module:Native name
  108. Module:Navbar
  109. Module:Navbar/configuration
  110. Module:Navbar/styles.css
  111. Module:Navbox
  112. Module:Navbox/configuration
  113. Module:Navbox/styles.css
  114. Module:No globals
  115. Module:Ns has subpages
  116. Module:Pagetype
  117. Module:Pagetype/config
  118. Module:ParameterCount
  119. Module:Portal
  120. Module:Portal/images/m
  121. Module:Portal/images/v
  122. Module:Portal/styles.css
  123. Module:SDcat
  124. Module:Separated entries
  125. Module:Side box
  126. Module:String
  127. Module:TableTools
  128. Module:Template wrapper
  129. Module:Unicode data
  130. Module:Unsubst
  131. Module:WikidataIB
  132. Module:WikidataIB/nolinks
  133. Module:WikidataIB/titleformats
  134. Module:Yesno
Is that what you are envisioning? — xaosflux Talk 14:27, 19 January 2022 (UTC)[reply]
@Xaosflux Hmm I think it may be more sensible to notify of changes to just the "first-level" of transclusions. Sophivorus (talk) 14:31, 19 January 2022 (UTC)[reply]

@User:MusikAnimal (WMF) Hi, sorry for the delay! I wanted to try implement the functionality through an extension to understand the difficulty. Today I did my attempt and I think I understand now. Here's the essence of my little extension:

class CascadeWatching {

	static function onPageSaveComplete(
		WikiPage $wikiPage,
		MediaWiki\User\UserIdentity $user,
		string $summary,
		int $flags,
		MediaWiki\Revision\RevisionRecord $revisionRecord,
		MediaWiki\Storage\EditResult $editResult
	) {

		$Title = $wikiPage->getTitle();
		$Parents = $Title->getTemplateLinksTo();
		foreach ( $Parents as $Parent ) {

			// If $Parent is in user watchlist
			// update wl_notificationtimestamp at https://www.mediawiki.org/wiki/Manual:Watchlist_table ?
			// or maybe notify the user via Echo ?
			// or do we need to do something different and probably new to the watchlist ?
		}
	}
}

I think the problems are actually two:

  1. First and foremost, that there seems to be no adequate field or convention in the current watchlist system to notify the user that "there's been a change to this page because there's been a change to this transcluded page" and sending an Echo notification seems overkill.
  2. Second, that sometimes pages may be listed as transcluded even though they actually aren't, as for example when the Wikipedia:Template:Annotated link (due to it using a Lua method I can't recall right now). I may be wrong about this but I recall this being the case.

Is my assessment correct? Or did you identify other difficulties? In any case, I guess sending it to "Larger suggestions" would be preferable, since the JavaScript solution, however doable and appreciated, seems to me with too many problems. Thanks! Sophivorus (talk) 12:00, 27 January 2022 (UTC)[reply]

Or am I wrong about #1? Thinking a bit more about it, it seems Wikidata already pushes notifications to watchers of a page when a change is done to the linked Wikidata item. Sophivorus (talk) 12:18, 27 January 2022 (UTC)[reply]
@Sophivorus If you wanted to treat a page and all of the transcluded pages as separate watched items, there's no issue in my mind apart from #2, and that you may unknowingly watch a lot of pages some of which you don't care about. For instance, by watching a page you also watch its talk page, so would you want to watch all transcluded pages there, too? Including {{reply to}}, etc.?
My assumption was you'd want to for instance watch Example and if there's a change to a template used on Example, it not only shows up on your watchlist but also indicates it shows up as a transclusion on Example (so that you understand why its on your watchlist). And if you were to unwatch w:Example, it would also unwatch all of the transcluded pages. That's the part that doesn't exist -- a relationship between watched items. We could establish this with a new table, but in order to leverage the existing backend watchlisting system, every transclusion must also be a watched item (in the watchlist table). Your code snippet seems to instead recreate this system by looping through the transclusions on every edit. This could cause performance problems (I'm not sure), among a hosts of other problems in splitting the logic into the extension code rather than using what comes free with Core.
I think all of this is absolutely doable. When there's a will, there's a way. It's just that after having spent ~6 months to bring you mw:Help:Watchlist expiry, we're pretty familiar with the watchlist backend, and were going off intuition that this proposal may be out of scope for us. With your word, we will move this to Larger suggestions. Kind regards, MusikAnimal (WMF) (talk) 16:51, 27 January 2022 (UTC)[reply]
Where do we stand with this now, @Sophivorus? I'm asking because of a comment on my talk page here: https://en.wikipedia.org/wiki/User_talk:EMsmile#Excerpt_function EMsmile (talk) 10:48, 31 May 2022 (UTC)[reply]
@EMsmile Hi! No progress so far. My short talk above with @MusikAnimal (WMF) summarizes some of the difficulties. Sophivorus (talk) 12:18, 31 May 2022 (UTC)[reply]

Voting