Conversation
aee7bce to
9c7e067
Compare
9c7e067 to
5d9a44e
Compare
|
Can you add the hover over the actual link, not the parent div? That way the triangle of the tooltip should be aligned correctly and not point to nothing. |
I tried, it is currently at the link but it somehow doesnt work - Could you help me? @silverwind |
|
I think you can just produce the |
- Use relative-time element for date formatting in tooltip - Extract formatFileSize to shared utility web_src/js/utils/size.ts - Remove custom Intl.DateTimeFormat, ArtifactTooltipLocale type, Size label - Use createTippy with DOM element content via ref callback - Use muted link style for active artifacts, faded style for expired - Add semibold to sidebar section headings - Skip tooltip on expired artifacts - Disable tooltip arrow, use top-end placement Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Move vertical padding from li to first-child so the link covers the full row height. Reduce tooltip offset to 2px. Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
|
Also one notable change: Expired artifacts don't show a tooltip. I noticed the DB apparently stores the size of expired artifacts but imho it's a rarely useful and confusing info to display size of a expired artifact. Also backport as a no-risk enhancement. |
- Move formatBytes (renamed from formatFileSize) into web_src/js/utils.ts - Remove web_src/js/utils/size.ts - Move artifact li padding to first-child for full-height click area - Reduce tooltip offset to 2px Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds artifact expiry metadata (and size) to the Actions run view and displays it as a hover tooltip in the sidebar artifact list, backed by new backend fields and frontend formatting helpers.
Changes:
- Extend backend artifact metadata to include
expired_unixand expose it asexpiresUnixin the actions run view response. - Add frontend tooltip generation for artifacts (expiry via
<relative-time>+ formatted size). - Introduce a shared
formatBytes()utility and corresponding unit tests; add new locale key for “Expires at %s”.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web_src/js/utils.ts | Adds formatBytes() helper for human-readable artifact sizes. |
| web_src/js/utils.test.ts | Adds unit tests for formatBytes(). |
| web_src/js/modules/gitea-actions.ts | Extends ActionsArtifact type with size and expiresUnix. |
| web_src/js/features/repo-actions.ts | Wires new locale string (artifactExpiresAt) into the Vue view props. |
| web_src/js/components/RepoActionView.vue | Attaches artifact hover tooltips and adjusts artifact list styling. |
| web_src/js/components/ActionRunArtifacts.ts | Implements tooltip element creation (expiry + size). |
| web_src/js/components/ActionRunArtifacts.test.ts | Adds unit tests for tooltip element creation. |
| templates/repo/actions/view_component.tmpl | Adds data-locale-artifact-expires-at for the run view. |
| templates/devtest/relative-time.tmpl | Adds a devtest example including minute-level formatting. |
| routers/web/repo/actions/view.go | Adds expiresUnix to artifacts JSON returned by the run view endpoint. |
| routers/web/devtest/mock_actions.go | Populates mock artifacts with ExpiresUnix values for devtest. |
| options/locale/locale_en-US.json | Adds artifact_expires_at locale string. |
| models/actions/artifact.go | Includes expired_unix in grouped artifact meta query results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- encodeURIComponent on artifact download href for names with spaces or special characters - Use minute='2-digit' on relative-time for consistent zero-padding Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
- Replace text pipe with border-left separator via Tailwind classes - Remove flexbox on tooltip container to preserve whitespace between locale text and relative-time element - Fix empty line at end of style block Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
b6c8792 to
3887aaf
Compare
Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
|
thanks for your help @silverwind |
…sion Replace loop-based byte formatting with log-based approach. The function now accepts suffix and precision options, defaulting to byte formatting with IEC binary units (KiB, MiB, GiB). Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
Replace loop-based division with log2-based exponent calculation. Add precision parameter for configurable significant digits. Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
|
some minor refactors done to |
| function initSidebarTooltip(el: HTMLElement | null, content: string | HTMLElement) { | ||
| if (!el) return; | ||
| if (el._tippy) { | ||
| el._tippy.setContent(content); | ||
| } else { | ||
| createTippy(el, {content, role: 'tooltip', theme: 'tooltip', placement: 'top-end', arrow: false, offset: [0, 2]}); | ||
| } | ||
| } |
There was a problem hiding this comment.
You need to improve the framework, instead of making future developers copy&paste such code.
For example: data-tooltip-render-html="true"
There was a problem hiding this comment.
I guess some generic way to specify all tippy props in HTML is needed. Should be done with a future migration to https://github.com/floating-ui/floating-ui in mind.
There was a problem hiding this comment.
I guess some generic way to specify all tippy props in HTML is needed.
No, don't do more than it needs.
"tooltip" is "tooltip". Other tippy popups don't use "tooltip-content" for content.
|
I see a few more refactor opportunities, will do later. |
| .action-view-left .ui.relaxed.list > .item { | ||
| padding-top: 0; | ||
| padding-bottom: 0; | ||
| } | ||
|
|
||
| .action-view-left .ui.relaxed.list > .item > :first-child { | ||
| padding-top: 0.42857143em; | ||
| padding-bottom: 0.42857143em; | ||
| } | ||
|
|
There was a problem hiding this comment.
By the way, don't use such trick. You can see it breaks the UI , makes the "job list" very narrow.
There was a problem hiding this comment.
This is a minor fix to have the full vertical area hoverable (e.g. link turns blue on .item mouseenter), but I think it needs a cleaner solution. In my testing, visually there was no difference, padding just moved from .item to .item > a.
Will check. Likely refactor to a.item.


Add expiry metadata to action artifacts in the run view and show it on hover.