Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong issue suggested and selected when copy-pasting ID #33522

Closed
bartvdbraak opened this issue Feb 6, 2025 · 4 comments · Fixed by #33538
Closed

Wrong issue suggested and selected when copy-pasting ID #33522

bartvdbraak opened this issue Feb 6, 2025 · 4 comments · Fixed by #33538
Assignees
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI type/bug
Milestone

Comments

@bartvdbraak
Copy link

Description

If we paste in a report number, the "suggested reports" feature will pop up and suggest the wrong report.

Example:

  1. Go to a report
  2. In the text box for a comment type in # then paste in a report number you copied from a different report.
  3. Notice the "suggested reports" box pops up, suggested a report different from the one you just pasted,
  4. And if you press Enter, it will select it.

Gitea Version

1.23.1 built with GNU Make 4.4.1, go1.23.5 : bindata, timetzdata, sqlite, sqlite_unlock_notify

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

Gitea.wrong.suggestion.mp4

Git Version

2.47.2

Operating System

Ubuntu 24.04

How are you running Gitea?

Docker Compose with source of truth at https://github.com/blender/gitea

Database

PostgreSQL

@techknowlogick techknowlogick added topic/ui Change the appearance of the Gitea UI issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented labels Feb 6, 2025
@vignesh6645

This comment has been minimized.

@wxiaoguang

This comment has been minimized.

@lunny lunny self-assigned this Feb 9, 2025
@lunny
Copy link
Member

lunny commented Feb 9, 2025

I sent #33538 but found the keyword will search issues' title, content and comments' content. Maybe we can just search title.

@lunny
Copy link
Member

lunny commented Feb 9, 2025

Looks like for me, pasting content will not trigger list suggestiones.

lunny added a commit that referenced this issue Feb 10, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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: wxiaoguang <wxiaoguang@gmail.com>
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Feb 10, 2025
Fix go-gitea#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: wxiaoguang <wxiaoguang@gmail.com>
lunny added a commit that referenced this issue Feb 10, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
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>
@lunny lunny added this to the 1.23.4 milestone Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants