Terminal Work In Progress

This commit is contained in:
Hariharan Mudaliar 2026-03-04 01:46:26 +05:30
commit e59d35d89a
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
12 changed files with 570 additions and 77 deletions

View file

@ -311,6 +311,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
} else if coordinator.currentView == .notes || coordinator.currentView == .clipboard {
let preferredHeight = coordinator.notesLayoutState.preferredHeight
baseSize.height = max(baseSize.height, preferredHeight)
} else if coordinator.currentView == .terminal {
let screenHeight = NSScreen.main?.visibleFrame.height ?? 800
let maxFraction = Defaults[.terminalMaxHeightFraction]
baseSize.height = min(screenHeight * maxFraction, max(300, screenHeight * maxFraction))
}
let adjustedContentSize = statsAdjustedNotchSize(
@ -423,8 +427,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
PrivacyIndicatorManager.shared.startMonitoring()
// Observe tab changes - use immediate resize to keep the notch pinned
// Deferred to next run loop tick because @Published fires on willSet,
// so coordinator.currentView still holds the OLD value at emission time.
coordinator.$currentView.sink { [weak self] _ in
self?.updateWindowSizeForTabSwitch()
DispatchQueue.main.async {
self?.updateWindowSizeForTabSwitch()
}
}.store(in: &cancellables)
coordinator.$notesLayoutState
@ -463,6 +471,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
self?.debouncedUpdateWindowSize()
}.store(in: &cancellables)
// Observe terminal settings changes
Defaults.publisher(.enableTerminalFeature, options: []).sink { [weak self] _ in
self?.debouncedUpdateWindowSize()
}.store(in: &cancellables)
Defaults.publisher(.terminalMaxHeightFraction, options: []).sink { [weak self] _ in
self?.debouncedUpdateWindowSize()
}.store(in: &cancellables)
MemoryUsageMonitor.shared.startMonitoring()
ReminderLiveActivityManager.shared.$activeWindowReminders