Modify

Opened 6 months ago

Closed 6 months ago

#13502 closed enhancement (fixed)

number of tickets it auto-complete list

Reported by: clemens Owned by: Peter Suter
Priority: normal Component: WikiAutoCompletePlugin
Severity: minor Keywords:
Cc: Trac Release: 1.2

Description (last modified by clemens)

Hello

I have a question about the WikiAutoCompletePlugin, which I like very much.

It looks like the plugin limits the count of proposed tickets (which appear in the auto-complete pop-up) to a number of 10 tickets. What is the motivation for this arbitrary limitation? Are there speed concerns?

Note that other items like files do not have a limitation. If too many are found, then a scroll bar appears. Why not for tickets?

In the plugin source code (function _suggest_ticket in web_ui.py) I can see that the SQL ticket query is limited to 10. Are there any concerns to set this to a higher values like 100?

I would be willing to submit a patch (an open a ticket on trac-hacks) after successfully testing it.

Thanks Clemens

Attachments (1)

20181116_WikiAutoCompletePlugin.patch (868 bytes) - added by clemens 6 months ago.
This patch will make the SQL query 100 instead 10 tickets.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 months ago by clemens

Description: modified (diff)

Changed 6 months ago by clemens

This patch will make the SQL query 100 instead 10 tickets.

comment:2 Changed 6 months ago by clemens

This is the patch: attachment:20181116_WikiAutoCompletePlugin.patch

Index: trunk/wikiautocomplete/web_ui.py
===================================================================
--- trunk/wikiautocomplete/web_ui.py    (Revision 17308)
+++ trunk/wikiautocomplete/web_ui.py    (Arbeitskopie)
@@ -223,12 +223,14 @@
                 SELECT id, summary FROM ticket
                 WHERE %(expr)s
                 ORDER BY changetime DESC
-                LIMIT 10
+                LIMIT 100
                 """ % {'expr': expr}, args)
         else:
             rows = self.env.db_query("""
                 SELECT id, summary FROM ticket
-                ORDER BY changetime DESC LIMIT 10""")
+                ORDER BY changetime DESC
+                LIMIT 100
+                """)
         return [{'value': row[0], 'title': row[1]}
                 for row in rows if 'TICKET_VIEW' in req.perm('ticket', row[0])]

I tested this with my repository and could not see any delay. I have to admit that my private test repository (based on SQLite database) has only approx. 500 tickets. Nevertheless, I do not expect any performance issue by increasing the number from 10 to 100. I believe 100 is a useful compromise and not "to much" for user to scroll and search manually.

Clemens

comment:3 Changed 6 months ago by Peter Suter

In 17311:

WikiAutoCompletePlugin: Show 100 tickets instead of only 10.
(see #13502)

comment:4 Changed 6 months ago by Peter Suter

Resolution: fixed
Status: newclosed

Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Suter.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.