Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
ce6a253
Refactor: Swift code quality improvements across Pika codebase
superhighfives Mar 9, 2026
cbfd845
Refactor: dissolve Cula.swift into focused NSColor extension files
superhighfives Mar 9, 2026
4da9e2c
Fix: cancel existing hoverTask before creating new one in SwapButtonS…
superhighfives Mar 9, 2026
c64be52
Add PikaTests unit test suite and CI workflow
superhighfives Mar 9, 2026
b388de8
Fix test compilation errors
superhighfives Mar 9, 2026
355459e
Fix CI: split build-for-testing from test-without-building
superhighfives Mar 9, 2026
619f311
Fix CI: broaden xctestrun search and show raw test output
superhighfives Mar 10, 2026
b5cbb11
Add workflow_dispatch trigger to allow manual test runs
superhighfives Mar 10, 2026
83d46de
Fix WCAGComplianceTests: use gray with contrast in 4.5-7:1 range
superhighfives Mar 10, 2026
3693d4d
Refactor: slim AppDelegate, fix swiftlint, reorganise folders
superhighfives Mar 10, 2026
ff2e19b
Initial plan (#185)
Copilot Mar 10, 2026
a3b1a8c
Fix menu width
superhighfives Mar 10, 2026
5741e41
Fixed spacing and menu
superhighfives Mar 10, 2026
8c68189
Fix button flicker, SwiftLint violations, and color space test sensit…
superhighfives Mar 10, 2026
842fb03
Fix remaining SwiftLint violations, HSB hue edge case, and trailing c…
superhighfives Mar 10, 2026
855c815
Restore hover-driven alt text without flicker
superhighfives Mar 10, 2026
0573e9a
Fixed it
superhighfives Mar 10, 2026
bc9a4b9
Fix hover button animations: smooth expand/collapse with cooldown and…
superhighfives Mar 10, 2026
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
18 changes: 18 additions & 0 deletions Pika.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
22FE80B325BA0F820063759E /* KeyboardShortcutItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22FE80B225BA0F820063759E /* KeyboardShortcutItem.swift */; };
C49A11482DB394F500EE7E80 /* APCACompliance.swift in Sources */ = {isa = PBXBuildFile; fileRef = C49A11472DB394F500EE7E80 /* APCACompliance.swift */; };
C49A11492DB394F500EE7E80 /* APCACompliance.swift in Sources */ = {isa = PBXBuildFile; fileRef = C49A11472DB394F500EE7E80 /* APCACompliance.swift */; };
CC000001000000000000AAA1 /* Color+PikaControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC000001000000000000AAA0 /* Color+PikaControl.swift */; };
CC000001000000000000AAA2 /* Color+PikaControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC000001000000000000AAA0 /* Color+PikaControl.swift */; };
CC000001000000000000AAB1 /* NSColor+HSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC000001000000000000AAB0 /* NSColor+HSL.swift */; };
CC000001000000000000AAB2 /* NSColor+HSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC000001000000000000AAB0 /* NSColor+HSL.swift */; };
CC000001000000000000AAC1 /* NSColor+Lab.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC000001000000000000AAC0 /* NSColor+Lab.swift */; };
CC000001000000000000AAC2 /* NSColor+Lab.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC000001000000000000AAC0 /* NSColor+Lab.swift */; };
EA0C525025AA729300AFF716 /* Visualisation.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0C524F25AA729300AFF716 /* Visualisation.swift */; };
EA0C526025AB5A2B00AFF716 /* NavigationMenuItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0C525F25AB5A2B00AFF716 /* NavigationMenuItems.swift */; };
EA0C526425AB5D1700AFF716 /* PikaWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA0C526325AB5D1700AFF716 /* PikaWindow.swift */; };
Expand Down Expand Up @@ -152,6 +158,9 @@
C1BF64202C1AE53C004D33DD /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = "<group>"; };
C1BF64212C1AE53C004D33DD /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Main.strings"; sourceTree = "<group>"; };
C49A11472DB394F500EE7E80 /* APCACompliance.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APCACompliance.swift; sourceTree = "<group>"; };
CC000001000000000000AAA0 /* Color+PikaControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+PikaControl.swift"; sourceTree = "<group>"; };
CC000001000000000000AAB0 /* NSColor+HSL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSColor+HSL.swift"; sourceTree = "<group>"; };
CC000001000000000000AAC0 /* NSColor+Lab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSColor+Lab.swift"; sourceTree = "<group>"; };
EA0C524F25AA729300AFF716 /* Visualisation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Visualisation.swift; sourceTree = "<group>"; };
EA0C525F25AB5A2B00AFF716 /* NavigationMenuItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationMenuItems.swift; sourceTree = "<group>"; };
EA0C526325AB5D1700AFF716 /* PikaWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PikaWindow.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -336,6 +345,9 @@
EA635DCB25B3B42B0014D91A /* WCAGCompliance.swift */,
22EF1D9A25B7AA18001102FA /* Sequence.swift */,
C49A11472DB394F500EE7E80 /* APCACompliance.swift */,
CC000001000000000000AAA0 /* Color+PikaControl.swift */,
CC000001000000000000AAB0 /* NSColor+HSL.swift */,
CC000001000000000000AAC0 /* NSColor+Lab.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -638,6 +650,9 @@
F8ABAC5A2EAAD0DF008CD152 /* ColorPickOverlay.swift in Sources */,
EAD0B6F8259CF29300FA2F67 /* AboutView.swift in Sources */,
C49A11482DB394F500EE7E80 /* APCACompliance.swift in Sources */,
CC000001000000000000AAA1 /* Color+PikaControl.swift in Sources */,
CC000001000000000000AAB1 /* NSColor+HSL.swift in Sources */,
CC000001000000000000AAC1 /* NSColor+Lab.swift in Sources */,
EAA8AE1925B8EC070049299B /* KeyboardShortcutKey.swift in Sources */,
EA0C526F25AB683400AFF716 /* EyedropperButton.swift in Sources */,
EA72BB8425A5334B008205E7 /* MetalShader.metal in Sources */,
Expand Down Expand Up @@ -672,6 +687,9 @@
EAE23DAC2D032A38005BB270 /* PikaTouchBar.swift in Sources */,
EAE23DAD2D032A38005BB270 /* LoadColors.swift in Sources */,
C49A11492DB394F500EE7E80 /* APCACompliance.swift in Sources */,
CC000001000000000000AAA2 /* Color+PikaControl.swift in Sources */,
CC000001000000000000AAB2 /* NSColor+HSL.swift in Sources */,
CC000001000000000000AAC2 /* NSColor+Lab.swift in Sources */,
EAE23DAE2D032A38005BB270 /* SplashTouchBar.swift in Sources */,
EAE23DAF2D032A38005BB270 /* OverflowContentViewModifier.swift in Sources */,
EAE23DB02D032A38005BB270 /* KeyboardShortcutGrid.swift in Sources */,
Expand Down
38 changes: 19 additions & 19 deletions Pika/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
}
preferencesWindow.makeKeyAndOrderFront(nil)
preferencesWindow.makeFirstResponder(nil)
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerPreferences), object: self)
notificationCenter.post(name: .triggerPreferences, object: self)
}

