Skip to content
Open
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
13 changes: 13 additions & 0 deletions services/hackbot-ui/components/RunDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ function commentPreview(a: RunAction): string | null {
return typeof text === "string" && text.trim() ? text : null;
}

// Only some action types return a link to the external system (e.g. Bugzilla) where the action was applied.
// We surface that as an "Open" link in the actions list.
function actionUrl(a: RunAction): string | null {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need this function? I guess we could use the URL as it is. WDYT?

@jpangas jpangas Sep 3, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Only some action types return a link, so without the check we would render a dead "Open" link. Keeping it as a named function matches commentPreview right above it and similar to the rest of the helpers in the file. I was going to make it inline, but I thought its better to keep it consistent with the rest.

const url = a.result?.url;
return typeof url === "string" && url ? url : null;
}

const POLL_MS = 4000;

function formatBytes(n: number): string {
Expand Down Expand Up @@ -271,11 +278,17 @@ export function RunDetail({ runId }: { runId: string }) {
<ul className="action-list">
{actions.map((a) => {
Comment thread
jpangas marked this conversation as resolved.
const preview = commentPreview(a);
const url = actionUrl(a);
return (
<li key={a.idx}>
<div className="action-row">
<span className={`badge ${a.status}`}>{a.status}</span>
<code>{a.type}</code>
{url && (
<a href={url} target="_blank" rel="noreferrer">
Open
</a>
)}
{a.error && <span className="muted">{a.error}</span>}
</div>
{preview && (
Expand Down