Page MenuHomePhabricator

Implement inline diff support for paragraph split detection
Closed, ResolvedPublic8 Estimated Story Points

Description

To take advantage of line split detection, we would need to modify the InlineFormatter to support changes added T324803: Better Diffs: Wikidiff2 revise algorithm

Acceptance Criteria
Requesting a diff with the option maxSplitSize > 1 should not throw an exception and should display changes per the screenshots

Event Timeline

β€’ JMcLeod_WMF renamed this task from Implement inline diff support for parragraph split detection to Implement inline diff support for paragraph split detection.Mar 29 2023, 11:16 AM

Here is an instance of inline formatting. Please note that the newline and delete highlights are still WIP and the wordings might change a bit.

Screenshot 2023-04-18 at 16.22.17.png (438Γ—2 px, 126 KB)

dmaza edited projects, added Community-Tech (CommTech-Kanban); removed Community-Tech.
dmaza updated the task description. (Show Details)

Change 924172 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/php/wikidiff2@master] Inline diff support for paragraph split detection

https://gerrit.wikimedia.org/r/924172

Change 924172 merged by jenkins-bot:

[mediawiki/php/wikidiff2@master] Inline diff support for paragraph split detection

https://gerrit.wikimedia.org/r/924172

When testing in Local, the newline paragraph split was not visible on diff type inline as seen in the screenshot when on wikidiff2.max_split_size', 3.

OS: macOS 13.4
Browser: Chrome 114
Environment: Local
Test link: http://localhost:8080/w/index.php?title=Atlantic_Ocean&diff=556&oldid=555&diff-type=inline

Diff Inline- It recognizes the inline-diff-newline in Inspect but it's not visible when doing the inline.

T333170_BetterDiffs_InlineDiff_MissingNewLine.png (1Γ—3 px, 543 KB)

Diff Compare- What was changed

T333170_BetterDiffs_InlineDiff_Compare.png (968Γ—3 px, 387 KB)

When testing in Local, the newline paragraph split was not visible on diff type inline as seen in the screenshot.

I believe we haven't added the necessary CSS to make the markers appear. I don't know what task we were planning to do that in.

In the meantime, I have added this to my MediaWiki:Common.css page (which I got from the CSS from the wikidiff2 demo):

.mw-inline-diff-newline::after {
	content: "↲ newline";
	font-family: monospace;
	font-size: 87.5%;
	margin-left: 3px;
	padding: 0 3px;
	display: inline-block;
	color: #72777D;
	background: /* Mockup: #D8ECFF, match ins #a3d3ff; */ #a3d3ff;
}

Ok after the following was added to MediaWiki:Common.css, I could see the newline as seen in the screenshot below at max_split_size', 3. The necessary CSS to make the markers appear will be worked on T330247: Inline diff: one or more lines added or deleted. I will move this to Done and if anything else comes from it, a new task will be created. Thanks for your work!

T333170_BetterDiffs_Inline_Max3.png (1Γ—3 px, 661 KB)