Skip to content

TicketCard: make issue and PR links clickable using LinkChip (match session header) #171

@dhilgaertner

Description

@dhilgaertner

Problem

In the ticket list (ticket board), each row shows the issue title and — if a PR exists — a small PR badge. Neither is clickable: there's no way to jump from a ticket row out to the issue or PR on GitHub.

Inside a session, we already have the pattern I want: small click-through capsules in the session header (Issue #123, PR link, Repo link) that open the URL in a browser. I'd like the same treatment on every row in the ticket board.

Expected

For each ticket row:

  • A clickable Issue #N chip that opens the GitHub/GitLab issue URL
  • A clickable PR #N chip that opens the PR URL — only when a PR is associated with the issue

Same visual style / interaction as the session-level chips for consistency.

Current Behavior

  • Packages/CrowUI/Sources/CrowUI/TicketBoardView.swiftTicketCard (lines 378–587)
  • The PR badge is rendered at line 413 via ticketPRBadge(number:url:) (lines 496–510), but it's a plain styled capsule — no tap handler, no NSWorkspace.shared.open.
  • The issue URL (AssignedIssue.url) is not surfaced as a chip at all.

Reuse the Existing Component

LinkChip already exists and does exactly this — clickable capsule with icon + label that calls NSWorkspace.shared.open:

  • Component: Packages/CrowUI/Sources/CrowUI/SessionDetailView.swift:360-389
  • Usage in session header:
    • Issue chip: SessionDetailView.swift:96-101LinkChip(label: "Issue #\(...)", url: session.ticketURL, icon: "link")
    • PR chip: SessionDetailView.swift:105-107LinkChip(label: link.label, url: link.url, icon: "arrow.triangle.pull")

Data Already Available

Packages/CrowCore/Sources/CrowCore/Models/AssignedIssue.swift:

  • url: String (line 9) — issue URL, always present
  • prURL: String? (line 16) — PR URL when linked

No new fetching or model changes needed.

Proposed Fix

  1. Make LinkChip accessible to TicketBoardView (move to a shared location in CrowUI if it isn't already, or extract to its own file).
  2. In TicketCard, replace the non-clickable ticketPRBadge with a LinkChip for the PR (when issue.prURL != nil).
  3. Add a second LinkChip for the issue itself using issue.url, so every row has at least the issue chip.
  4. Match icon convention: "link" for issue, "arrow.triangle.pull" for PR.

Files Affected

  • Packages/CrowUI/Sources/CrowUI/TicketBoardView.swift (replace ticketPRBadge, add issue chip in TicketCard)
  • Packages/CrowUI/Sources/CrowUI/SessionDetailView.swift (possibly extract LinkChip if it's file-private)

Acceptance Criteria

  • Every ticket row has a clickable issue chip
  • Ticket rows with a linked PR also show a clickable PR chip
  • Clicking either chip opens the URL in the default browser
  • Visual style matches the session-header chips

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions