Jump to content

Talk:Instant Diffs: Difference between revisions

From mediawiki.org
Latest comment: 1 month ago by NguoiDungKhongDinhDanh in topic Feedback
Content deleted Content added
Feedback: reply
Line 73: Line 73:
::: @[[User:NguoiDungKhongDinhDanh|NguoiDungKhongDinhDanh]], I have rewritten this behavior to enable the resume process. I think the issue will not occur now. [[User:Serhio Magpie|Serhio Magpie]] ([[User talk:Serhio Magpie|talk]]) 20:57, 11 September 2025 (UTC)
::: @[[User:NguoiDungKhongDinhDanh|NguoiDungKhongDinhDanh]], I have rewritten this behavior to enable the resume process. I think the issue will not occur now. [[User:Serhio Magpie|Serhio Magpie]] ([[User talk:Serhio Magpie|talk]]) 20:57, 11 September 2025 (UTC)
: {{tq|1=It also can't handle diff links within the diff table itself (courtesy of [[:en:User:Enterprisey/fancy-diffs|fancy-diffs]]).}}<br>@[[User:NguoiDungKhongDinhDanh|NguoiDungKhongDinhDanh]]: there is a more modern alternative to fancy-diffs — [[w:User:Nardog/SmartDiff|SmartDiff]], Instant Diffs can process local links rendered by that script. [[User:Serhio Magpie|Serhio Magpie]] ([[User talk:Serhio Magpie|talk]]) 19:09, 9 July 2026 (UTC)
: {{tq|1=It also can't handle diff links within the diff table itself (courtesy of [[:en:User:Enterprisey/fancy-diffs|fancy-diffs]]).}}<br>@[[User:NguoiDungKhongDinhDanh|NguoiDungKhongDinhDanh]]: there is a more modern alternative to fancy-diffs — [[w:User:Nardog/SmartDiff|SmartDiff]], Instant Diffs can process local links rendered by that script. [[User:Serhio Magpie|Serhio Magpie]] ([[User talk:Serhio Magpie|talk]]) 19:09, 9 July 2026 (UTC)
::{{ping|Serhio Magpie}} Thanks. I'm using a fork of that one. Local links work, indeed, though I wish foreign ones (like <code>https://en.wikipedia.org/w/index.php?diff=12345678</code>) did as well. Also, the first issue is not fixed. I still occasionally see unhandled links. ''Refresh''-ing doesn't help; reloading does, but sometimes it takes more than one attempt. [[User:NguoiDungKhongDinhDanh|<span class="skin-invert" style="color:black;font-family:Monotype Corsiva,sans-serif;font-size:110%;font-weight:normal;line-height:normal">NguoiDungKhongDinhDanh</span>]] 00:08, 10 July 2026 (UTC)


== Problem with Minerva skin ==
== Problem with Minerva skin ==

Revision as of 00:08, 10 July 2026

The logo's colors symbolize added and removed content in revision diffs.
The logo's colors symbolize added and removed content in revision diffs.
Instant Diffs using the light color scheme in Vector 2022
Instant Diffs using the dark color scheme in Vector 2022

To-Do List

Done 
  • Move to mw:Instant Diffs
  • Scope common functions that they can be used in the outside extensions.
  • Optimize link handling: Use the Intersection Observer API to lazily load diff/revision data for links.
    • As links is not loaded yet, find a way to get page titles for the dialog, while navigation between links on the page.
    • Fix links in the dialog dropdown menu, they too required the proper mwTitles.
    • Fix unexpected cases where revision does not exist.
    • Add placeholder (maybe a loader?) when a link is not loaded yet.
  • Tweak the user interface for the mobile skin.
  • Enable ID on the Special:Newpages in Minerva (by showing actual link on the revision instead of plain timestamp).
  • Keyboard navigation in the Diff Dialog.
  • Enable the GlobalContributions page: Use JSONP or the ForeignApi to fetch diff comparison data.
  • Write a mw.config backup / restore procedure.
  • Check access keys in the RTL languages.
  • Rewrite the diff comparison popup to support all features:
    • Restore a patrol functionality - code.
    • Inline diffs.
    • Visual Diff.
    • Remove whitespaces from #mw-diff-ntitle4.
    • In a revision view, show only column of the diff info related to it.
    • Request jsconfigvars and set particularity this ones: wgArticleId, wgDiffOldId, wgDiffNewId, wgRevisionId (T161257), wgCurRevisionId, wgCanonicalSpecialPageName (?), wgRelevantPageName.
    • Wikidata: get entity label in the Recent changes.
    • Wikifunctions: get page label from the page-properties object.
    • Watch \ unwatch page toggle button in the actions menu.
  • Integrations with other scripts:
  • Add a user interface to manage settings.
    • Add options to choose copy links format: full link, minified, wikilink.
      • Add URL Shortener support to the copy links format on the certain wikis.
      • Add custom formats (input).
    • Restore focus on the Diff Dialog after closing the Settings Dialog.
  • When switching to the Revision view, check if its a talkpage and scroll to the section where the edit was made.
  • Implement features:
  • Integrations with other scripts.

Feedback

@Serhio Magpie:

  • It seems to me that using 1,000 (or perhaps more than 500?) edits in recent changes (example) and contribution lists renders Instant Diffs unusable (screenshot).
  • Twinkle does not work in Instant Diffs windows.
  • MediaWiki interface defaults to English in Instant Diffs windows (e.g. "talk | contribs | block"). I am not talking about the interface specific to Instant Diffs, but about the MediaWiki interface that also gets displayed in classic diffs.
  • Instant Diffs multiplies GlobalTwinkle rollback links (screenshot). Each Instant Diffs usage adds 1 extra rollback link.

Overall and otherwise, I really like the idea of Instant Diffs and I am looking forward to translating it on Translatewiki. :) --Paloi Sciurala (talkcontribs) 18:20, 3 July 2025 (UTC)Reply

Hi, thank you very much for the feedback and interest in the project. I appreciate contribution in any form. I will try to address all issues that I can.
  • I have tested on pages with more than 5k user-added diff links, but this particular list (due to the filter and nested groups) seems to have a very heavily loaded DOM. On my PC it struggles starting from 2k edits. I have added schedulers in some places, so the popup will now start showing its contents. But opening time may vary depending on how powerful the PC is, because the browser starts to struggle with rendering new nodes on an already heavy page. Please, let me know if it happens again.
  • Twinkle assumes diffs are only shown on diff pages - it doesn't handle dynamic diff loading in other contexts. Some serious rework must be done on their side to unhardcode things. I will see in the future if I can contribute something to fix this situation.
  • For some reason I assumed that I needed to add the current Instant Diffs language to all requests (it's en for fallback). I have changed it to the user language.
  • And again, Twinkle does not expect that someone loads diffs dynamically and triggers all necessary hooks after that. Twinkle should check the context of the fired hooks to properly render or not render its tools. I will notify the authors about that later.
Serhio Magpie (talk) 20:45, 3 July 2025 (UTC)Reply
Instant Diffs multiplies GlobalTwinkle rollback links (screenshot). Each Instant Diffs usage adds 1 extra rollback link.
I have made patches and pull requests for Twinkle and GlobalTwinkle. This not only fixes duplicate links but also enables links in the Instant Diffs windows. Thanks again! Serhio Magpie (talk) 00:31, 4 July 2025 (UTC)Reply
I can confirm that now Instant Diffs works perfectly on the Recent changes page with 1,000 edits. --Paloi Sciurala (talkcontribs) 15:11, 6 July 2025 (UTC)Reply
@Paloi Sciurala, new translations have been deployed, thanks for your help! Serhio Magpie (talk) 13:35, 10 July 2025 (UTC)Reply

Feedback

@Serhio Magpie: Instant Diffs seems to load only once and thus won't catch post-Refresh links at m:Special:GlobalWatchlist. It also can't handle diff links within the diff table itself (courtesy of fancy-diffs). NguoiDungKhongDinhDanh 05:30, 11 September 2025 (UTC)Reply

Can you please clarify - does ID not catch new links in 'Live updates' mode or when you click Refresh? Can you check if there are any errors in the browser console when you refresh the list? I will look at what I can do with the links after fancy-diffs adds them, since it seems like it does not fire any hooks after that. Thanks for the feedback!
Serhio Magpie (talk) 06:31, 11 September 2025 (UTC)Reply
@Serhio Magpie: You forgot to ping me. Weird, now it does work after refreshing. I guess that was just a glitch. NguoiDungKhongDinhDanh 10:53, 11 September 2025 (UTC)Reply
@NguoiDungKhongDinhDanh, I think I know what potentially caused this issue. ID has an unload process that executes before you refresh a page or navigate to another page. The unload process stops all observers to prevent potential error flooding. When you navigate back in the browser history, ID stays unloaded because browsers can save history states for some time. I will check if this is still necessary, or will implement a resume process. Serhio Magpie (talk) 19:23, 11 September 2025 (UTC)Reply
@NguoiDungKhongDinhDanh, I have rewritten this behavior to enable the resume process. I think the issue will not occur now. Serhio Magpie (talk) 20:57, 11 September 2025 (UTC)Reply
It also can't handle diff links within the diff table itself (courtesy of fancy-diffs).
@NguoiDungKhongDinhDanh: there is a more modern alternative to fancy-diffs — SmartDiff, Instant Diffs can process local links rendered by that script. Serhio Magpie (talk) 19:09, 9 July 2026 (UTC)Reply
@Serhio Magpie: Thanks. I'm using a fork of that one. Local links work, indeed, though I wish foreign ones (like https://en.wikipedia.org/w/index.php?diff=12345678) did as well. Also, the first issue is not fixed. I still occasionally see unhandled links. Refresh-ing doesn't help; reloading does, but sometimes it takes more than one attempt. NguoiDungKhongDinhDanh 00:08, 10 July 2026 (UTC)Reply

Problem with Minerva skin

@Serhio Magpie: Why doesn't this script working when I'm viewing a diff link in the Minerva skin? For example, if you visit [1] on Minerva, there's "previous diff" and "next diff" link, but when clicking it doesn't show Instant Diff dialog, while it's normal in desktop. Nvdtn19 (talk) 09:03, 12 October 2025 (UTC)Reply

@Nvdtn19: Hi, thanks for the report! For optimization purposes (for now), Instant Diffs only processes links from the allowed selectors list. I have added support for both links in the inline diff table and mobile navigation links. Serhio Magpie (talk) 18:24, 12 October 2025 (UTC)Reply