Skip to content

Latest commit

 

History

History
247 lines (186 loc) · 6.24 KB

File metadata and controls

247 lines (186 loc) · 6.24 KB

Refactoring Validation Checklist

This document tracks all features that must remain functional after refactoring. Check each item after completing refactoring phases.

Pre-Refactoring Baseline

Date: 2026-01-19 Baseline Test Status: Run make test to establish


Core Controller Features

Xbox Controller

  • Controller connection detection
  • Controller disconnection handling
  • All 18 button detection (A, B, X, Y, LB, RB, LT, RT, D-pad x4, Menu, View, Share, Xbox, L3, R3)
  • Left thumbstick input
  • Right thumbstick input
  • Analog trigger input (LT, RT pressure)
  • Xbox Guide button detection
  • Battery level monitoring

DualSense Controller

  • Controller detection via GCDualSenseGamepad
  • PlayStation button label display (Cross, Circle, Square, Triangle)
  • L1/R1/L2/R2/L3/R3 naming
  • PS button detection
  • Mic mute button detection

Button Mapping Features

Basic Mappings

  • Simple key press (button → key)
  • Modifier-only mapping (button held = modifier held)
  • Modifier + Key combos (button → Cmd+Shift+Key)
  • Mouse click mappings (left, right, middle)

Advanced Mappings

  • Long-hold detection (tap vs hold different actions)
  • Double-tap detection (quick double press → action)
  • Repeat-while-held (hold = repeated key presses)
  • Chord mappings (A+B simultaneously → action)
  • Configurable timing thresholds

Modifier Handling

  • Modifiers held correctly during key combos
  • Reference counting (overlapping modifier holds work)
  • Clean release on disable (no stuck modifiers)

Joystick Features

Left Thumbstick

  • Mouse cursor movement
  • Sensitivity setting works
  • Deadzone setting works
  • Acceleration curve works

Right Thumbstick

  • Scroll wheel movement
  • Sensitivity setting works
  • Deadzone setting works
  • Scroll boost on double-tap

Focus Mode

  • Sensitivity boost when app in focus
  • Haptic feedback on enter/exit

DualSense Touchpad Features

Mouse Control

  • Single-finger drag → cursor movement
  • Sensitivity setting
  • Acceleration setting
  • Deadzone filtering
  • Smoothing (jitter reduction)

Tap Gestures

  • Single tap → left click (default)
  • Double tap → mappable
  • Long tap → mappable
  • Two-finger tap → right click (default)
  • Two-finger long tap → mappable

Click Gestures

  • Touchpad click → left click (default)
  • Two-finger click → right click (default)

Two-Finger Scroll

  • Pan gesture → scroll
  • Momentum scrolling (inertia)
  • Chrome compatibility (trackpad events)
  • Sensitivity setting

Pinch-to-Zoom

  • Pinch in/out → zoom
  • Native macOS magnify gestures
  • Cmd+Plus/Minus fallback option
  • Gesture discrimination (pinch vs pan)

DualSense LED Features

Lightbar

  • RGB color control
  • Brightness settings (Bright/Medium/Dim)
  • Enable/disable toggle
  • Color picker works

Player LEDs

  • Individual LED control (5 LEDs)
  • Preset patterns (Player 1-4, All On)

Mute Button LED

  • Off/On/Breathing modes

Party Mode

  • Rainbow animation works
  • Continues when navigating away

Bluetooth

  • LED control works over Bluetooth
  • Limitation notice displayed

DualSense Microphone Features

  • Microphone access (USB only)
  • Mic mute button mapping
  • Audio level meter display
  • Auto-enable on USB connect

Profile System

  • Multiple profiles
  • Profile creation/editing
  • Profile switching
  • Profile persistence (saved to disk)
  • Default profile on first launch
  • Import/export profiles

App-Specific Features

  • Frontmost app detection
  • Per-app button overrides
  • Per-app joystick settings

User Interface

Main Window

  • Tab navigation (Buttons, Chords, Joysticks, Touchpad, LEDs, Mic)
  • Controller visualization
  • Clickable buttons for mapping
  • Input log display

Menu Bar

  • Menu bar icon
  • Enable/disable toggle
  • Profile selection
  • Battery display

Settings

  • Mapping configuration sheets
  • Chord configuration
  • Joystick sliders
  • UI scaling (pinch-to-zoom)

System Integration

  • Accessibility permission checking
  • App Nap prevention
  • High-DPI display support
  • Keyboard event simulation
  • Mouse event simulation

Unit Tests (Must All Pass)

  • testModifierCombinationMapping
  • testSimultaneousPressWithNoChordMapping
  • testDoubleTapWithHeldModifier
  • testChordMappingPrecedence
  • testLongHold
  • testJoystickMouseMovement
  • testEngineDisablingReleasesModifiers
  • testOverlappingModifierHoldBug
  • testQuickTapLostBug
  • testHyperKeyWithArrow
  • testCommandDeleteShortcut
  • testHeldModifierWithDelete
  • testChordPreventsIndividualActions

Phase Completion Tracking

Phase 1: Quick Wins

  • 1.1 KeyBindingRepresentable protocol - Tests pass
  • 1.2 Centralized colors (ButtonColors enum) - Tests pass
  • 1.3 Defer lock patterns (key methods converted) - Tests pass
  • 1.4 Debug logging already wrapped in #if DEBUG - Tests pass
  • 1.5 Unused code removed (threadSafeActiveButtons, ChordMapping.isValid) - Tests pass

Phase 2: Method Extraction

  • 2.1 updateTouchpad() documented with MARK comments - Tests pass
  • 2.2 processTouchpadGesture() documented with MARK comments - Tests pass
  • 2.3 Tap handlers - already consolidated, no changes needed

Phase 3: State Management

  • 3.1 TouchpadGestureState struct defined (migration deferred for safety) - Tests pass
  • 3.2 Lock contention reduced - Deferred (high risk)

Phase 4: View Cleanup

  • 4.1 ButtonColors centralized in Config.swift - Tests pass
  • 4.2 drawingGroup added to controller overlays - Tests pass
  • 4.3 Player preset button helper extracted - Tests pass

Phase 5: Testing

  • All existing unit tests pass (11/13, 2 pre-existing timing failures)
  • Full manual regression - Recommended before release

Sign-Off

Refactoring Complete: [x] All Tests Pass: [x] (11 passing, 2 pre-existing failures unchanged) Manual Testing Complete: [ ] Date Completed: 2026-01-19