next/previous ticket links after ticket query

17 views
Skip to first unread message

Clemens Feige

unread,
Sep 18, 2021, 2:19:57 PM9/18/21
to Trac Users
Hello

I came across an issue regarding those "previous / next ticket" links in
the navigation menu on top of ticket pages. I am wondering about the
"correct" logic in scope of ticket queries.

Normally mathematically "next ticket" should yield the current ticket
number + 1. However, in scope of ticket queries "next" yields the next
ticket in scope of the query result, where for example the next ticket
after #45 may be #41. In scope of this query logic Trac even offers a
"Back to Query" link.
So far so good.

But how can I stop this query sort logic and return to the ordinary
mathematical logic?

How can I make TRAC forget the ticket query?

How can I have "next" mean "+1" again?

Reproduce as follows:
- make a query for all tickets
- sort descending by ticket number
- enter any ticket number in the search field (quick search)
- in the ticket you will see that "next" is inverted (because the
descending sorted query is still active)

What do you think?
Have I misunderstood something?

Thanks
Clemens

RjOllos

unread,
Sep 21, 2021, 4:41:59 PM9/21/21
to Trac Users
Yeah, it appears that if a ticket is in the set of query results the prev/next navigation will be within the context of those results. I suppose you have to execute a new query to clear the context.

It's possible it might be better to only use the query context when the referring page was /query or when navigating via the prev/next. I think the query is stored in session data so it's probably fairly complicated with browser tabs.

Ryan 

Clemens Feige

unread,
Sep 22, 2021, 4:42:58 AM9/22/21
to trac-...@googlegroups.com
RjOllos wrote on 21.09.2021 at 22:41:
Understood. So my thinking is correct. (Eventually I understood how
those prev/next buttons work.)

For me it is not a big problem, I can live with it. I understand, that
possible "solutions" are not that easy. People may simply have to
understand and learn that "prev/next" applies to the query result list
and not (only) to pure mathematical numbering. (Although this can take
years like in my case.)

One approach could be to extend the navigation menu in case a query is
active:

"Previous Ticket" (pure math -1)
"Previous in Query" (NEW! only if query is active)
"Back to Query" (only if query is active)
"Clear Query" (NEW! only if query is active)
"Next in Query" (NEW! only if query is active)
"Next Ticket" (pure math +1)

However, I am not sure if this is good usability. Smells like
overengineering.

A totally different approach is to clear the query as soon as somebody
enters a direct ticket number into the search field (i.e. quick jump).
In this case we may assume that the user is not interested in the query
context anymore.


Clemens

Thomas Moschny

unread,
Sep 23, 2021, 3:19:56 AM9/23/21
to trac-...@googlegroups.com
Am Mi., 22. Sept. 2021 um 10:43 Uhr schrieb Clemens Feige
<c.f...@osypkamed.com>:

> A totally different approach is to clear the query as soon as somebody
> enters a direct ticket number into the search field (i.e. quick jump).
> In this case we may assume that the user is not interested in the query
> context anymore.

In my experiments with Trac 1.2.6 it worked exactly this way: entering
a hash + ticket number into the search field made the "Back to query"
link vanish and the "Previous ticket"/"Next ticket" links point to
ticket number -1/+1, respectively.

- Thomas

Clemens Feige

unread,
Sep 23, 2021, 3:37:26 AM9/23/21
to trac-...@googlegroups.com

Thomas Moschny wrote on 23.09.2021 at 09:19:
> Am Mi., 22. Sept. 2021 um 10:43 Uhr schrieb Clemens:
>
>> A totally different approach is to clear the query as soon as somebody
>> enters a direct ticket number into the search field (i.e. quick jump).
>> In this case we may assume that the user is not interested in the query
>> context anymore.
>
> In my experiments with Trac 1.2.6 it worked exactly this way: entering
> a hash + ticket number into the search field made the "Back to query"
> link vanish and the "Previous ticket"/"Next ticket" links point to
> ticket number -1/+1, respectively.
>
> - Thomas
>

Hello Thomas

No. We are running TRAC 1.4.3 but I also tested with TRAC 1.2.6 in the
Demo-Sandbox. The query context does NOT disappear when you enter a
quick jump into the search field. When making experiments, please make
sure to test with a ticket which is contained in the query result.

Example:

"All Tickets By Milestone"
https://trac.edgewall.org/demo-1.2/report/6?max=1000

Then enter #28 in the search field (i.e. quick jump). In ticket #28
clicking NEXT will bring you to #165.

Clemens

Thomas Moschny

unread,
Sep 23, 2021, 3:48:59 AM9/23/21
to trac-...@googlegroups.com
Am Do., 23. Sept. 2021 um 09:37 Uhr schrieb Clemens Feige
<c.f...@osypkamed.com>:
> The query context does NOT disappear when you enter a
> quick jump into the search field. When making experiments, please make
> sure to test with a ticket which is contained in the query result.

You are right, "Back to query" will reappear, together with changed
prev/next behavior when entering a ticket number that was in the
latest query. Not sure if this was originally intended as a
feature....

- Thomas
Reply all
Reply to author
Forward
0 new messages