Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 72 additions & 2 deletions Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9809,6 +9809,10 @@ struct VerticalTabsSidebar: View {
SidebarWorkspaceListMetrics.topScrimHeight
}

private var sidebarBottomScrimHeight: CGFloat {
SidebarWorkspaceListMetrics.bottomScrimHeight
}

private var isMinimalMode: Bool {
WorkspacePresentationModeSettings.mode(for: workspacePresentationMode) == .minimal
}
Expand Down Expand Up @@ -9909,7 +9913,7 @@ struct VerticalTabsSidebar: View {
workspaceTerminalScrollBarHiddenById: workspaceTerminalScrollBarHiddenById
)

VStack(spacing: 0) {
ZStack(alignment: .bottomLeading) {
workspaceScrollArea(renderContext: renderContext)
SidebarFooter(updateViewModel: updateViewModel, fileExplorerState: fileExplorerState, onSendFeedback: onSendFeedback)
.frame(maxWidth: .infinity, alignment: .leading)
Expand Down Expand Up @@ -10012,10 +10016,19 @@ struct VerticalTabsSidebar: View {
.frame(height: workspaceScrollTopVisibilityInset)
.allowsHitTesting(false)
}
.safeAreaInset(edge: .bottom, spacing: 0) {
Color.clear
.frame(height: sidebarBottomScrimHeight)
.allowsHitTesting(false)
}
.overlay(alignment: .top) {
SidebarTopScrim(height: sidebarTopScrimHeight)
.allowsHitTesting(false)
}
.overlay(alignment: .bottom) {
SidebarBottomScrim(height: sidebarBottomScrimHeight)
.allowsHitTesting(false)
}
Comment on lines +10026 to +10029

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Missing bottom safeAreaInset companion for the new scrim

The top scrim has a companion .safeAreaInset(edge: .top, spacing: 0) (line ~10014) that pushes scroll content down so rows aren't pinned under the fade. The bottom scrim has no equivalent. When the user scrolls all the way to the last row, the row's bottom edge sits flush with the scroll frame's bottom — i.e., directly behind the 28 pt fade — while the top half of that row remains fully visible. Adding a matching bottom inset would keep the last row fully clear of the fade at rest.

.safeAreaInset(edge: .bottom, spacing: 0) {
    Color.clear
        .frame(height: sidebarBottomScrimHeight)
        .allowsHitTesting(false)
}
.overlay(alignment: .bottom) {
    SidebarBottomScrim(height: sidebarBottomScrimHeight)
        .allowsHitTesting(false)
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already fixed in the current branch: the scroll area now has a matching bottom safeAreaInset using sidebarBottomScrimHeight before the bottom overlay.

— Claude Code

.overlay(alignment: .top) {
// The sidebar top strip remains draggable and handles
// double-clicks with the standard titlebar action.
Expand Down Expand Up @@ -12431,9 +12444,66 @@ private struct SidebarTopScrim: View {
let height: CGFloat

var body: some View {
Color.clear
SidebarEdgeScrim(height: height, edge: .top)
}
}

private struct SidebarBottomScrim: View {
let height: CGFloat

var body: some View {
SidebarEdgeScrim(height: height, edge: .bottom)
}
}

private struct SidebarEdgeScrim: View {
enum Edge {
case top
case bottom
}

let height: CGFloat
let edge: Edge

var body: some View {
SidebarEdgeBlurEffect()
.frame(height: height)
.mask(
LinearGradient(
colors: gradientColors,
startPoint: .top,
endPoint: .bottom
)
)
}

private var gradientColors: [Color] {
let colors = [
Color.black.opacity(0.95),
Color.black.opacity(0.75),
Color.black.opacity(0.35),
Color.clear,
]
switch edge {
case .top:
return colors
case .bottom:
return Array(colors.reversed())
}
}
}

private struct SidebarEdgeBlurEffect: NSViewRepresentable {
func makeNSView(context: Context) -> NSVisualEffectView {
let view = NSVisualEffectView()
view.blendingMode = .withinWindow
view.material = .underWindowBackground
view.state = .active
view.isEmphasized = false
return view
}

func updateNSView(_ nsView: NSVisualEffectView, context: Context) {}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

private struct SidebarScrollViewResolver: NSViewRepresentable {
Expand Down
1 change: 1 addition & 0 deletions Sources/WindowChromeMetrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ enum SidebarWorkspaceListMetrics {
static let firstRowTopOffset: CGFloat = MinimalModeChromeMetrics.titlebarHeight + 2
static let rowVerticalPadding: CGFloat = 8
static let topScrimHeight: CGFloat = firstRowTopOffset + 20
static let bottomScrimHeight: CGFloat = topScrimHeight

static var scrollTopInset: CGFloat {
max(0, firstRowTopOffset - rowVerticalPadding)
Expand Down
Loading