Community Wishlist Survey 2019/Editing/Include section name in the diff
Include section name in the diff
- Problem: When reading the revision diff, mostly it is hard to understand, which part of the page the diff line belongs to, because line number does not help so much - there is no line numbering in view mode.
- Who would benefit: Everyone who opens page diffs.
- Proposed solution: Regularly the differ does not show the changed line only, but also a line before and a line after, with no changes. I propose to show also the line with the most bottom subsection name the changed line belongs to, on both sides, as is, with equality signs. It's just one more line, but it will help to know exactly where you are. If there are many changes in the same subsection, the name will show only once, of course. This way the diff will be just a little longer - because section names are always shorter than regular lines and take less vertical space, but much more useful. Now we should copy all the time some part of changed line and search it using the browser searching mechanism.
- More comments: There are two possibilities for using this feature - articles and talk pages, including forums as village pump, and it will help in both.
- Phabricator tickets: T231698
- Proposer: IKhitron (talk) 19:29, 29 October 2018 (UTC)
Discussion
- I like it. It can be a possibility to infer the section automatically or in case the user is editing a section already infer a better section if there is one that's deeper than the one that's being edited. Dixtosa (talk) 11:41, 30 October 2018 (UTC)
- Agreed, If there is any value to line numbers it escapes me. This would be useful · · · Peter (Southwood) (talk): 11:48, 30 October 2018 (UTC)
- Maybe changing UI it's a better way. — The preceding unsigned comment was added by Talueses (talk)
- Maybe indeed, but as the change is smaller, it has more chances to be implemented. IKhitron (talk) 21:08, 31 October 2018 (UTC)
- I like this solution, it gives more context. — Jeff G. ツ please ping or talk to me 03:03, 11 November 2018 (UTC)
- IKhitron, would this be implemented instead of line numbers, or in addition to them? I support this solution, but I think line numbers should be kept as well, for they are very useful on CSS and JavaScript files' diffs. Guycn2 · ☎ 05:55, 17 November 2018 (UTC)
- Line numbers besides 1-3 have no value, there is no real connection between them and the place in the article, if there are infoboxes, galleries and such in the article, or even lines, that are connected into one paragraph without any indication in the text. Something that can really be seen in the article would be very helpful. I'd say: instead, but if someone sees any value in line numbers (I can't come up with a reason now), you can as well leave those. Grüße vom Sänger ♫(Reden) 11:24, 17 November 2018 (UTC)
- Hi, Guy. I really do not care. I can thing about another need of numbers - for example, if you see in diff lines 351 and 353 you can guess they are close. But it isn't so important, and isn't part of this proposal. IKhitron (talk) 14:40, 17 November 2018 (UTC)
- Line numbers besides 1-3 have no value, there is no real connection between them and the place in the article, if there are infoboxes, galleries and such in the article, or even lines, that are connected into one paragraph without any indication in the text. Something that can really be seen in the article would be very helpful. I'd say: instead, but if someone sees any value in line numbers (I can't come up with a reason now), you can as well leave those. Grüße vom Sänger ♫(Reden) 11:24, 17 November 2018 (UTC)
- Regarding the UI, I would suggest taking inspiration from the functionality (but not the formatting) for displaying context in source code diffs formatted as standard GNU diffutils patches (which is also the Git diff format). There, the context (function heading) is displayed along with the affected line numbers at the start of each chunk. Here's an example:
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index 4788590..cb94c64 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -585,18 +585,45 @@ gtk_menu_shell_button_press (GtkWidget *widget, if (!menu_shell->active || !menu_shell->button) { - _gtk_menu_shell_activate (menu_shell); + gboolean initially_active = menu_shell->active; diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 58ce2db..921c22a 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -2443,6 +2443,13 @@ gtk_widget_class_init (GtkWidgetClass *klass) 0.0, 1.0, 0.04, GTK_PARAM_READABLE)); + gtk_widget_class_install_style_property (klass, + g_param_spec_boolean ("window-dragging",
- In the sample above, the first chunk:
@@ -585,18 +585,45 @@ gtk_menu_shell_button_press (GtkWidget *widget,
- modifies 18 lines of the
gtk_menu_shell_button_press()
function, starting at line 585, and the result is 45 lines long starting at line 585 in the output file. (I've trimmed the diff length so those counts aren't accurate.) The detailed line numbering would be overkill for us, but the function heading represents the equivalent context to our section headings. - So instead of adding the section line into to the diff output (when it may be pretty far from the chunk being displayed), and rather than replacing the line numbers, I suggest the section title be shown following the line number at each diff chunk, even where it's redundant with the previous chunk(s). (If it's on the same line as the line#, it's not taking up any extra space anyway.) My edit here might be preceded with
- Line 22: ===Discussion===
- in the diff view. -- FeRDNYC (talk) 15:51, 17 November 2018 (UTC)
- I still don't get it, what this line numbers are good for at all, except in some very special outliers like .css or .js pages. Nobody can see and follow them in any article that if bigger then a stub. Grüße vom Sänger ♫(Reden) 17:39, 17 November 2018 (UTC)
- One can use CSS to completely remove the line numbers, but this unfortunately no longer clearly separates updates to different parts of the page. To do this
- Go to Special:Preferences, tab Appearance.
- Choose one of the Custom CSS links, which will be red if you have not yet used it, and create / edit that sub-page of your user-page.
- Add
.diff-lineno { display: none; }
.
- PJTraill (talk) 11:41, 27 November 2018 (UTC)
- If this really is an answer to me: Lines are quite useless on every page besides the very few .js and .css pages, where they might stay. But no indication at all where this diff is in the article is even worse. So as log as there is no appropriate solution, I'll stick to the numbers, very little use but better than nothing at all. Grüße vom Sänger ♫(Reden) 12:09, 30 November 2018 (UTC)
- One can use CSS to completely remove the line numbers, but this unfortunately no longer clearly separates updates to different parts of the page. To do this
- I still don't get it, what this line numbers are good for at all, except in some very special outliers like .css or .js pages. Nobody can see and follow them in any article that if bigger then a stub. Grüße vom Sänger ♫(Reden) 17:39, 17 November 2018 (UTC)
- Hello, Dixtosa, Peter (Southwood) and Guycn2. Please let me remind you that you expressed an opinion about the proposal in the discussion section, but still did not vote. If you still have on opinion, I'll be glad if you add it in the voting section, by support or oppose templates, depends on what do you think now. Thank you. IKhitron (talk) 19:40, 27 November 2018 (UTC)
- Done. Guycn2 · ☎ 12:24, 29 November 2018 (UTC)
Voting
- Support SEMMENDINGER (talk) 19:19, 16 November 2018 (UTC)
- Support James Martindale (talk) 19:33, 16 November 2018 (UTC)
- Support Dovno (talk) 19:36, 16 November 2018 (UTC)
- Support Fiipchip (talk) 03:43, 17 November 2018 (UTC)
- Support Mahir256 (talk) 06:19, 17 November 2018 (UTC)
- Support Xiplus (talk) 07:52, 17 November 2018 (UTC)
- Support Liuxinyu970226 (talk) 08:07, 17 November 2018 (UTC)
- Support Dodi123 (talk) 08:44, 17 November 2018 (UTC)
- Support Gnangarra (talk) 09:24, 17 November 2018 (UTC)
- Support Лапоть (talk) 10:14, 17 November 2018 (UTC)
- Support Libcub (talk) 10:38, 17 November 2018 (UTC)
- Support ‐‐1997kB (talk) 11:11, 17 November 2018 (UTC)
- Support --Grüße vom Sänger ♫(Reden) 11:24, 17 November 2018 (UTC)
- Support ديفيد عادل وهبة خليل 2 (talk) 13:14, 17 November 2018 (UTC)
- Support Dolotta (talk) 13:39, 17 November 2018 (UTC)
- Support Sakretsu (talk) 14:41, 17 November 2018 (UTC)
- Support FeRDNYC (talk) 15:12, 17 November 2018 (UTC)
- Support Atsme📞📧 16:08, 17 November 2018 (UTC)
- Support PamD (talk) 18:37, 17 November 2018 (UTC)
- Support —Thanks for the fish! talk•contribs 20:11, 17 November 2018 (UTC)
- Support JAn Dudík (talk) 20:17, 17 November 2018 (UTC)
- Support Megatherium (talk) 20:36, 17 November 2018 (UTC)
- Support Great proposition! SshibumXZ (talk) 20:58, 17 November 2018 (UTC)
- Support --Hadibe (talk) 22:25, 17 November 2018 (UTC)
- Support Tim Landscheidt (talk) 03:08, 18 November 2018 (UTC)
- Support Galobtter (talk) 06:51, 18 November 2018 (UTC)
- Support Szalax (talk) 09:22, 18 November 2018 (UTC)
- Support Jules78120 (talk) 10:10, 18 November 2018 (UTC)
- Support NMaia (talk) 10:30, 18 November 2018 (UTC)
- Support Eddie891 (talk) 12:33, 18 November 2018 (UTC)
- Support ~ Amory (u • t • c) 12:35, 18 November 2018 (UTC)
- Support Hydriz (talk) 14:09, 18 November 2018 (UTC)
- Support Timeshifter (talk) 15:13, 18 November 2018 (UTC)
- Support stwalkerster (talk) 17:19, 18 November 2018 (UTC)
- Support Bruce1ee (talk) 17:45, 18 November 2018 (UTC)
- Support — Draceane talkcontrib. 18:08, 18 November 2018 (UTC)
- Support Ankry (talk) 23:32, 18 November 2018 (UTC)
- Support —TheDJ (talk • contribs) 10:58, 19 November 2018 (UTC)
- Support β16 - (talk) 11:00, 19 November 2018 (UTC)
- Support Ahecht (TALK
PAGE) 16:33, 19 November 2018 (UTC) - Support Sadads (talk) 18:51, 19 November 2018 (UTC)
- Support - tucoxn\talk 18:54, 19 November 2018 (UTC)
- Support good idea Doc James (talk · contribs · email) 04:14, 20 November 2018 (UTC)
- Support Iridescent (talk) 10:07, 20 November 2018 (UTC)
- Support This's too good of a proposal. Winged Blades of Godric (talk) 10:44, 20 November 2018 (UTC)
- Support Gareth (talk) 11:44, 20 November 2018 (UTC)
- Support –Ejs-80 12:17, 20 November 2018 (UTC)
- Support Philk84 (talk) 14:05, 20 November 2018 (UTC)
- Support Headbomb (talk) 16:01, 20 November 2018 (UTC)
- Support Lofhi (talk) 17:58, 20 November 2018 (UTC)
- Support eranroz (talk) 22:28, 20 November 2018 (UTC)
- Support Novak Watchmen (talk) 00:28, 21 November 2018 (UTC)
- Support Onel5969 TT me 10:48, 21 November 2018 (UTC)
- Support Conny (talk) 15:13, 21 November 2018 (UTC)
- Support Definitely; plus more detail comparison of of the *output* of execution of so many formatting commands ; is very much required. RIT RAJARSHI (talk) 19:30, 21 November 2018 (UTC)
- Support Nihlus 22:24, 21 November 2018 (UTC)
- Support Gulumeemee (talk) 09:37, 22 November 2018 (UTC)
- Support Edoli (talk) 10:38, 22 November 2018 (UTC)
- Support Jack who built the house (talk) 11:46, 22 November 2018 (UTC)
- Support. — Jeff G. ツ please ping or talk to me 12:51, 22 November 2018 (UTC)
- Support Sebari – aka Srittau (talk) 19:59, 22 November 2018 (UTC)
- Support DannyS712 (talk) 20:09, 22 November 2018 (UTC)
- Support melo kol (talk) 20:33, 22 November 2018 (UTC)
- Support Wargo (talk) 23:08, 22 November 2018 (UTC)
- Support Siddhant (talk) 01:11, 23 November 2018 (UTC)
- Support התו השמיני (talk) 07:27, 23 November 2018 (UTC)
- Support WeegaweeK ❀ t c 08:32, 24 November 2018 (UTC)
- Support Matěj Suchánek (talk) 08:59, 24 November 2018 (UTC)
- Support Hmxhmx 11:02, 24 November 2018 (UTC)
- Support Uanfala (talk) 20:03, 24 November 2018 (UTC)
- Support Alexei Kopylov (talk) 20:11, 24 November 2018 (UTC)
- Support ~ Seb35 [^_^] 22:33, 24 November 2018 (UTC)
- Support Arbnos (talk) 23:36, 24 November 2018 (UTC)
- Support — HELLKNOWZ ▎TALK ▎enWiki 23:43, 24 November 2018 (UTC)
- Support BrownHairedGirl (talk) 01:32, 25 November 2018 (UTC)
- Support - yona B. (D) 07:35, 25 November 2018 (UTC)
- Support Arne (Amjaabc) (talk) 08:52, 25 November 2018 (UTC)
- Support — AfroThundr (u · t · c) 02:05, 26 November 2018 (UTC)
- Support Ckoerner (talk) 15:54, 26 November 2018 (UTC)
- Support Ed g2s (talk) 18:52, 26 November 2018 (UTC)
- Support Liadmalone (talk) 20:55, 26 November 2018 (UTC)
- Support And drop the line numbers, or make it possible to hide them with e.g. CSS. PJTraill (talk) 23:26, 26 November 2018 (UTC)
- @PJTraill: This is already possible; source yields
<td colspan="2" class="diff-lineno">Line 140:</td>
. --Izno (talk) 00:45, 27 November 2018 (UTC)- @Izno: OK, thanks, Should have looked, but worth noting; added to discussion. PJTraill (talk) 11:17, 27 November 2018 (UTC)
- @PJTraill: This is already possible; source yields
- Support --Izno (talk) 00:44, 27 November 2018 (UTC)
- Support Amir E. Aharoni (talk) 09:18, 27 November 2018 (UTC)
- Support Abeona (talk) 12:01, 27 November 2018 (UTC)
- Support Dvorapa (talk) 13:28, 27 November 2018 (UTC)
- Support Framawiki (talk) 18:49, 27 November 2018 (UTC)
- Support · · · Peter (Southwood) (talk): 05:59, 28 November 2018 (UTC)
- Support Risker (talk) 07:23, 28 November 2018 (UTC)
- Support WhatamIdoing (talk) 19:40, 28 November 2018 (UTC)
- Support But line numbers should be kept, as they are useful for CSS and JavaScript pages. Guycn2 · ☎ 12:24, 29 November 2018 (UTC)
- Support Useful indeed, especially for edits in complex codes like tables. Numbering lines in source editor can be an alternative — NickK (talk) 16:41, 29 November 2018 (UTC)
- Support Ghilt (talk) 18:44, 29 November 2018 (UTC)
- Support GravityUp (talk) 22:42, 29 November 2018 (UTC)
- Support NicoScribe (talk) 11:26, 30 November 2018 (UTC)