Opened 19 years ago
Closed 19 years ago
#3263 closed enhancement (fixed)
Timeline should show link to diff of wiki page changes
Reported by: | Simon Willison | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | 0.10 |
Component: | timeline | Version: | 0.9.5 |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When a wiki page has been changed, it's very useful to go to the page history for that page and view the diff between the current and previous versions. It would be great if the Trac timeline linked directly to this diff - not from the main link itself, but from an additional diff link listed with the timeline entry. Something a bit like this:
Attachments (2)
Change History (10)
comment:1 by , 19 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:2 by , 19 years ago
Resolution: | duplicate |
---|---|
Status: | closed → reopened |
Having looked over the code that deals with timeline events, it seems that it's not possible to include an extra link in the title. However, it should be possible to include the link in the comment field, producing something that looks like this:
- 16:44 SandBox edited by anonymous
- removed spam (diff)
comment:3 by , 19 years ago
OK, that would be possible.
However, wouldn't it be better to actually always jump to the diff page, unless it's a created page? From there, its to jump to the latest version and, soon, the travel to the previous/next changes (see #3250).
In the future, the Wiki diff page could even show the changes inline, in the produced HTML.
by , 19 years ago
Attachment: | wiki_timeline_event_diff_link-r3412.patch added |
---|
Implements (diff) links, added after the change comment.
comment:4 by , 19 years ago
Keywords: | review added |
---|---|
Milestone: | → 0.10 |
Severity: | normal → minor |
Here's what I think could be done:
- attachment:wiki_timeline_event_diff_link-r3412.patch for now,
- when/if we have the ability to render wiki page to HTML, with highlighted diffs (i.e. <INS> and <DEL> tags) remove the diff link and directly redirect to the full page with those highlighted diffs.
Tentatively scheduling for 0.10, if 1. is accepted.
comment:5 by , 19 years ago
I don't like the direct use of the Fragment
class in that patch. Wouldn't something like the following work (not tested):
if version > 1: diff_link = html.A('diff', href=href.wiki( name, action='diff', version=version, old_version=version-1)) comment = Markup('%s (%s)', comment, diff_link)
by , 19 years ago
Attachment: | wiki_timeline_event_diff_link-r3417.patch added |
---|
Updated patch, using Markup instead of Fragment.
comment:6 by , 19 years ago
Well, no, that wouldn't work right now, as the Element gets first converted to an unicode string, then gets escaped. But of course, we could change that, and leave the Element untouched, as we would do for Markup objects, which makes sense IMO.
Updated patch attachment:wiki_timeline_event_diff_link-r3417.patch
comment:7 by , 19 years ago
Keywords: | review removed |
---|
Maybe this feature is not so useful anymore, as there's now the Last Change link in the navigation links of the wiki page.
Please try out and tell me if you think the (diff) link would still be needed.
comment:8 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Well, after some more thought on this, I still think it's useful.
E.g. if I notice that the TracFaq page has been modified on p.e.c, I don't really want to see it in full, rather I'm only interested to see what has changed.
So even now with the Last Change link on the Wiki view page, a quick (diff) link in the timeline has still its use for by-passing a (sometimes long) rendering phase of the Wiki page.
Therefore, I implemented this in r3482.
The timeline entry is itself a link, so it's not possible to have a sublink. The suggestion to link to the diff was actually already made in #239.