Ticket #510 (closed enhancement: fixed)
Opened 8 years ago
Last modified 5 years ago
In-line diff option
| Reported by: | jamesm@… | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.8 |
| Component: | version control/changeset view | Version: | 0.7.1 |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API 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
Change History
comment:1 Changed 8 years ago by jamesm@…
- Summary changed from In-line diff instead of current side-by-side diff to In-line diff option
Changed 8 years ago by jamesm@…
- Attachment changeset.cs.diff added
Patch for changeset.cs to display side-by-side or inline diff
Changed 8 years ago by jamesm@…
- Attachment macros.cs.diff added
Patch for macros.cs defining the inline html construct
Changed 8 years ago by jamesm@…
- Attachment Changeset.py.diff added
Patch for changeset.py for passing diff.inline parameter to changeset.cs
comment:2 Changed 8 years ago by jamesm@…
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 Changed 8 years ago by jamesm@…
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 Changed 8 years ago by jamesm@…
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>
Changed 8 years ago by jamesm@…
- 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
Changed 8 years ago by jamesm@…
- Attachment changeset.cs.diff2 added
USE INSTEAD: Patch revision to changeset.cs - add link to override Trac default diff setting
comment:5 Changed 8 years ago by jamesm@…
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 Changed 8 years ago by jamesm@…
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 Changed 8 years ago by cmlenz
- Owner changed from jonas to cmlenz
- Status changed from new to assigned
comment:8 Changed 8 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
Implemented in [757].



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.