@IBAction func openSplashWindow(_: Any?) {
Expand All @@ -369,77 +369,77 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
}

@IBAction func triggerPickForeground(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerPickForeground), object: self)
notificationCenter.post(name: .triggerPickForeground, object: self)
}

@IBAction func triggerPickBackground(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerPickBackground), object: self)
notificationCenter.post(name: .triggerPickBackground, object: self)
}

@IBAction func triggerCopyForeground(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerCopyForeground), object: self)
notificationCenter.post(name: .triggerCopyForeground, object: self)
}

@IBAction func triggerCopyBackground(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerCopyBackground), object: self)
notificationCenter.post(name: .triggerCopyBackground, object: self)
}

@IBAction func triggerSystemPickerForeground(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerSystemPickerForeground), object: self)
notificationCenter.post(name: .triggerSystemPickerForeground, object: self)
}

@IBAction func triggerSystemPickerBackground(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerSystemPickerBackground), object: self)
notificationCenter.post(name: .triggerSystemPickerBackground, object: self)
}

@IBAction func triggerSwap(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerSwap), object: self)
notificationCenter.post(name: .triggerSwap, object: self)
}

@IBAction func triggerUndo(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerUndo), object: self)
notificationCenter.post(name: .triggerUndo, object: self)
undoManager.undo()
}

@IBAction func triggerRedo(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerRedo), object: self)
notificationCenter.post(name: .triggerRedo, object: self)
undoManager.redo()
}

@IBAction func triggerCopyText(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerCopyText), object: self)
notificationCenter.post(name: .triggerCopyText, object: self)
}

@IBAction func triggerCopyData(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerCopyData), object: self)
notificationCenter.post(name: .triggerCopyData, object: self)
}

@IBAction func triggerFormatHex(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerFormatHex), object: self)
notificationCenter.post(name: .triggerFormatHex, object: self)
}

@IBAction func triggerFormatRGB(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerFormatRGB), object: self)
notificationCenter.post(name: .triggerFormatRGB, object: self)
}

@IBAction func triggerFormatHSB(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerFormatHSB), object: self)
notificationCenter.post(name: .triggerFormatHSB, object: self)
}

@IBAction func triggerFormatHSL(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerFormatHSL), object: self)
notificationCenter.post(name: .triggerFormatHSL, object: self)
}

@IBAction func triggerFormatOpenGL(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerFormatOpenGL), object: self)
notificationCenter.post(name: .triggerFormatOpenGL, object: self)
}

@IBAction func triggerFormatLAB(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerFormatLAB), object: self)
notificationCenter.post(name: .triggerFormatLAB, object: self)
}

@IBAction func triggerFormatOKLCH(_: Any) {
notificationCenter.post(name: Notification.Name(PikaConstants.ncTriggerFormatOKLCH), object: self)
notificationCenter.post(name: .triggerFormatOKLCH, object: self)
}

@IBAction func hidePika(_: Any) {
Expand Down
23 changes: 23 additions & 0 deletions Pika/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,29 @@ enum PikaConstants {
static let disabledFormats: [ColorFormat] = [.hex, .hsl, .opengl, .lab, .oklch]
}

extension Notification.Name {
static let triggerPickForeground = Notification.Name(PikaConstants.ncTriggerPickForeground)
static let triggerPickBackground = Notification.Name(PikaConstants.ncTriggerPickBackground)
static let triggerCopyForeground = Notification.Name(PikaConstants.ncTriggerCopyForeground)
static let triggerCopyBackground = Notification.Name(PikaConstants.ncTriggerCopyBackground)
static let triggerCopyText = Notification.Name(PikaConstants.ncTriggerCopyText)
static let triggerCopyData = Notification.Name(PikaConstants.ncTriggerCopyData)
static let triggerSystemPickerForeground = Notification.Name(PikaConstants.ncTriggerSystemPickerForeground)
static let triggerSystemPickerBackground = Notification.Name(PikaConstants.ncTriggerSystemPickerBackground)
static let triggerSwap = Notification.Name(PikaConstants.ncTriggerSwap)
static let triggerUndo = Notification.Name(PikaConstants.ncTriggerUndo)
static let triggerRedo = Notification.Name(PikaConstants.ncTriggerRedo)
static let triggerPreferences = Notification.Name(PikaConstants.ncTriggerPreferences)
static let triggerFormatHex = Notification.Name(PikaConstants.ncTriggerFormatHex)
static let triggerFormatRGB = Notification.Name(PikaConstants.ncTriggerFormatRGB)
static let triggerFormatHSB = Notification.Name(PikaConstants.ncTriggerFormatHSB)
static let triggerFormatHSL = Notification.Name(PikaConstants.ncTriggerFormatHSL)
static let triggerFormatOpenGL = Notification.Name(PikaConstants.ncTriggerFormatOpenGL)
static let triggerFormatLAB = Notification.Name(PikaConstants.ncTriggerFormatLAB)
static let triggerFormatOKLCH = Notification.Name(PikaConstants.ncTriggerFormatOKLCH)
static let triggerQuit = Notification.Name(PikaConstants.ncTriggerQuit)
}

enum PikaText {
static let textAppName = NSLocalizedString("app.name", comment: "Pika")

Expand Down
9 changes: 9 additions & 0 deletions Pika/Extensions/Color+PikaControl.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import SwiftUI

extension Color {
static func pikaControlBackground(for colorScheme: ColorScheme) -> Color {
colorScheme == .dark
? Color(red: 27 / 255, green: 27 / 255, blue: 27 / 255)
: Color(red: 233 / 255, green: 233 / 255, blue: 233 / 255)
}
}
Loading