#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 )
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)
Change History (7)
comment:1 Changed 6 years ago by
Description: | modified (diff) |
---|
Changed 6 years ago by
Attachment: | 20181116_WikiAutoCompletePlugin.patch added |
---|
comment:2 Changed 6 years ago by
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
This patch will make the SQL query 100 instead 10 tickets.