Repository navigation
Fix sidebar status URL clicks - #8528
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughSidebar status metadata entries with URLs now render as clickable underlined buttons. Their activation updates selection and opens the destination through a new row action callback, with coverage added for rendering and URL propagation. ChangesSidebar status URL interaction
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR restores clickable status-URL entries in the AppKit sidebar renderer, which had regressed in v0.64.20 when the AppKit renderer became the default. The fix wires a new
Confidence Score: 5/5Safe to merge — the change is narrowly scoped to metadata row rendering, all pooled state resets are explicit, and the new button path mirrors the established SidebarRowLinkButton pattern already used for PR titles and ports. The fix correctly identifies the missing URL-action route and wires it end-to-end: the button is properly hidden or reset on every non-URL configure pass, the weak-self capture prevents retain cycles in the pooled-cell context, and the layout delegates to intrinsicContentSize.height in a way consistent with SidebarRowPullRequestLine. The new test injects a URL-bearing entry, locates the rendered button by its tooltip, and performs a real click — covering the exact regression path. No production debug seams, no blocking concurrency, no ambient global state introduced. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant CV as ContentView
participant RA as SidebarAppKitRowActions
participant Cell as SidebarWorkspaceRowTableCellView
participant Row as SidebarRowIconTextLine
participant Btn as SidebarRowLinkButton
participant WS as NSWorkspace
CV->>RA: "init(onOpenStatusURL: { NSWorkspace.shared.open(url) })"
Cell->>Row: configureMetadataEntry(entry, model, color, onOpenURL)
alt "entry.url != nil"
Row->>Btn: configure(title, font, color, toolTip: url.absoluteString, onClick)
Row->>Btn: "isHidden = false"
Row->>Row: "textView.isHidden = true"
else "entry.url == nil"
Row->>Btn: "isHidden = true"
Row->>Row: "textView.isHidden = false"
end
Note over Btn: User clicks button
Btn->>Cell: onClick() → onOpenURL(url)
Cell->>RA: commands.updateSelection()
Cell->>RA: onOpenStatusURL(url)
RA->>WS: NSWorkspace.shared.open(url)
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant CV as ContentView
participant RA as SidebarAppKitRowActions
participant Cell as SidebarWorkspaceRowTableCellView
participant Row as SidebarRowIconTextLine
participant Btn as SidebarRowLinkButton
participant WS as NSWorkspace
CV->>RA: "init(onOpenStatusURL: { NSWorkspace.shared.open(url) })"
Cell->>Row: configureMetadataEntry(entry, model, color, onOpenURL)
alt "entry.url != nil"
Row->>Btn: configure(title, font, color, toolTip: url.absoluteString, onClick)
Row->>Btn: "isHidden = false"
Row->>Row: "textView.isHidden = true"
else "entry.url == nil"
Row->>Btn: "isHidden = true"
Row->>Row: "textView.isHidden = false"
end
Note over Btn: User clicks button
Btn->>Cell: onClick() → onOpenURL(url)
Cell->>RA: commands.updateSelection()
Cell->>RA: onOpenStatusURL(url)
RA->>WS: NSWorkspace.shared.open(url)
Reviews (1): Last reviewed commit: "fix: restore sidebar status URL actions" | Re-trigger Greptile |
Summary
Root cause
b7bd90103c(#8270) introduced the AppKit sidebar renderer. The shared snapshot continued carrying the completeSidebarStatusEntry, includingurl, butSidebarRowIconTextLine.configureMetadataEntryconsumed only icon, text, and color, andSidebarAppKitRowActionshad no status-URL route. The legacy SwiftUI renderer still created a button and opened the URL.e35b74407a(#8433) made the AppKit renderer the default before v0.64.20, exposing that latent omission and explaining why v0.64.19 worked while v0.64.20 regressed.The fix makes metadata rendering consume presentation and action metadata together: URL entries become accessible
NSButtoncontrols bound through a requiredonOpenStatusURLaction, while entries without URLs remain inert labels.Verification
57307391b3adds the failing behavior test before the fix./scripts/lint-pbxproj-test-wiring.sh./scripts/check-pbxproj.shpython3 scripts/check-package-resolved-policy.pyscripts/swift_file_length_budget.pyand.github/swift-file-length-budget.tsvin Remove Swift file length budget #8125, so that requested checker is unavailable; neither budget TSV was touchedLocalization
No user-facing strings were added or changed. The pill continues to display the status value and uses the stored URL as its tooltip, matching the legacy renderer.
Closes #8520
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Restore clickable sidebar status pills: URL-bearing entries now render as link buttons and open in the default browser after selecting the workspace, fixing #8520.
NSButtonlinks bound viaonOpenStatusURL; wired toNSWorkspace.shared.open.Written for commit 92b0e93. Summary will update on new commits.
Summary by CodeRabbit
New Features
Bug Fixes
Tests