Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions web_src/js/components/RepoActionView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ async function deleteArtifact(name: string) {
<!-- make the view container full width to make users easier to read logs -->
<div class="ui fluid container">
<div class="action-view-header">
<a class="action-view-back" :href="run.workflowLink"><SvgIcon name="octicon-arrow-left"/> {{ run.workflowID.replace(/\.(yml|yaml)$/i, '') }}</a>
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new back link is rendered unconditionally, but run.workflowLink/run.workflowID are initialized as empty strings. Until loadJob() finishes, this produces a clickable <a> with an empty href and no text (only the icon), which can cause an accidental reload/navigation. Consider guarding the link with v-if (e.g. only render when run.workflowLink and run.workflowID are set) or otherwise disabling it until data is loaded.

Suggested change
<a class="action-view-back" :href="run.workflowLink"><SvgIcon name="octicon-arrow-left"/> {{ run.workflowID.replace(/\.(yml|yaml)$/i, '') }}</a>
<a v-if="run.workflowLink && run.workflowID" class="action-view-back" :href="run.workflowLink"><SvgIcon name="octicon-arrow-left"/> {{ run.workflowID.replace(/\.(yml|yaml)$/i, '') }}</a>

Copilot uses AI. Check for mistakes.
<div class="action-info-summary">
<div class="action-info-summary-title">
<ActionRunStatus :locale-status="locale.status[run.status]" :status="run.status" :size="20"/>
<ActionRunStatus :locale-status="locale.status[run.status]" :status="run.status" :size="22"/>
<!-- eslint-disable-next-line vue/no-v-html -->
<h2 class="action-info-summary-title-text" v-html="run.titleHTML"/>
</div>
Expand Down Expand Up @@ -74,7 +75,7 @@ async function deleteArtifact(name: string) {
</div>
</div>
<div class="action-commit-summary">
<span><a class="muted" :href="run.workflowLink"><b>{{ run.workflowID }}</b></a>:</span>
<span><a class="muted" :href="`${run.link}/workflow`"><b>{{ run.workflowID }}</b></a>:</span>
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

href="${run.link}/workflow" will evaluate to /workflow while run.link is still the initial empty string, creating a valid-looking link to the site root before the run data loads. Please guard this link until run.link is populated (or compute the href to return an empty/disabled value when run.link is empty).

Suggested change
<span><a class="muted" :href="`${run.link}/workflow`"><b>{{ run.workflowID }}</b></a>:</span>
<span><a class="muted" :href="run.link ? `${run.link}/workflow` : undefined"><b>{{ run.workflowID }}</b></a>:</span>

Copilot uses AI. Check for mistakes.
<template v-if="run.isSchedule">
{{ locale.scheduled }}
</template>
Expand Down Expand Up @@ -180,7 +181,17 @@ async function deleteArtifact(name: string) {
/* action view header */

.action-view-header {
margin-top: 8px;
display: flex;
flex-direction: column;
margin-top: -7px;
}

.action-view-back {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 14px;
color: var(--color-text-light-1);
}

.action-info-summary {
Expand Down Expand Up @@ -213,8 +224,9 @@ async function deleteArtifact(name: string) {
display: flex;
align-items: center;
flex-wrap: wrap;
line-height: normal;
gap: 5px;
margin-left: 28px;
margin-left: 30px;
}

@media (max-width: 767.98px) {
Expand Down
2 changes: 2 additions & 0 deletions web_src/js/svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import giteaEmptyCheckbox from '../../public/assets/img/svg/gitea-empty-checkbox
import giteaExclamation from '../../public/assets/img/svg/gitea-exclamation.svg';
import giteaRunning from '../../public/assets/img/svg/gitea-running.svg';
import octiconArchive from '../../public/assets/img/svg/octicon-archive.svg';
import octiconArrowLeft from '../../public/assets/img/svg/octicon-arrow-left.svg';
import octiconArrowSwitch from '../../public/assets/img/svg/octicon-arrow-switch.svg';
import octiconBlocked from '../../public/assets/img/svg/octicon-blocked.svg';
import octiconBold from '../../public/assets/img/svg/octicon-bold.svg';
Expand Down Expand Up @@ -91,6 +92,7 @@ const svgs = {
'gitea-exclamation': giteaExclamation,
'gitea-running': giteaRunning,
'octicon-archive': octiconArchive,
'octicon-arrow-left': octiconArrowLeft,
'octicon-arrow-switch': octiconArrowSwitch,
'octicon-blocked': octiconBlocked,
'octicon-bold': octiconBold,
Expand Down