1238 Commits

Author SHA1 Message Date
D
eda6d65818 markup: improve code block readability and isolate copy button (#34009)
Fix #33197

Improve the rendering of code blocks in markdown content 
for better readability and UI stability across screen sizes.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-19 05:53:39 +00:00
Kerwin Bryant
aeb7005245 Optimize the calling code of queryElems (#34235) 2025-04-19 08:17:07 +08:00
Kerwin Bryant
dd0caf7e16 Fix various misalignments and overflows (#34227)
---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-17 10:32:41 +00:00
Kerwin Bryant
bde014e46d Fix button alignments and remove unnecessary styles (#34206)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-16 08:14:10 +00:00
Hyungsub (Danny) Kim
dcfa42dd8f Fix: quoted replies incorrectly render user input as part of the quote (#34216)
Updated the quote insertion logic so that it adds one more line break
(`\n`) work like Github. This way, the cursor lands on a new line and
the user's reply is no longer interpreted as part of the quote.

Fixes #34177
2025-04-16 14:32:58 +08:00
Kerwin Bryant
2b99a58f54 Mark parent directory as viewed when all files are viewed (#33958)
Fix #25644 

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-15 22:35:22 +08:00
Kerwin Bryant
33df23c1f0 Update RepoContributors.vue (#34194) 2025-04-14 14:51:49 +00:00
Kerwin Bryant
f4196a8843 Optimize overflow-menu (#34183)
Optimized the overflow-menu:
1. Close the tippy when a menu item inside the tippy is clicked.
2. When a menu item inside the tippy is selected, move the active state
of the menu to the tippy's button.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-13 01:59:36 +00:00
Thomas E Lackey
fa49cd719f feat: Add sorting by exclusive labels (issue priority) (#33206)
Fix #2616

This PR adds a new sort option for exclusive labels.

For exclusive labels, a new property is exposed called "order", while in
the UI options are populated automatically in the `Sort` column (see
screenshot below) for each exclusive label scope.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-10 17:18:07 +00:00
Kerwin Bryant
02e49a0f47 Fix vertical centering of file tree icons and use entryIcon for submodules/symlinks (#34137)
In the file tree, the icons are not vertically centered, which affects
the overall visual consistency.
Currently, the icons of submodules and symlinks do not adopt the value
of entryIcon, resulting in inconsistent icon display.

before:
![3000-gogitea-gitea-y4ulxr46c4k ws-us118 gitpod io_test_test
gitea_src_branch_main_README md
(3)](https://github.com/user-attachments/assets/d521b89f-909a-43f9-8f39-787b0243b159)

after:
![3000-gogitea-gitea-y4ulxr46c4k ws-us118 gitpod io_test_test
gitea_src_branch_main_README md
(2)](https://github.com/user-attachments/assets/4866807f-c890-4709-b595-7086011e5231)

---------

Co-authored-by: silverwind <me@silverwind.io>
2025-04-09 18:10:16 -07:00
Kerwin Bryant
8c9d2bdee3 Keep file tree view icons consistent with icon theme (#33921)
Fix #33914

before:
![3000-gogitea-gitea-y4ulxr46c4k ws-us118 gitpod io_test_test
gitea_src_branch_main_
gitmodules](https://github.com/user-attachments/assets/ca50eeff-cc44-4041-b01f-c0c5bdd3b6aa)

after:
![3000-gogitea-gitea-y4ulxr46c4k ws-us118 gitpod io_test_test
gitea_src_branch_main_README
md](https://github.com/user-attachments/assets/3b87fdbd-81d0-4831-8a74-4dbfcd5b6d91)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-04-06 19:35:08 +00:00
wxiaoguang
a62ed19da6 Use overflow-wrap: anywhere to replace word-break: break-all (#34126) 2025-04-06 17:13:02 +08:00
wxiaoguang
e1c2d05bde Fix markdown render behaviors (#34122)
* Fix #27645
* Add config options `MATH_CODE_BLOCK_DETECTION`, problematic syntaxes
are disabled by default
* Fix #33639
    * Add config options `RENDER_OPTIONS_*`, old behaviors are kept
2025-04-05 11:56:48 +08:00
wxiaoguang
ee6929d96b Refactor dropdown ellipsis (#34123)
Remove legacy `truncated-item-container` and `truncated-item-name`.
2025-04-05 03:21:11 +00:00
wxiaoguang
86c1a33369 Fix some UI bugs and clean up unused tests (#34088)
1. Make the material icon falls back to basic theme correctly
2. Remove `TestAttributeReader`, the problem has been resolved.
3. Fix `toggleElem` bug and add tests
2025-04-01 07:02:30 +00:00
Kerwin Bryant
741b53eb30 [Fix] Resolve the problem of commit_statuses not being loaded at the top - right when switching files from the file tree (#34079)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-31 18:39:08 +00:00
Kerwin Bryant
2a9c5c9e3d Add toggleClass function in dom.ts (#34063)
This PR adds a toggleClass function in dom.ts, aiming to implement DOM
class toggling functionality.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-30 14:19:54 +08:00
TheFox0x7
053592d847 fix org repo creation being limited by user limits (#34030)
fixes an issue where user is unable to create new repository in
organization via UI if repository limits are in place and user has
exhausted them for their own namespace.

closes: https://github.com/go-gitea/gitea/issues/15504

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-27 13:16:17 +00:00
wxiaoguang
c7b85f7070 Fix dropdown module accessing (#34026)
Follow #34014.
2025-03-26 16:01:43 +00:00
wxiaoguang
d70be9d0fe Polyfill WeakRef (#34025)
Fix #33407
2025-03-26 23:56:25 +08:00
wxiaoguang
d28a7f9fea Fix dropdown delegating and some UI problems (#34014)
The old logic is incomplete. See the comment for the improved logic.

Fix #34011

And more fixes:

1. use empty "alt" for images, otherwise the width is not right when the
image fails to load
2. remove the "dropdown icon" patch, because it has been clearly done in
"dropdown.js" now
3. remove the "dropdown filtered item" patch, added a clear callback,
and improve the logic
4. fix global init when a node is removed and added back gain (eg: the
"cherry pick" dialog with a dropdown)
2025-03-26 02:51:22 +00:00
wxiaoguang
51d86adb6d Fix some migration and repo name problems (#33986)
1. Ignore empty inputs in `UnmarshalHandleDoubleEncode`
2. Ignore non-existing `stateEvent.User` in gitlab migration
3. Enable `release` and `wiki` units when they are selected in migration
4. Sanitize repo name for migration and new repo
2025-03-24 20:26:58 -07:00
YaFou
e25f860735 Fix "toAbsoluteLocaleDate" test when system locale is not en-US (#33939) 2025-03-19 19:49:05 +08:00
silverwind
01c8f092a0 Simplify secure context check (#33906)
As discussed in
https://github.com/go-gitea/gitea/pull/33820/files#r1997532169.
2025-03-16 19:05:26 +08:00
silverwind
52663113d4 Update JS and PY deps, misc tweaks (#33903)
- Update all updateable dependencies
- Add a few more unupgradable ones to updates blocklist
- Adapt to breaking changes
- Update to typescript 5.8, enable `erasableSyntaxOnly` which
necessitated a change because of forbidden syntax
- Misc cleanups
- Tested htmx, easymde, swagger, chart.js
2025-03-16 10:04:18 +01:00
Kerwin Bryant
92f997ce6b Add file tree to file view page (#32721)
Resolve #29328

This pull request introduces a file tree on the left side when reviewing
files of a repository.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-15 16:26:49 +08:00
wxiaoguang
91610a987e Fix various Fomantic UI and htmx problems (#33851)
Also fix #31328, fix #33854
2025-03-11 11:35:05 -07:00
wxiaoguang
608ccc32e5 Drop fomantic build (#33845)
We would never update or build fomantic again, we have forked it as a
private library long time ago.

So just put the JS and CSS files in "fomantic/build" into git. And use
"import" to use them.

Remove "form.js", rewrite "tab" component.

All source code is from official Fomantic UI build. Will apply patches
in separate PRs.
2025-03-11 12:44:52 +08:00
wxiaoguang
b8c2afdc5f Do not show passkey on http sites (#33820)
Fix #33615
2025-03-07 19:37:27 +00:00
Kerwin Bryant
f0f10413ae Update TypeScript types (#33799)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-05 08:03:44 -08:00
wxiaoguang
75e85c25c1 Refactor repo-issue.ts (#33784)
And remove jQuery
2025-03-04 17:58:17 +00:00
wxiaoguang
ca0ce003ab Refactor repo-settings.ts (#33785)
and remove jQuery
2025-03-05 01:19:03 +08:00
wxiaoguang
163bbca0eb Refactor admin/common.ts (#33788)
Only remove jQuery
2025-03-04 23:42:07 +08:00
Kerwin Bryant
14be462646 Refactor initRepoBranchTagSelector to use new init framework (#33776)
Make "initRepoBranchTagSelector" to use new init framework and fix the
abused "js-branch-tag-selector" styles

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-03 20:58:19 +00:00
Kerwin Bryant
ad204f9c5a Refactor buttons to use new init framework (#33774)
Make buttons to use new init framework
* "js-toggle-commit-body"
* "show-panel/hide-panel/show-modal"
* "copy-content"

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-03 20:30:55 +00:00
Kerwin Bryant
f0f1737d4d Refactor markup and pdf-viewer to use new init framework (#33772)
1. Add some "render-content" classes to "markup" elements when the
content is rendered
2. Use correct "markup" wrapper for "preview" (but not set that class on
the tab)
3. Remove incorrect "markup" class from LFS file view, because there is
no markup content
    * "edit-diff" is also removed because it does nothing
5. Use "initPdfViewer" for PDF viewer
6. Remove incorrect "content" class from milestone markup
7. Init all ".markup" elements by new init framework

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-03-03 11:49:15 -08:00
wxiaoguang
27bf63ad20 Refactor global init code and add more comments (#33755)
Follow up #33748

Now there are 3 "global" functions:

* registerGlobalSelectorFunc: for all elements matching the selector, eg: `.ui.dropdown`
* registerGlobalInitFunc: for `data-global-init="initInputAutoFocusEnd"`
* registerGlobalEventFunc: for `data-global-click="onCommentReactionButtonClick"`


And introduce `initGlobalInput` to replace old `initAutoFocusEnd` and
`attachDirAuto`, use `data-global-init` to replace fragile
`.js-autofocus-end` selector.

Another benefit is that by the new approach, no matter how many times
`registerGlobalInitFunc` is called, we only need to do one
"querySelectorAll" in the last step, it could slightly improve the
performance.
2025-03-03 10:57:28 +08:00
wxiaoguang
698ae7aa5b Fix dynamic content loading init problem (#33748)
1. Rewrite `dirauto.ts` to `observer.ts`. 
* We have been using MutationObserver for long time, it's proven that it
is quite performant.
    * Now we extend its ability to handle more "init" works.
2. Use `observeAddedElement` to init all non-custom "dropdown".
3. Use `data-global-click` to handle click events from dynamically
loaded elements.
* By this new approach, the old fragile selector-based
(`.comment-reaction-button`) mechanism is removed.
4. By the way, remove unused `.diff-box` selector, it was abused and
never really used.

A lot of FIXMEs in "repo-diff.ts" are completely fixed, newly loaded
contents could work as expected.
2025-03-01 02:02:10 +00:00
wxiaoguang
4e56d5f39f Refactor repo-diff.ts (#33746)
Remove jQuery
2025-02-28 16:37:16 +08:00
Alexander McRae
aba96f65cd Use git diff-tree for DiffFileTree on diff pages (#33514)
Modify Diff View FileTree to show all files

## Changes

* removes Show Status button on diff
* uses `git diff-tree` to generate the file tree for the diff
* doesn't reload the diff tree each time we load more files in the
preview
* selecting and unloaded file will keep loading until that file is
loaded
* removes `DiffFileList.vue` and "Show Stats" in diff options

## Open Questions

* selecting and unloaded file will keep loading until that file is
loaded. Is this behaviour okay? It matches what github does.

### Demo

In this demo I set `git.MAX_GIT_DIFF_FILES=1` in my `app.ini` to
demonstrate a worst case example. In most cases the behaviour isn't
nearly as jarring as we load a bunch of files at a time.


https://github.com/user-attachments/assets/72f29663-d6fc-472d-94fa-7fb5950c2836

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-28 00:58:25 +00:00
Guillaume
303af554c9 Improve "generate new access token" form (#33730)
Fix: https://github.com/go-gitea/gitea/issues/33519

As discussed in [PR
#33614](https://github.com/go-gitea/gitea/pull/33614), the
ScopedAccessTokenSelector Vue component is not particularly useful.

This PR removes the component and reverts to using HTML templates. It
also introduces some (hopefully) useful refactoring.

The Vue component was causing the UX bug reported in the linked issue.
Required form fields are now properly working, as expected (see
screenshot).

![Screenshot from 2025-02-25
22-00-28](https://github.com/user-attachments/assets/41167854-0718-48b0-a3ee-75ca3a7b8b20)

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-27 19:40:12 +00:00
Quentin
f52e31f5ce Clone repository with Tea CLI (#33725)
This PR adds "Tea CLI" as a clone method.

<img width="350" alt="Capture d’écran 2025-02-25 à 23 38 47"
src="https://github.com/user-attachments/assets/8e86e54a-998b-45d1-9f20-167b449e79b6"
/>

---------

Signed-off-by: Quentin Guidée <quentin.guidee@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-27 18:18:02 +00:00
wxiaoguang
555d64d024 Always show the "rerun" button for action jobs (#33692)
And improve the mock code.
2025-02-24 08:40:46 +00:00
wxiaoguang
ead716d204 Improve Open-with URL encoding (#33666)
Fix #33665
2025-02-21 17:46:05 +00:00
wxiaoguang
cd225d7034 Fix mCaptcha bug (#33659)
Fix #33658
2025-02-20 22:53:38 +08:00
silverwind
1ba7cbbfd6 Fix typo in HTML attribute (#33599) 2025-02-14 10:59:37 -05:00
Kerwin Bryant
085f273d19 Optimize the dashboard (#32990)
before:

![image](https://github.com/user-attachments/assets/d0b432e4-a521-4540-a489-d18b9c265674)

after:

![image](https://github.com/user-attachments/assets/dbb8b387-d150-41e2-b12b-f9d8450e36d7)
-----

![image](https://github.com/user-attachments/assets/40dcd71e-344b-4043-9811-77227c71aed9)
-----

Optimize the dashboard by adding welcoming messages or quick action
entry points (such as adding a new repository or organization) to ensure
that new users are not greeted by a blank page upon logging in.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-11 01:24:34 +08:00
wxiaoguang
06088ec672 Remove "class-name" from svg icon (#33540)
Only use "class" attribute
2025-02-09 22:39:54 +02:00
Kerwin Bryant
40426addfa Add cropping support when modifying the user/org/repo avatar (#33498)
Fixed #33321

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2025-02-06 21:07:44 +08:00
wxiaoguang
1ab5938e82 Hide/disable unusable UI elements when a repository is archived (#33459)
And by the way, remove some jQuery code
2025-01-31 20:47:31 +08:00