From 204dd09475478ae1bc9cd2e6837c2d0734890c2f Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Mon, 9 Mar 2026 16:30:37 +0700 Subject: [PATCH] fix: resolve inspector border overlap and laggy toggle (#228, #229) --- CHANGELOG.md | 5 +++++ TablePro/Models/UI/RightPanelState.swift | 7 ++++--- TablePro/Views/Main/MainContentView.swift | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 790ba8b10..be060bb90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Inspector separator no longer bleeds into toolbar area with default connection color (#228) +- Inspector toggle no longer lags due to synchronous UserDefaults writes during animation (#229) + ### Added - Direct `.tableplugin` bundle installation via file picker, Finder double-click, and drag-and-drop diff --git a/TablePro/Models/UI/RightPanelState.swift b/TablePro/Models/UI/RightPanelState.swift index 305e11c03..1784ad08a 100644 --- a/TablePro/Models/UI/RightPanelState.swift +++ b/TablePro/Models/UI/RightPanelState.swift @@ -13,15 +13,16 @@ import os @MainActor @Observable final class RightPanelState { private static let isPresentedKey = "com.TablePro.rightPanel.isPresented" private static let isPresentedChangedNotification = Notification.Name("com.TablePro.rightPanel.isPresentedChanged") - private var isSyncing = false @ObservationIgnored private let _didTeardown = OSAllocatedUnfairLock(initialState: false) var isPresented: Bool { didSet { guard !isSyncing else { return } - UserDefaults.standard.set(isPresented, forKey: Self.isPresentedKey) - NotificationCenter.default.post(name: Self.isPresentedChangedNotification, object: self) + DispatchQueue.main.async { [self] in + UserDefaults.standard.set(self.isPresented, forKey: Self.isPresentedKey) + NotificationCenter.default.post(name: Self.isPresentedChangedNotification, object: self) + } } } diff --git a/TablePro/Views/Main/MainContentView.swift b/TablePro/Views/Main/MainContentView.swift index 67ff73705..7e3b40dac 100644 --- a/TablePro/Views/Main/MainContentView.swift +++ b/TablePro/Views/Main/MainContentView.swift @@ -861,7 +861,6 @@ private struct ToolbarTintModifier: ViewModifier { func body(content: Content) -> some View { if connectionColor.isDefault { content - .toolbarBackground(.hidden, for: .windowToolbar) } else { content .toolbarBackground(connectionColor.color.opacity(0.12), for: .windowToolbar)