feat: animate actions panel and footer transitions

This commit is contained in:
2026-10-12 17:06:53 +02:00
parent ff8407e771
commit 95cc55b8ce
2 changed files with 53 additions and 16 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ Applications with identical display names show a muted containing-folder hint be
Select an application and open **Actions ⌘K**. The red **Uninstall application** action opens a review sheet with file checkboxes, paths, sizes, and a selected-item count. Filtering by name or path does not change selections. Up/Down highlights rows; Space toggles the highlighted eligible item when the file list has focus. Back or Escape returns to the launcher. Return or the uninstall button opens a final confirmation; nothing is moved merely by choosing the action.
The actions selector is an arrowless panel inside the launcher, aligned to the bottom and right edges of the footer action pill, replacing it visually while open rather than floating above it. It shares the launcher's frosted Sunset background, 38-point selection row height, 22×22-point icon boxes with 12-point icon-to-text spacing, 14-point action and search text, rounded selection styling, and Return key badge; selection width follows the panel. Application and command rows use the same sizing constants. SF Symbol optical alignment insets are removed so command icons render inside the same bounds as application icons. The application name appears at the top and borderless action search sits eight points from the bottom, without a divider. The transition is direct, without a morph animation. Escape, Command-K, an outside click, or switching away closes it and restores the pill. Closing while Conjure remains active restores launcher search focus; switching away does not steal focus back. Return in action search chooses the visible action rather than launching the underlying application.
The actions selector is an arrowless panel inside the launcher, aligned to the bottom and right edges of the footer action pill, replacing it visually while open rather than floating above it. It shares the launcher's frosted Sunset background, 38-point selection row height, 22×22-point icon boxes with 12-point icon-to-text spacing, 14-point action and search text, rounded selection styling, and Return key badge; selection width follows the panel. Application and command rows use the same sizing constants. SF Symbol optical alignment insets are removed so command icons render inside the same bounds as application icons. The application name appears at the top and borderless action search sits eight points from the bottom, without a divider. Native animations crossfade the panel and footer pill: 160 milliseconds to open and 120 milliseconds to close, with unchanged geometry. Reduce Motion disables the animation. Rapid reopening invalidates stale dismissal completions, and closing panels immediately stop intercepting input. Escape, Command-K, an outside click, or switching away closes it and restores the pill. Closing while Conjure remains active restores launcher search focus; switching away does not steal focus back. Return in action search chooses the visible action rather than launching the underlying application.
Discovery includes the application bundle and exact bundle-ID paths in your Library: Preferences, Caches, Application Support, Logs, Saved Application State, Application Scripts, and Containers. Embedded extension identifiers are included. App-group entitlements are read from validated native code signatures; related shared Group Containers and Application Scripts remain unchecked because other applications may use them. Conjure does not guess name-based leftovers or include package receipts. This is conservative discovery, not a guarantee that every associated file is found.
@@ -10,16 +10,19 @@ final class ApplicationActionsController: NSViewController, NSSearchFieldDelegat
private let applicationLabel = NSTextField(labelWithString: "")
private var mouseMonitor: Any?
private weak var coveredPill: NSView?
private var coveredPillOpacity: Float = 1
private var coveredPillAlpha: CGFloat = 1
private var isClosing = false
private var transitionGeneration = 0
private var panel: ActionsPanelView { view as! ActionsPanelView }
var uninstall: (() -> Void)?
var closed: (() -> Void)?
var isShown: Bool { viewIfLoaded?.superview != nil }
var isShown: Bool { viewIfLoaded?.superview != nil && !isClosing }
init() { super.init(nibName: nil, bundle: nil) }
required init?(coder: NSCoder) { fatalError("Conjure creates actions programmatically") }
override func loadView() {
view = NSView()
view = ActionsPanelView()
view.wantsLayer = true
view.layer?.shadowColor = NSColor.black.cgColor
view.layer?.shadowOpacity = 0.35
@@ -138,6 +141,12 @@ final class ApplicationActionsController: NSViewController, NSSearchFieldDelegat
applicationLabel.stringValue = application.name
search.stringValue = ""
controlTextDidChange(Notification(name: NSControl.textDidChangeNotification))
transitionGeneration += 1
isClosing = false
panel.acceptsInteraction = true
panel.setAccessibilityHidden(false)
if view.superview == nil {
view.alphaValue = 0
view.translatesAutoresizingMaskIntoConstraints = false
host.addSubview(view)
NSLayoutConstraint.activate([
@@ -145,9 +154,14 @@ final class ApplicationActionsController: NSViewController, NSSearchFieldDelegat
view.bottomAnchor.constraint(equalTo: pill.bottomAnchor)
])
coveredPill = pill
coveredPillOpacity = pill.layer?.opacity ?? 1
pill.layer?.opacity = 0
coveredPillAlpha = pill.alphaValue
}
pill.setAccessibilityHidden(true)
NSAnimationContext.runAnimationGroup { context in
context.duration = NSWorkspace.shared.accessibilityDisplayShouldReduceMotion ? 0 : 0.16
view.animator().alphaValue = 1
pill.animator().alphaValue = 0
}
window.makeFirstResponder(search)
(search.currentEditor() as? NSTextView)?.insertionPointColor = SunsetPalette.accent
mouseMonitor = NSEvent.addLocalMonitorForEvents(matching: [.leftMouseDown, .rightMouseDown]) { [weak self, weak pill] event in
@@ -165,12 +179,26 @@ final class ApplicationActionsController: NSViewController, NSSearchFieldDelegat
func close() {
guard isShown else { return }
transitionGeneration += 1
let generation = transitionGeneration
isClosing = true
panel.acceptsInteraction = false
panel.setAccessibilityHidden(true)
if let mouseMonitor { NSEvent.removeMonitor(mouseMonitor) }
mouseMonitor = nil
coveredPill?.layer?.opacity = coveredPillOpacity
coveredPill?.setAccessibilityHidden(false)
coveredPill = nil
view.removeFromSuperview()
NSAnimationContext.runAnimationGroup { context in
context.duration = NSWorkspace.shared.accessibilityDisplayShouldReduceMotion ? 0 : 0.12
view.animator().alphaValue = 0
coveredPill?.animator().alphaValue = coveredPillAlpha
} completionHandler: { [weak self] in
MainActor.assumeIsolated {
guard let self, self.transitionGeneration == generation, self.isClosing else { return }
self.view.removeFromSuperview()
self.coveredPill = nil
self.isClosing = false
}
}
closed?()
}
@@ -199,6 +227,15 @@ final class ApplicationActionsController: NSViewController, NSSearchFieldDelegat
}
}
@MainActor
private final class ActionsPanelView: NSView {
var acceptsInteraction = true
override func hitTest(_ point: NSPoint) -> NSView? {
acceptsInteraction ? super.hitTest(point) : nil
}
}
@MainActor
private final class ActionIconView: NSImageView {
// SF Symbol optical insets otherwise enlarge a 22-point icon box beyond application icon sizing.