-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Filter for default-branch selection #29388
Conversation
<div class="ui dropdown custom gt-w-full gt-h-full"> | ||
<button type="button" class="branch-dropdown-button gt-ellipsis ui basic small compact button gt-df gt-sb gt-m-0 gt-w-full gt-h-full" @click="menuVisible = !menuVisible" @keyup.enter="menuVisible = !menuVisible"> | ||
<span class="text gt-df gt-ac gt-mr-2 gt-ellipsis"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, I am not a fan of filling these fine-tuning helpers everywhere.
Personally I have no motivation to approve .... but I won't block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then what's the point of having helper-classes?
Or do you have another idea to Do it better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some opinions in my mind:
- What's the purpose of using CSS file and CSS classes? If the helpers should be used everywhere, then why there are CSS classes like ".my-button". Using one or two helpers to fine-tune something seems good, but using 5-7 helpers seems to be quite hacky IMO.
- Should it encourage to write reusable code? If the same helpers are written for more than one time, then why not introducing a clearly defined CSS class for it.
There is a long argument in the frontend development, some people really like using helpers as much as possible, but I really dislike abusing them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see your point, but there are ups and downs to each approach.
Because its a vue-component I like the helper-classes more then normal css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still new classes has prefix gt-
introduced. Could you replace them with tailwind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it's better to use plain javascript instead of jquery because we are removing jquery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind the old classes, it keeps the diff minimal and they will later be replaced in a find-replace action anyways. But if you can, use new classes because otherwise we might run into conflicts with the refactoring PRs.
jQuery removal in this PR is also not needed or wanted as it would better be done in a whole-file rewrite later.
Maybe it could also use a searchable dropdown, e.g. search box directly in the element: https://fomantic-ui.com/modules/dropdown.html#search-selection PS: I don't think branch creation from that dropdown is really intuitive, so I would remove that. |
The vue-component is also to select tags so a simple dropdown is not suiteable |
Can we disable branch creation in that dropdown when in this place? I find it an odd place to create a branch, but I guess I won't block on it. |
Overall, it seems we are trying to shoehorn the branch dropdown into something it's not meant to be used for. I think just allowing the current dropdown to filter is easier and likely a 1-line change (unless we are missing CSS for this style of dropdown) to achieve the same: https://fomantic-ui.com/modules/dropdown.html#search-selection There is similar dropdown already on the commit graphs page, except it's multi-selection: https://try.gitea.io/silverwind/symlink-test/graph Generally I'm all for removing dependencies on fomantic components where possible so we can migrate off of it eventually, so maybe the current approach can be made to work, but it won't be easy as the dropdown was designed for a different use case. |
Except the css/js framework problem. LGTM |
df44382
to
ca230a9
Compare
* giteaofficial/main: Filter for default-branch selection (go-gitea#29388) Fixing the issue when status check per rule matches multiple actions (go-gitea#29631) Fix 500 when deleting account with incorrect password or unsupported login type (go-gitea#29579) Partially enable MSSQL case-sensitive collation support (go-gitea#29238)
Filter for default-branch selection (fixes #4751)
before:
after: