Skip to content

Commit 8dd81b2

Browse files
authored
fix: expand collapsed notch for session state dots (farouqaldori#37)
* fix: expand collapsed notch for session state dots Add expansion width calculation for the multiple active sessions case. When only hasMultipleActiveSessions is true (without processing, permission, or waitingForInput), the notch now properly expands to accommodate the crab icon and session state dots. Previously, showClosedActivity was true but expansionWidth returned 0, causing dots to be crammed within the fixed notch width. * fix: add right-side spacer for symmetric notch expansion with session dots The expansionWidth calculation and closedContentWidth property weren't actually driving layout - expansion worked via HStack content sizing. When only hasMultipleActiveSessions was true (no processing/pending/ waitingForInput), the right side had no content, causing asymmetric expansion unlike other activity states. Changes: - Add empty Color.clear spacer on right side when showing session dots - Update expansionWidth formula to match symmetric layout (2 * sideWidth)
1 parent dbc99f6 commit 8dd81b2

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

ClaudeIsland/UI/Views/NotchView.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ struct NotchView: View {
203203
return 2 * max(0, self.closedNotchSize.height - 12) + 20
204204
}
205205

206+
// Expand for multiple active sessions to accommodate session state dots
207+
// Uses symmetric expansion (sideWidth on both left and right) like processing
208+
if self.hasMultipleActiveSessions {
209+
return 2 * max(0, self.closedNotchSize.height - 12) + 20
210+
}
211+
206212
return 0
207213
}
208214

@@ -327,7 +333,8 @@ struct NotchView: View {
327333
}
328334
}
329335

330-
// Right side - spinner when processing/pending, checkmark when waiting for input
336+
// Right side - spinner when processing/pending, checkmark when waiting for input,
337+
// or empty spacer for symmetric expansion with session dots
331338
if self.showClosedActivity {
332339
if self.isProcessing || self.hasPendingPermission {
333340
ProcessingSpinner()
@@ -340,6 +347,12 @@ struct NotchView: View {
340347
.matchedGeometryEffect(id: "spinner", in: self.activityNamespace, isSource: self.showClosedActivity)
341348
.frame(width: self.viewModel.status == .opened ? 20 : self.sideWidth)
342349
.padding(.trailing, self.viewModel.status == .opened ? 0 : 4)
350+
} else if self.hasMultipleActiveSessions && self.viewModel.status != .opened {
351+
// Empty spacer maintains symmetric expansion when showing session dots
352+
// (matches sideWidth used by spinner/checkmark in other activity states)
353+
Color.clear
354+
.frame(width: self.sideWidth)
355+
.padding(.trailing, 4)
343356
}
344357
}
345358
}

0 commit comments

Comments
 (0)