-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
ProjectDetailView.swift (192 lines) and WorktreeDetailView.swift (168 lines) share ~75% of their code:
- Identical overall structure:
VStack { header; Divider; tabBar; Divider; content } - Identical tab bar (segmented picker for unstaged/PR diffs, same padding)
- Identical unstaged content section (delegates to
DiffListView) - Nearly identical PR content section
- Identical
ghUnavailableView(already extracted to sharedGHUnavailableViewin recent cleanup) - Same
@State private var diffState = DiffState()pattern - Same
.task/.onDisappearlifecycle
The only real differences are:
- The header shows project info vs worktree info (icon, name, metadata)
- PR selection UI (list with back-navigation vs dropdown picker)
- The data loading call (
loadForProjectvsloadForWorktree)
Suggested approach
Create a single DiffDetailView parameterized on the entity, with the header and PR selection UI injected via @ViewBuilder or a protocol. Estimated ~100 lines saved.
Files
apps/purepoint-macos/purepoint-macos/Views/Detail/ProjectDetailView.swiftapps/purepoint-macos/purepoint-macos/Views/Detail/WorktreeDetailView.swift
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request