Skip to content

Commit 7031841

Browse files
authored
fix(ui): prevent state dots from being clipped by physical notch (farouqaldori#44)
* fix(ui): prevent state dots from being clipped by physical notch Apply closedContentWidth to frame modifiers so the closed notch expands to accommodate session dots when multiple sessions are active. Also expand the hit test rect in NotchViewController to match the expanded content area, ensuring clicks on dots properly trigger the notch to open. Fixes farouqaldori#37 * fix(ui): sync hit-test expansion padding with NotchView Change expansionPadding from +40 to +38 to match the actual maximum expansion width in NotchView.expansionWidth (base 20 + permission indicator 18).
1 parent 2326f6b commit 7031841

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

ClaudeIsland/UI/Views/NotchView.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ struct NotchView: View {
3838
VStack(spacing: 0) {
3939
self.notchLayout
4040
.frame(
41-
maxWidth: self.viewModel.status == .opened ? self.notchSize.width : nil,
41+
maxWidth: self.viewModel.status == .opened
42+
? self.notchSize.width
43+
: (self.showClosedActivity ? self.closedContentWidth : nil),
4244
alignment: .top
4345
)
4446
.padding(
@@ -61,7 +63,9 @@ struct NotchView: View {
6163
radius: 6
6264
)
6365
.frame(
64-
maxWidth: self.viewModel.status == .opened ? self.notchSize.width : nil,
66+
maxWidth: self.viewModel.status == .opened
67+
? self.notchSize.width
68+
: (self.showClosedActivity ? self.closedContentWidth : nil),
6569
maxHeight: self.viewModel.status == .opened ? self.notchSize.height : nil,
6670
alignment: .top
6771
)

ClaudeIsland/UI/Window/NotchViewController.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,17 @@ class NotchViewController: NSViewController {
6969
)
7070
case .closed,
7171
.popping:
72-
// When closed, use the notch rect
7372
let notchRect = geometry.deviceNotchRect
7473
let screenWidth = geometry.screenRect.width
75-
// Add some padding for easier interaction
74+
// Calculate expansion padding to account for session dots and activity indicators
75+
// Max expansion: 2 * (notchHeight - 12) + 20 + 18 (permission indicator)
76+
// Matches NotchView.expansionWidth logic: base 20 + optional 18 for permission indicator
77+
let expansionPadding = 2 * max(0, notchRect.height - 12) + 38
78+
let totalWidth = notchRect.width + expansionPadding
7679
return CGRect(
77-
x: (screenWidth - notchRect.width) / 2 - 10,
80+
x: (screenWidth - totalWidth) / 2,
7881
y: windowHeight - notchRect.height - 5,
79-
width: notchRect.width + 20,
82+
width: totalWidth,
8083
height: notchRect.height + 10
8184
)
8285
}

0 commit comments

Comments
 (0)