You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/models
Giteabot a014d071e4
Rework suggestion backend (#33538) (#33546)
Backport #33538 by @lunny

Fix #33522 

The suggestion backend logic now is

- If the keyword is empty, returned the latest 5 issues/prs with index
desc order
- If the keyword is digital, find all issues/prs which `index` has a
prefix with that, with index asc order
- If the keyword is non-digital or if the queried records less than 5,
searching issues/prs title with a `like`, with index desc order

## Empty keyword
<img width="310" alt="image"
src="https://github.com/user-attachments/assets/1912c634-0d98-4eeb-8542-d54240901f77"
/>

## Digital
<img width="479" alt="image"
src="https://github.com/user-attachments/assets/0356a936-7110-4a24-b21e-7400201bf9b8"
/>

## Digital and title contains the digital
<img width="363" alt="image"
src="https://github.com/user-attachments/assets/6e12f908-28fe-48de-8ccc-09cbeab024d4"
/>

## non-Digital
<img width="435" alt="image"
src="https://github.com/user-attachments/assets/2722bb53-baa2-4d67-a224-522a65f73856"
/>
<img width="477" alt="image"
src="https://github.com/user-attachments/assets/06708dd9-80d1-4a88-b32b-d29072dd1ba6"
/>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 weeks ago
..
actions Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946) (#32964) 2 months ago
activities Add missed auto merge feed message on dashboard (#33309) (#33405) 4 weeks ago
admin Fix javascript error when an anonymous user visiting migration page (#32144) 5 months ago
asymkey Use ProtonMail/go-crypto to replace keybase/go-crypto (#33402) (#33410) 4 weeks ago
auth Enable tenv and testifylint rules (#32852) 2 months ago
avatars Replace 10 more gt- classes with tw- (#29945) 11 months ago
db Enable tenv and testifylint rules (#32852) 2 months ago
dbfs Enable `unparam` linter (#31277) 9 months ago
fixtures Refactor testfixtures (#33028) 2 months ago
git Improve sync fork behavior (#33319) (#33332) 1 month ago
issues Rework suggestion backend (#33538) (#33546) 2 weeks ago
migrations Enable tenv and testifylint rules (#32852) 2 months ago
organization Enable tenv and testifylint rules (#32852) 2 months ago
packages Refactor maven package registry (#33049) (#33057) 2 months ago
perm Enable tenv and testifylint rules (#32852) 2 months ago
project Use project's redirect url instead of composing url (#33058) (#33064) 2 months ago
pull Add support for sha256 repositories (#23894) 1 year ago
renderhelper Refactor render system (orgmode) (#32671) 3 months ago
repo Fix missing license when sync mirror (#33255) (#33258) 1 month ago
secret Clarify Actions resources ownership (#31724) 7 months ago
shared/types Refactor locale&string&template related code (#29165) 1 year ago
system Refactor deletion (#28610) 1 year ago
unit Add `DEFAULT_MIRROR_REPO_UNITS` and `DEFAULT_TEMPLATE_REPO_UNITS` options (#32416) 3 months ago
unittest Refactor testfixtures (#33028) 2 months ago
user Fix user avatar (#33439) 3 weeks ago
webhook Add tests for webhook and fix some webhook bugs (#33396) (#33442) 3 weeks ago
error.go Add merge style `fast-forward-only` (#28954) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
repo.go Fix issue comment number (#30556) (#33055) 2 months ago
repo_test.go Fix issue comment number (#30556) (#33055) 2 months ago
repo_transfer.go chore: use errors.New to replace fmt.Errorf with no parameters will much better (#30621) 10 months ago