Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion ora/Modules/Sidebar/ContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct ContainerView: View {
.padding(.horizontal)
}

ScrollView(.vertical, showsIndicators: false) {
VerticalScrollView {
VStack(alignment: .leading, spacing: 16) {
if !privacyMode.isPrivate {
PinnedTabsList(
Expand Down
15 changes: 14 additions & 1 deletion ora/UI/NSPageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import SwiftUI
#if canImport(AppKit) && !targetEnvironment(macCatalyst)
import AppKit
import os.log
import QuartzCore

private let logger = Logger(
subsystem: "com.orabrowser.app", category: "NSPageView"
Expand Down Expand Up @@ -149,6 +150,16 @@ import SwiftUI
}
}

override func animation(forKey key: NSAnimatablePropertyKey) -> Any? {
if key == "selectedIndex" {
let animation = CABasicAnimation()
animation.duration = 0.1
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

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

The animation duration 0.1 is hardcoded in two places (here and in updateSelectedIndex at line 173). Consider extracting this to a constant to maintain consistency and make future adjustments easier. For example: private static let transitionDuration: TimeInterval = 0.1

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

animation.timingFunction = CAMediaTimingFunction(name: .easeOut)
return animation
}
return super.animation(forKey: key)
}

func updateDataSource() {
self.arrangedObjects = pageObjects
logger.log("NSPageView updateDataSource \(self.arrangedObjects.count)")
Expand All @@ -158,7 +169,9 @@ import SwiftUI
logger.log("NSPageView updateSelectedIndex \(index), animated \(animated)")

if animated {
NSAnimationContext.runAnimationGroup { _ in
NSAnimationContext.runAnimationGroup { context in
context.duration = 0.1
context.timingFunction = CAMediaTimingFunction(name: .easeOut)
self.animator().selectedIndex = index
} completionHandler: {
self.completeTransition()
Expand Down
Empty file removed ora/UI/Toast/ToastModel.swift
Empty file.
8 changes: 4 additions & 4 deletions ora/UI/VerticalScrollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ final class BaseVerticalScrollView: NSScrollView {
}
}

struct VerticalScrollView<Content: View>: NSViewRepresentable {
public struct VerticalScrollView<Content: View>: NSViewRepresentable {
let content: Content

init(@ViewBuilder content: () -> Content) {
public init(@ViewBuilder content: () -> Content) {
self.content = content()
}

func makeNSView(context: Context) -> NSView {
public func makeNSView(context: Context) -> NSView {
let hostingView = NSHostingView(rootView: content)
let scrollView = BaseVerticalScrollView(contentView: hostingView)

Expand All @@ -80,7 +80,7 @@ struct VerticalScrollView<Content: View>: NSViewRepresentable {
return scrollView
}

func updateNSView(_ nsView: NSView, context: Context) {
public func updateNSView(_ nsView: NSView, context: Context) {
guard
let scrollView = nsView as? BaseVerticalScrollView,
let hostingView = scrollView.documentView?.subviews.first
Expand Down