Skip to content

Make TicketCard issue and PR chips clickable#174

Merged
dhilgaertner merged 1 commit intomainfrom
feature/crow-171-clickable-link-chips
Apr 16, 2026
Merged

Make TicketCard issue and PR chips clickable#174
dhilgaertner merged 1 commit intomainfrom
feature/crow-171-clickable-link-chips

Conversation

@dhilgaertner
Copy link
Copy Markdown
Contributor

@dhilgaertner dhilgaertner commented Apr 15, 2026

Summary

  • Extract LinkChip from SessionDetailView.swift into its own file so it can be reused beyond the session header.
  • Replace the static purple ticketPRBadge and the plain #N issue-number text in TicketCard with gold LinkChips — every row now has a clickable Issue #N chip, and rows with a linked PR also show a PR #N chip. Both open the URL in the default browser, matching the session-header interaction.

Closes #171

Test plan

  • make build succeeds
  • Open the ticket board: every row shows an Issue #N chip; rows with a linked PR also show a PR #N chip
  • Click Issue #N → opens the issue in the default browser
  • Click PR #N → opens the PR in the default browser
  • Rows without a linked PR show only the issue chip (no dead PR chip)
  • Chip styling matches the session-header chips (gold capsule, same icons)
  • Session detail view still renders Issue / PR / Repo chips correctly (regression check on the LinkChip move)

🤖 Generated with Claude Code

@dhilgaertner dhilgaertner requested a review from dgershman as a code owner April 15, 2026 19:01
Copy link
Copy Markdown
Collaborator

@dgershman dgershman left a comment

Choose a reason for hiding this comment

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

Code & Security Review

Critical Issues

None found.

Security Review

Strengths:

  • URL validation via URL(string:) before calling NSWorkspace.shared.open() — prevents crashes on malformed strings
  • No user-controlled data flows into shell commands or unsafe APIs
  • PR link only renders when both prNumber and prURL are non-nil (the if let prNum, let prURL guard), preventing dead chips with no destination

Concerns:

  • None. NSWorkspace.shared.open() delegates URL handling to the OS, which is the standard safe pattern for macOS apps.

Code Quality

  • Clean extraction: LinkChip moved from SessionDetailView.swift into its own file with zero functional change — the diff confirms the struct is byte-identical before and after the move
  • Good guard tightening (TicketBoardView.swift:413): The old ticketPRBadge accepted an optional url: String? and silently rendered a non-clickable badge when nil. The new code requires both prNumber and prURL via if let, so no chip renders when there's no URL — strictly better behavior
  • Consistent styling: Both issue and PR chips now use the same gold LinkChip style, replacing the old purple ticketPRBadge and plain #N text. This unifies the visual language between the session header and ticket board
  • Net deletion: +45 / -54 — the refactor removes more code than it adds, which is a good sign for a reuse extraction
  • LinkChip is internal (default access), which is correct — it's used within the CrowUI module only

Summary Table

Priority Issue
Green Consider adding accessibilityLabel to LinkChip for VoiceOver (e.g., "Open Issue #42 in browser")

Recommendation: Approve — straightforward extraction + reuse with no regressions, correct nil-guarding, and consistent UI.

@dhilgaertner dhilgaertner deleted the feature/crow-171-clickable-link-chips branch April 16, 2026 02:48
@dhilgaertner dhilgaertner restored the feature/crow-171-clickable-link-chips branch April 16, 2026 02:49
@dhilgaertner dhilgaertner reopened this Apr 16, 2026
@dhilgaertner dhilgaertner deleted the feature/crow-171-clickable-link-chips branch April 16, 2026 02:50
@dhilgaertner dhilgaertner restored the feature/crow-171-clickable-link-chips branch April 16, 2026 02:51
@dhilgaertner dhilgaertner reopened this Apr 16, 2026
Extract LinkChip into its own file so the ticket board rows can reuse
the same clickable capsule the session header already uses. Replace
the static purple PR badge and the plain issue-number text in
TicketCard with gold LinkChips that open the issue and PR URLs in the
default browser.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dhilgaertner dhilgaertner force-pushed the feature/crow-171-clickable-link-chips branch from 85b150d to 4240d69 Compare April 16, 2026 03:57
@dhilgaertner dhilgaertner merged commit 8cf50ee into main Apr 16, 2026
2 checks passed
@dhilgaertner dhilgaertner deleted the feature/crow-171-clickable-link-chips branch April 16, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants