Skip to content

feat(dashboard): Phase 1 — SwiftUI migration of native dashboard - #11

Merged
devlikebear merged 20 commits into
mainfrom
feat/dashboard-v2-phase1
Apr 18, 2026
Merged

feat(dashboard): Phase 1 — SwiftUI migration of native dashboard#11
devlikebear merged 20 commits into
mainfrom
feat/dashboard-v2-phase1

Conversation

@devlikebear

Copy link
Copy Markdown
Owner

Summary

DashboardApp v2 Phase 1: AppKit DashboardApp/main.swift (429 lines)을 SwiftUI로 전면 마이그레이션. 기존 기능 1:1 포팅 + 여러 사용성 개선.

Design spec: docs/superpowers/specs/2026-04-17-dashboard-v2-design.md
Implementation plan: docs/superpowers/plans/2026-04-17-dashboard-v2-phase1.md

Changes

Architecture:

  • DashboardAppMain.swift — SwiftUI @main entry + NSApplicationDelegateAdaptor bridge
  • DashboardViewModel.swift@MainActor ObservableObject with 1-second polling
  • SystemIO.swift — platform I/O (state/config load, launchd query, idle detection)
  • CircularProgressRing.swift, StatusHeaderView.swift, TimerTabView.swift — SwiftUI views

Breaking change:

  • macOS deployment target bumped from .v12.v14 (required for .onKeyPress / controlActiveState; also prerequisite for Swift Charts in Phase 2)

Usability fixes added during manual testing:

  • Keyboard shortcuts (q/r/b) via physical keyCode (IME-independent — 한글 입력 상태에서도 동작)
  • Window focus acquisition via NSApp.activate + makeKeyAndOrderFront
  • Visual feedback: controlActiveState → opacity 1.0 when active, 0.55 when backgrounded
  • Tap-to-focus restores key window state
  • Keyboard shortcut hint text at bottom of Timer tab

Test plan

  • go test ./... passes
  • cd helpers && swift test passes (55 tests)
  • make build succeeds — all 3 Swift binaries + Go CLI built
  • bin/break-dashboard launches and shows correct state
  • bin/break-reminder dashboard --gui launches via CLI wrapper
  • Status updates every second
  • Reset / Force Break buttons work
  • q/r/b shortcuts work (including Korean IME mode)
  • Floating window with drag-by-background
  • Opacity dims to 55% when window loses focus

Brainstormed and designed SwiftUI migration plan for the native
macOS dashboard with AI Summary, data visualization, mascot system,
animations, and theme support across 4 phases.
Add 4 phase plans for the DashboardApp v2 SwiftUI migration:
- Phase 1: SwiftUI migration of existing AppKit dashboard
- Phase 2: Tabs + data visualization with Swift Charts
- Phase 3: AI Summary integration via claude/codex CLI
- Phase 4: Visual enhancements (mascot, animations, theme system)

Each phase is independently releasable with bite-sized TDD tasks.
Adds ObservableObject ViewModel to back the SwiftUI DashboardApp migration.
Tests for pure HelperCore progress functions pass; I/O function stubs resolved in Task 3.
Replace SwiftUI onKeyPress (requires focus) with NSEvent.addLocalMonitorForEvents
so q/r/b shortcuts work reliably regardless of keyboard focus state.
Track key-window state via NSWindow notifications and dim content to
0.55 opacity when unfocused. Tap anywhere on the surface to force
NSApp.activate + makeKeyAndOrderFront, ensuring Cmd+R/Cmd+B shortcuts
reliably fire. configureWindow() also calls activate+makeKeyAndOrderFront
on initial setup so the window grabs focus immediately on launch.
…hortcuts

Replace NSEvent local monitor + NotificationCenter key-window observers with
@focusstate, .onKeyPress, and @Environment(\.controlActiveState). Removes
isWindowActive from the view model; opacity and keyboard focus are now driven
entirely from SwiftUI's environment.
@devlikebear
devlikebear merged commit e9e512e into main Apr 18, 2026
1 check passed
@devlikebear
devlikebear deleted the feat/dashboard-v2-phase1 branch April 18, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant