Edgewall Software
Modify

Opened 20 years ago

Closed 20 years ago

Last modified 8 years ago

#510 closed enhancement (fixed)

In-line diff option

Reported by: jamesm@… Owned by: Christopher Lenz
Priority: normal Milestone: 0.8
Component: version control/changeset view Version: 0.7.1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The side-by-side diff view seems to display with variable width and because of display width limitations lines of code get wrapped. Both of these make it difficult to identify the diff.
Perhaps instead of a side-by-side diff there should be an in-line diff so that the diff can span the full width of the browser window. This should eliminate the inconsistent diff-box width and it will also minimize text wrapping.

Attachments (5)

changeset.cs.diff (1.0 KB ) - added by jamesm@… 20 years ago.
Patch for changeset.cs to display side-by-side or inline diff
macros.cs.diff (930 bytes ) - added by jamesm@… 20 years ago.
Patch for macros.cs defining the inline html construct
Changeset.py.diff (522 bytes ) - added by jamesm@… 20 years ago.
Patch for changeset.py for passing diff.inline parameter to changeset.cs
changeset.py.diff2 (1.1 KB ) - added by jamesm@… 20 years ago.
USE INSTEAD: Patch revision to changeset.py - add in url parsing (?inline=on or ?sidebyside=on) to define diff type to override Trac default diff setting
changeset.cs.diff2 (1.7 KB ) - added by jamesm@… 20 years ago.
USE INSTEAD: Patch revision to changeset.cs - add link to override Trac default diff setting

Download all attachments as: .zip

Change History (13)

comment:1 by jamesm@…, 20 years ago

Summary: In-line diff instead of current side-by-side diffIn-line diff option

After thinking some more about it perhaps it would be nicer to have a button on the diff sections for switching each section to side-by-side or inline. That may be complicated, don't know.

by jamesm@…, 20 years ago

Attachment: changeset.cs.diff added

Patch for changeset.cs to display side-by-side or inline diff

by jamesm@…, 20 years ago

Attachment: macros.cs.diff added

Patch for macros.cs defining the inline html construct

by jamesm@…, 20 years ago

Attachment: Changeset.py.diff added

Patch for changeset.py for passing diff.inline parameter to changeset.cs

comment:2 by jamesm@…, 20 years ago

First round patches (attached above) do not offer button per file for switching between side-by-side and inline. Still thinking about that one. However, the above patches provide inline diff functionality by specifying a new section and key in trac.ini

[diff]
inline = true

If the diff section does not exist, the displayed diff will default to side-by-side.

comment:3 by jamesm@…, 20 years ago

I also recommend changing the side-by-side diff to this:

-          <tr><td class="diff-line">line <?cs var:change.line.old ?></td>
-          <td class="diff-line">line <?cs var:change.line.new ?></td></tr>
+          <tr><td class="diff-line">Base version line <?cs var:change.line.old ?></td>
+          <td class="diff-line">Changed version line <?cs var:change.line.new ?></td></tr>}}}

comment:4 by jamesm@…, 20 years ago

Hmmm… the triple braces ate my text.. lets try again

- <tr><td class="diff-line">line <?cs var:change.line.old ?></td>
- <td class="diff-line">line <?cs var:change.line.new ?></td></tr>
+ <tr><td class="diff-line">Base version line <?cs var:change.line.old ?></td>
+ <td class="diff-line">Changed version line <?cs var:change.line.new ?></td></tr>

by jamesm@…, 20 years ago

Attachment: changeset.py.diff2 added

USE INSTEAD: Patch revision to changeset.py - add in url parsing (?inline=on or ?sidebyside=on) to define diff type to override Trac default diff setting

by jamesm@…, 20 years ago

Attachment: changeset.cs.diff2 added

USE INSTEAD: Patch revision to changeset.cs - add link to override Trac default diff setting

comment:5 by jamesm@…, 20 years ago

Second round patches now display a link on the changeset page which allows the user to override the default diff style for the current page.

comment:6 by jamesm@…, 20 years ago

Oh yeah… patch 2 has some hand-fixed html code in the diff changeset.cs. I am not savvy enough with css and I currently don't have access to more browsers than IE6 and Firefox to verify proper layout. Actually, I couldn't get the link where I wanted it. I figure one of you guys would modify the layout anyway.

comment:7 by Christopher Lenz, 20 years ago

Owner: changed from Jonas Borgström to Christopher Lenz
Status: newassigned

comment:8 by Christopher Lenz, 20 years ago

Resolution: fixed
Status: assignedclosed

Implemented in [757].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.