Edgewall Software
Modify

Opened 18 years ago

Closed 18 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:

15:48 SandBox edited by anonymous (diff)

Attachments (2)

wiki_timeline_event_diff_link-r3412.patch (2.3 KB ) - added by Christian Boos 18 years ago.
Implements (diff) links, added after the change comment.
wiki_timeline_event_diff_link-r3417.patch (1.9 KB ) - added by Christian Boos 18 years ago.
Updated patch, using Markup instead of Fragment.

Download all attachments as: .zip

Change History (10)

comment:1 by Christian Boos, 18 years ago

Resolution: duplicate
Status: newclosed

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.

comment:2 by Simon Willison, 18 years ago

Resolution: duplicate
Status: closedreopened

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 Christian Boos, 18 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 Christian Boos, 18 years ago

Implements (diff) links, added after the change comment.

comment:4 by Christian Boos, 18 years ago

Keywords: review added
Milestone: 0.10
Severity: normalminor

Here's what I think could be done:

  1. attachment:wiki_timeline_event_diff_link-r3412.patch for now,
  2. 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 Christopher Lenz, 18 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 Christian Boos, 18 years ago

Updated patch, using Markup instead of Fragment.

comment:6 by Christian Boos, 18 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 Christian Boos, 18 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 Christian Boos, 18 years ago

Resolution: fixed
Status: reopenedclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström 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.