Edgewall Software

Ticket #3263 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

Timeline should show link to diff of wiki page changes

Reported by: Simon Willison Owned by: jonas
Priority: normal Milestone: 0.10
Component: timeline Version: 0.9.5
Severity: minor Keywords:
Cc:

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

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

Change History

Changed 2 years ago by cboos

  • status changed from new to closed
  • resolution set to duplicate

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.

Changed 2 years ago by Simon Willison

  • status changed from closed to reopened
  • resolution duplicate deleted

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)

Changed 2 years ago by cboos

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.

Changed 2 years ago by cboos

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

Changed 2 years ago by cboos

  • keywords review added
  • severity changed from normal to minor
  • milestone set to 0.10

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.

Changed 2 years ago by cmlenz

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)

Changed 2 years ago by cboos

Updated patch, using Markup instead of Fragment.

Changed 2 years ago by cboos

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

Changed 2 years ago by cboos

  • 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.

Changed 2 years ago by cboos

  • status changed from reopened to closed
  • resolution set to fixed

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.

Add/Change #3263 (Timeline should show link to diff of wiki page changes)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.