gitea icon indicating copy to clipboard operation
gitea copied to clipboard

Add issue filter for Author

Open parnic opened this issue 3 years ago • 4 comments
trafficstars

This adds a new filter option on the issues and pulls pages to filter by the author/poster/creator of the issue or PR.

Fixes #9408

parnic avatar Aug 01 '22 01:08 parnic

image image

Our group really wanted the ability to filter issues/PRs by author, so I added the feature for us. I am not sure if this is something that the Gitea authors would also like to add, so I figured I'd open the PR in its current state and see if there's any feedback for it. If it's not desired, I am happy to close it, but since it's useful for us I thought it might be useful for others. This list of filters is getting crowded now, though. 😄

edit: looks like this has been attempted once before, a few years ago: #9432

parnic avatar Aug 01 '22 01:08 parnic

image

Dropdown seems cut off in the screenshot, or at least it's missing padding. Can you check if usage is same as other dropdowns and there is no CSS interference?

silverwind avatar Aug 03 '22 20:08 silverwind

image

Dropdown seems cut off in the screenshot, or at least it's missing padding. Can you check if usage is same as other dropdowns and there is no CSS interference?

I agree it looks cut off. The CSS and HTML for this is identical to the Assignee menu next to it, so I'll show how Assignee looks below.

That ^ screenshot was from my dev environment on Windows where I never quite got the frontend build process fully ironed out. In our production environment where I'm running this feature, compiled correctly on Linux, all of these menus have horizontal scrollbars because of some CSS (.ui.menu .dropdown.item .menu) restricting the min-width to calc(100% - 1px). Heavily redacted screenshot:

image

If I disable the min-width everything looks better but it causes other issues, especially on mobile:

image

This felt out of scope for this particular change, so I left it alone.

edit: here's what try.gitea.io looks like https://try.gitea.io/parnic/submodule-replace-test/pulls: image

parnic avatar Aug 03 '22 21:08 parnic

No problem if other dropdowns are affected as well. IIRC, there's some CSS hacks abound there, definitely partly broken currently.

silverwind avatar Aug 03 '22 22:08 silverwind

No problem if other dropdowns are affected as well. IIRC, there's some CSS hacks abound there, definitely partly broken currently.

Yeah I'm not going to approve this PR until that's fixed. As it now just overflows always.

So quick look at the CSS and there's a selector from semantic .ui.menu .dropdown.item .menu which adds:

min-width: calc(100% - 1px)

which for some absurd reason is actually causing that the width has a max value. I'm not so sure why there's a min-width there as removing it will actually result in the correct width being applied. Seems trivial to add a min-width: unset or something similar to these dropdowns.

Gusted avatar Aug 06 '22 19:08 Gusted

No problem if other dropdowns are affected as well. IIRC, there's some CSS hacks abound there, definitely partly broken currently.

Yeah I'm not going to approve this PR until that's fixed. As it now just overflows always.

So quick look at the CSS and there's a selector from semantic .ui.menu .dropdown.item .menu which adds:

min-width: calc(100% - 1px)

which for some absurd reason is actually causing that the width has a max value. I'm not so sure why there's a min-width there as removing it will actually result in the correct width being applied. Seems trivial to add a min-width: unset or something similar to these dropdowns.

Shouldn't fixing this be a separate PR? The Assignee menu looks the same right now: https://try.gitea.io/parnic/submodule-replace-test/pulls

parnic avatar Aug 06 '22 20:08 parnic

Shouldn't fixing this be a separate PR?

Fine either way, could also be more backported 🤷🏽

Gusted avatar Aug 06 '22 20:08 Gusted

The UX for "user dropdown" is bad in general ... we should return only reasend 10one and add a filter by username ...

Github did switched to something similar ... (This suggestion will affect a lot of ui elements ... so its outside of this pull scope)

6543 avatar Aug 07 '22 18:08 6543

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@be82489). Click here to learn what that means. The diff coverage is 76.47%.

@@           Coverage Diff           @@
##             main   #20578   +/-   ##
=======================================
  Coverage        ?   46.81%           
=======================================
  Files           ?      981           
  Lines           ?   136229           
  Branches        ?        0           
=======================================
  Hits            ?    63775           
  Misses          ?    64618           
  Partials        ?     7836           
Impacted Files Coverage Δ
routers/web/repo/issue.go 36.74% <50.00%> (ø)
models/repo/user_repo.go 62.12% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.

codecov-commenter avatar Aug 07 '22 18:08 codecov-commenter