0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-02-22 11:05:42 +01:00

2285 Commits

Author SHA1 Message Date
Semenets V. Pavel
45d3e146ff
Merge branch 'main' into feature/workflow-graph 2026-02-20 20:45:17 +03:00
silverwind
91dc737a35
Replace tinycolor2 with colord (#36673)
[`colord`](https://github.com/omgovich/colord) is significantly smaller
than [`tinycolor2`](https://github.com/bgrins/TinyColor) (~4KB vs ~29KB
minified) and ships its own TypeScript types, removing the need for
`@types/tinycolor2`.

Behaviour is exactly the same for our use cases. By using `.alpha(1)` we
force the function to always output 6-digit hex format (it would output
8-digit for non-opaque colors).

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:43:01 +00:00
Semenets V. Pavel
6c6646ed38 fix: address code review feedback for WorkflowGraph.vue
Changes:
- i18n: Removed all comments, made code self-documenting
- fix(zoom): Corrected cumulative scaling drift (1.2 * 0.8 != 1.0)
- refactor(styles): Replaced inline dynamic styles with CSS classes
- fix(storage): Implemented LRU cache for localStorage (max 15 entries)
- cleanup: Removed CSS variable fallbacks, use design system only
- fix: Corrected zoom controls rendering and border display
- chore: Aligned component structure with project conventions

Note: Component implemented manually with strict typing and performance
optimizations (rAF, cycle detection)
2026-02-20 16:51:32 +03:00
Semenets V. Pavel
d88a53785f fix: Improve RepoActionView console styling and WorkflowGraph UX
RepoActionView:
- Restore original console styles in RepoActionView.vue
- Fix light theme console colors (variables were hardcoded to dark values)
- Improve overall UI appearance and readability

WorkflowGraph:
- Remove artificial delay during graph panning
- Fix graph movement behavior
- Add persistence for zoom/position state when switching between jobs
- Rename prop `current-job-id` to `current-job-idx` for accuracy
- Remove border from graph container
2026-02-20 11:52:51 +03:00
Semenets V. Pavel
0a86d2a2cb fix: move dependency graph button to header actions group and improve UX
- Moved "Dependency Graph" button to the right side of the header next to "Rerun all jobs" button
- Grouped all action buttons (approve, cancel, rerun, graph) in a consistent UI pattern
- Added locale support for "Dependency Graph" button text across all languages
- Fixed button behavior by using 'primary' class instead of 'link-action' to prevent page reloads
- Added conditional display (only shown when run.jobs.length > 1) to avoid confusion when there's only one job
- Improved user experience by ensuring the graph button is only visible when it's actually useful

This change addresses the confusing behavior where clicking the graph button did nothing when there was only one job, and makes the UI more intuitive by placing related actions together in the header.
2026-02-18 11:01:44 +03:00
Semenets V. Pavel
f59d768572
Merge branch 'main' into feature/workflow-graph 2026-02-18 07:59:34 +03:00
silverwind
d6be18e870
Load heatmap data asynchronously (#36622)
Fixes: https://github.com/go-gitea/gitea/issues/21045

- Move heatmap data loading from synchronous server-side rendering to
async client-side fetch via dedicated JSON endpoints
- Dashboard and user profile pages no longer block on the expensive
heatmap DB query during HTML generation
- Use compact `[[timestamp,count]]` JSON format instead of
`[{"timestamp":N,"contributions":N}]` to reduce payload size
- Public API (`/api/v1/users/{username}/heatmap`) remains unchanged
- Heatmap rendering is unchanged, still shows a spinner as before, which
will now spin a litte bit longer.

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-17 14:03:55 +00:00
silverwind
1b874d1403
Use first commit title for multi-commit PRs and fix auto-focus title field (#36606)
Fixes: https://github.com/go-gitea/gitea/issues/34865

1. When opening a PR from a branch with multiple commits, use the first
(oldest) commit's title as the default title instead of the branch name
2. Fix autofocus on PR title input field

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-17 09:06:27 +01:00
silverwind
cfc60b2142
Use relative-time to render absolute dates (#36238)
`<relative-time>` can render absolute dates when passed
[`threshold="P0Y"`](https://github.com/github/relative-time-element#threshold-string-default-p30d)
and `prefix=""`, so remove the previously used `<absolute-date>` element
in its favor.

Devtest before:

<img width="324" height="210" alt="Screenshot 2025-12-23 at 20 22 44"
src="https://github.com/user-attachments/assets/cf78e0e7-f480-415f-98d5-09b25f9d5a8b"
/>

Devtest after:

<img width="274" height="184" alt="Screenshot 2025-12-23 at 20 22 49"
src="https://github.com/user-attachments/assets/5e7d25f6-eea1-4a8c-ba71-02b570804b95"
/>

Repo activity (rendering unchanged):

<img width="1023" height="67" alt="image"
src="https://github.com/user-attachments/assets/2c4fd6cb-14ab-43c6-ae4b-f86946b28288"
/>

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-16 10:58:04 +00:00
Semenets V. Pavel
4b87e2a3b8
Merge branch 'main' into feature/workflow-graph
Signed-off-by: Semenets V. Pavel <p.semenets@gmail.com>
2026-02-16 08:23:27 +03:00
silverwind
2896dac536
Fix state desync in ComboMarkdownEditor (#36625)
Fixes https://github.com/go-gitea/gitea/issues/24253

When a tasklist checkbox is clicked, the tasklist code [updates
`.raw-content` with latest server
data](7a8fe9eb37/web_src/js/markup/tasklist.ts (L73))
in the DOM after POSTing.

Then when "Edit" is clicked the ComboMarkdownEditor is shown with a
stale value from the previous edit session.

The fix makes it always read from `.raw-content`, no server
syncronization necessary because the value in `.raw-content` is the
latest from the server.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-16 00:49:03 +00:00
silverwind
26bb175d69
Persist actions log time display settings in localStorage (#36623)
Persist the two boolean settings in the actions log into `localStorage`
so that they are remembered across page reloads.

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 19:41:59 +00:00
Semenets V. Pavel
4d4e16e049
Merge branch 'main' into feature/workflow-graph
Signed-off-by: Semenets V. Pavel <p.semenets@gmail.com>
2026-02-13 11:35:37 +03:00
silverwind
4b36f01bf4
Update emoji data for Unicode 16 (#36596)
Use emoji data from https://github.com/github/gemoji/pull/303 because
`github/gemoji` is unmaintained.

`assets/emoji.json` is now pretty-printed so that future diffs will
actually be readable. This causes no isses as the only place where it is
used is in frontend which imports it via `with {type: 'json'}` where
whitespace is irrelevant.

<img width="205" height="75" alt="image"
src="https://github.com/user-attachments/assets/96e335b8-acf6-4996-ace4-824c0870a7d3"
/>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 21:39:36 +00:00
silverwind
d582c9c8c0
Adapt monaco error matching pattern to recent webpack config change (#36533)
Signed-off-by: silverwind <me@silverwind.io>
2026-02-12 20:59:13 +00:00
Tyrone Yeh
514f322dcf
fix(repo-editor): disable Monaco editContext to avoid bugs with lost focus (#36585)
Currently, pressing the space key in the Monaco editor scrolls the page
instead of inserting a space
if the editor is focused. This PR stops the space key event from
propagating to parent elements,
which prevents unwanted page scrolling while still allowing Monaco to
handle space input normally.

Changes:
 - disable Monaco editContext

No changes to default editor behavior are needed; Monaco automatically
inserts the space character.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
2026-02-12 18:39:24 +00:00
silverwind
47b387921a
Add code editor setting dropdowns (#36534)
Adds three `<select>` controls on top right for indent style, indent
size, and line wrap to the code editor (`_edit`), diff patch editor
(`_diffpatch`) and git hook editor (`/settings/hooks/git/pre-receive`).

The git hooks editor is restyled to wrap the content in a box. Also
included is a bugfix for the git hooks editor where monaco was not
initialized correctly.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-12 03:55:46 +08:00
Semenets V. Pavel
e0ac31528f fix: add dependency graph toggle with persistent state
- Changed button label to "Dependency Graph" for clarity
- Implemented session-persistent state using localStorage for graph visibility
- Set graph to be hidden by default on page load
- Note: Cannot prevent page reload on graph node click as RepoActionView component
  performs full page navigation when switching between jobs
2026-02-11 09:08:15 +03:00
Semenets V. Pavel
83e4b96aee
Merge branch 'main' into feature/workflow-graph 2026-02-11 06:25:10 +03:00
wxiaoguang
fd89ceef79
Fix markup code block layout (#36578) 2026-02-11 03:22:33 +00:00
Semenets V. Pavel
a6bac394fb
Merge branch 'main' into feature/workflow-graph 2026-02-11 05:40:28 +03:00
silverwind
018a88590c
Remove striped tables in UI (#36509)
We've been cutting down on the "striped" tables (where rows are using
alternate row background colors). This completely removes them as I
think such a design looks outdated.

The removal of selectors starting with `.ui[class*="very
basic"].table:not(.striped)` is needed because of a specificity issue in
the CSS where table cells would otherwise render with incorrect padding.

Example of one affected table:

<img width="1027" height="224" alt="image"
src="https://github.com/user-attachments/assets/2f3006ca-99a1-4655-afdb-b7cd9e5f19c7"
/>
2026-02-11 01:58:56 +00:00
silverwind
c17280149f
Fix vertical alignment of .commit-sign-badge children (#36570)
Before: Avatar and lock icon was slightly misaligned vertically and span
was `20px` high:

<img width="271" height="69" alt="Screenshot 2026-02-09 at 14 38 45"
src="https://github.com/user-attachments/assets/e7e7ff6b-3087-4baa-95b5-18dc54c595d7"
/>

After: Fixed alignment and span is `16px`, same as avatar:

<img width="270" height="65" alt="Screenshot 2026-02-09 at 14 39 30"
src="https://github.com/user-attachments/assets/fe31a23e-c6d8-49d3-92a3-237628da1269"
/>
2026-02-11 01:01:26 +00:00
wxiaoguang
5e5703694d
Add viewer controller for mermaid (zoom, drag) (#36557)
Fix #25803

Now the rendered mermaid chart can be dragged or zoomed.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 06:36:31 +00:00
silverwind
09a88fb17e
Misc typescript tweaks (#36523)
Some minor refactors, disable one obsolete lint rule, fix another. The
tribute type issue is not fully fixed and I'm pretty sure it must be an
error in their types.
2026-02-10 05:09:56 +00:00
Tyrone Yeh
269bc1b112
fix(diff): reprocess htmx content after loading more files (#36568)
The "Show more files" button replaces `#diff-incomplete` with newly
loaded diff file boxes.
The inserted HTML may contain htmx attributes, but they are not
processed after insertion.

### Solution
Wrap the incomplete diff placeholder with a temporary wrapper so we can
call `htmx.process()` on the newly inserted content.
After processing, unwrap the wrapper to keep the DOM structure
unchanged.

### Testing
- Open a large PR diff page where `Diff.IsIncomplete` is true
- Click "Show more files"
- Verify newly loaded file boxes behave correctly (htmx-related features
work as expected)

<img width="927" height="278" alt="image"
src="https://github.com/user-attachments/assets/54f2b4f2-c0e1-483c-9e26-79a2838e98ee"
/>

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-10 01:20:20 +00:00
Semenets V. Pavel
cd185dcd4d
Merge branch 'main' into feature/workflow-graph 2026-02-09 15:44:59 +03:00
Tyrone Yeh
c401cda108
Fix assignee sidebar links and empty placeholder after #32465 refactor (#36559)
Follow-up to #32465: Fix the assignee sidebar after the selector
refactor.


Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-08 21:00:18 +00:00
Semenets V. Pavel
0f9d18a712
Merge branch 'main' into feature/workflow-graph 2026-02-08 12:43:33 +03:00
Hypo
ef529de0ac
Prevent navigation keys from triggering actions during IME composition (#36540)
Fixes  #36532 

Refined the Enter key trigger logic in the repository filter to prevent
actions during IME composition.

By checking the e.isComposing property, the filter now correctly
distinguishes between "confirming an IME candidate" and "submitting the
search." This prevents premature search triggers when users press Enter
to select Chinese/Japanese characters.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-08 14:39:09 +08:00
wxiaoguang
a60201a071
Fix various mermaid bugs (#36547)
* Fix #36515
* Fix #23076
* Remove unnecessary `mermaid.parse`
* Fix data race when using `data-render-done`
* Remove unnecessary `Promise.all`
* Fix duplicate `load` event and duplicate SVG node rendering
* Remove unnecessary `IntersectionObserver`
* Add `bindFunctions` call, the old comment seems not true
2026-02-08 12:21:11 +08:00
silverwind
49e6d5f6d6
Add elk layout support to mermaid (#36486)
Fixes: https://github.com/go-gitea/gitea/issues/34769

This allows the user to opt-in to using `elk` layouts using either YAML
frontmatter or `%%{ init` directives inside the markup code block. The
default layout is not changed.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-07 02:22:57 +00:00
silverwind
915b44810d
Color command/error logs in Actions log (#36538)
Support `[command]` and `##[error]` log command

------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-06 23:05:32 +08:00
Semenets V. Pavel
6e6decd936
Merge branch 'main' into feature/workflow-graph 2026-02-06 10:57:10 +03:00
Copilot
fca94bcdd7
Hide add-matcher and remove-matcher from actions job logs (#36520)
Hides `::add-matcher::`, `##[add-matcher]` and `::remove-matcher` in job
step logs. These are used to configure regex matchers to detect lines
that should trigger annotation comments on the UI, currently unsupported
by Gitea and these have no relevance to the user.

---------

Signed-off-by: silverwind <me@silverwind.io>
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-05 19:11:44 +08:00
Semenets V. Pavel
b7c87025d3
Merge branch 'main' into feature/workflow-graph 2026-02-02 00:14:08 +03:00
Copilot
7883f6dde9
Remove and forbid @ts-expect-error (#36513)
Removes `@ts-expect-error` in the code base and forbids it.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: silverwind <115237+silverwind@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-02-02 01:00:34 +08:00
Lunny Xiao
e377da989f
Allow scroll propagation outside code editor (#36502)
Fix #28479

When scrolling inside the editor and the editor has already reached the
end of its scroll area, the browser does not continue scrolling. This is
inconvenient because users must move the cursor out of the editor to
scroll the page further.

This PR enables automatic switching between the editor’s scroll and the
browser’s scroll, allowing seamless continuous scrolling.
2026-02-01 06:03:38 +00:00
silverwind
7292ae1ed5
Update JS deps, remove knip, misc tweaks (#36499)
- Update all JS deps
- Enable a few more stylelint stylistic rules and fix issues
- Remove knip, it raised another false-positive, this tool is not worth
it when you have to babysit it like that
- Exclude @eslint/json from updating as it requires unreleased eslint 10
([ref](https://github.com/eslint/json/issues/207))
- Update labeler config for new eslint filenames
- Adjust `make help` output
- Add type checking in `stylelint.config.ts`
2026-01-31 20:58:23 +08:00
Semenets V. Pavel
39d9a64a8a
Merge branch 'main' into feature/workflow-graph
Signed-off-by: Semenets V. Pavel <p.semenets@gmail.com>
2026-01-29 21:07:56 +03:00
silverwind
224b7881d9
Forbid localStorage access in eslint (#36461)
Followup to
59f812bc1c,
enforce using our localStorage wrapper in eslint.

Also did a few tweaks in the eslint config, like removing the incomplete
list of globals, this is a non-issue with typescript.

---------

Signed-off-by: silverwind <me@silverwind.io>
2026-01-27 19:59:51 +00:00
silverwind
59f812bc1c
Fix and enhance comment editor monospace toggle (#36181)
Fixes: https://github.com/go-gitea/gitea/issues/36175

1. Correctly apply setting on textareas spawned by comment edit
3. When changing the setting, apply it to all textareas on the current page

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-26 14:19:47 +00:00
wxiaoguang
4c8f6dfa4e
Support rendering OpenAPI spec (#36449)
Fix #20852
2026-01-26 10:34:38 +08:00
silverwind
12a81d38c1
Add knip linter (#36442)
This adds [knip](https://github.com/webpro-nl/knip), a tool to find
unused files, dependencies and exports in JS. Fixed all discovered
issues.

1. knip apparently has some issue resolving imports from `d.ts` to `.ts`
so I worked around it by moving the two affected types to where they are
used.
2. I don't know why `modules/fomantic/dropdown.ts` had a new typescript
error, but I fixed it.
3. Use named export for `EsbuildPlugin`, I think this was added
recently.
2026-01-24 12:52:13 +00:00
wxiaoguang
ddc9d29713
Fix various bugs (#36446)
* Fix #36409
* Fix #36322
* Fix #30101
* Fix #36317

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-24 11:30:47 +00:00
silverwind
5925433fe6
Update JS dependencies, adjust webpack config, misc fixes (#36431)
1. Upgrade to [jQuery
4.0](https://blog.jquery.com/2026/01/17/jquery-4-0-0/). Two of the
removed APIs are in use by fomantic, but there are [polyfills
present](a3a3e581aa/web_src/fomantic/build/components/dropdown.js (L15-L17))
so it continues to work.
2. Remove manual naming of webpack chunks. I was running into below
webpack error and I see no reason for this manual chunk naming which is
prone to naming collisions. Also, the webpack build now shows all output
assets. This change will result in longer asset filenames, but webpack
should now be able to guarentee that the names are without collisions.
    ````
    ERROR in SplitChunksPlugin
    Cache group "defaultVendors" conflicts with existing chunk.
Both have the same name "--------" and existing chunk is not a parent of
the selected modules.
Use a different name for the cache group or make sure that the existing
chunk is a parent (e. g. via dependOn).
    HINT: You can omit "name" to automatically create a name.
BREAKING CHANGE: webpack < 5 used to allow to use an entrypoint as
splitChunk. This is no longer allowed when the entrypoint is not a
parent of the selected modules.
Remove this entrypoint and add modules to cache group's 'test' instead.
If you need modules to be evaluated on startup, add them to the existing
entrypoints (make them arrays). See migration guide of more info.
3. Fix test issue related to `p > div` which is invalid as per HTML spec
because `div` is not [phrasing
content](https://html.spec.whatwg.org/multipage/dom.html#phrasing-content-2)
and therefor can not be a descendant of `p`. This is related to
https://github.com/capricorn86/happy-dom/pull/2007.
4. Add webpack globals
5. Remove obsolete docs glob
6. fix security issue for `seroval` package
7. disable [vitest isolate](https://vitest.dev/config/isolate.html) for
30% faster JS tests, which are all pure.
2026-01-24 07:35:46 +00:00
silverwind
47717d4435
Add documentation for markdown anchor post-processing (#36443)
See discussion in https://github.com/go-gitea/gitea/pull/36284.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-24 05:31:57 +01:00
Heath Dutton🕴️
0f78b99998
Fix markup heading parsing, fix emphasis parsing (#36284)
Fixes #36106, fix #17958

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-01-23 20:24:58 +00:00
wxiaoguang
85c7901404
Fix issue filter menu layout (#36426)
Fix #36420
2026-01-22 02:22:20 +00:00
Tyrone Yeh
58cd8244ba
Fix markdown newline handling during IME composition (#36421)
### Summary

Fix incorrect newline handling in markdown editor when using IME input.

### Details

While composing text with an IME, pressing Enter should not trigger
markdown indentation logic.
This change skips indentation handling during composition by checking
`e.isComposing`.

This prevents unexpected line breaks and formatting issues for CJK
users.
2026-01-22 00:24:37 +00:00