Skip to content

Keep focus where you're working, and open the dashboard to assistive tools - #32

Open
edward-mcnair wants to merge 1 commit into
kemalandic:mainfrom
edward-mcnair:dashboard-focus-accessibility
Open

edward-mcnair wants to merge 1 commit into
kemalandic:mainfrom
edward-mcnair:dashboard-focus-accessibility

Conversation

@edward-mcnair

Copy link
Copy Markdown

What does this PR do?

Focus. The dashboard was an ordinary window that EdgeControl activated at launch, after wake and on every click. A newly launched app opens its first window on the display holding keyboard focus, so apps opened behind the kiosk on the dashboard's display.

This was measured with a probe app on a four-display setup:

  • With EdgeControl active and its key window on the dashboard's display, the probe's window opened there.
  • With another app active, it opened on the display in use, even while the dashboard held the keyboard as a non-activating panel.

The changes:

  • Non-activating panel: the dashboard is now a non-activating NSPanel (hidesOnDeactivate off). Clicks and touches work without EdgeControl becoming frontmost.
  • Keyboard on demand: the keyboard is borrowed only when needed. Text fields keep it until you click elsewhere; edit mode keeps it until it ends, so Esc and ⌘Z work.
  • Handing focus back: focus returns after launch, and when Settings or Quick Capture closes.
  • Safety switch: Dashboard Never Takes Focus in General (on by default) restores the old behaviour when turned off. The window is rebuilt; no relaunch needed.

Accessibility. KioskHostingView still hides the tree for drag performance, but now exposes it while VoiceOver, Switch Control, Voice Control or Full Keyboard Access is on.

  • Detection: the last two have no public flag. They're read from the com.apple.Accessibility preferences (FullKeyboardAccessEnabled, CommandAndControlEnabled), re-read at most every 2 s.
  • Fallback: an Always Available to Accessibility Tools setting covers a future macOS renaming those keys.
  • Labels and actions:
    • widget cards are named containers;
    • Edit and Settings have names;
    • touch buttons have the button trait and a default action;
    • the Settings switches are titled.
  • Getting the keyboard to the dashboard: activating EdgeControl on purpose (Cmd-Tab, the Dock) gives the dashboard the keyboard, so Full Keyboard Access and Voice Control can work in it. Use Dashboard with Keyboard in the menu-bar menu does the same when the app is hidden from the Dock.

Tests: DashboardFocusTests (6 cases). Activation-dependent behaviour was checked by hand rather than in CI, where it would be flaky.

Verified on a MacBook with two Studio Displays and a XENEON EDGE: launching apps, typing elsewhere while using the dashboard, edit mode, VoiceOver, Voice Control and Full Keyboard Access.

Screenshots

No visual change beyond two switches in Settings → General.

Checklist

  • Tested on macOS 14+ (macOS 27)
  • No third-party dependencies added
  • Follows existing code style (swift-format lint clean)

🤖 Generated with Claude Code

…tools

The dashboard was an ordinary window that EdgeControl activated at launch,
on every placement after wake and on every click. A newly launched app
opens its first window on the display holding keyboard focus, so while the
dashboard had focus, apps opened on the dashboard's display, behind the
kiosk. Measured with a probe app on a four-display setup: with EdgeControl
active and its key window on the dashboard's display, the probe's window
opened there; with another app active it opened on the display in use,
even while the dashboard held the keyboard as a non-activating panel.

Focus:
- The dashboard is a non-activating NSPanel (hidesOnDeactivate off). Clicks
  and touches work without EdgeControl becoming the frontmost app.
- The keyboard is borrowed only when needed: text fields (until you click
  elsewhere), edit mode (Esc, Cmd-Z) until it ends.
- Focus is handed back after launch, and when Settings or Quick Capture
  closes.
- "Dashboard Never Takes Focus" in General (on) restores the old behaviour
  when turned off; the window is rebuilt, no relaunch needed.

Accessibility:
- KioskHostingView keeps the tree hidden for drag performance, but exposes
  it while VoiceOver, Switch Control, Voice Control or Full Keyboard Access
  is on. The last two have no public flag; they're read from the
  com.apple.Accessibility preferences (FullKeyboardAccessEnabled,
  CommandAndControlEnabled), re-read at most every two seconds, with an
  "Always Available to Accessibility Tools" setting as the fallback.
- Widget cards are named containers; Edit and Settings have names; touch
  buttons and tappables carry the button trait and a default action; the
  Settings switches are titled.
- Activating EdgeControl on purpose (Cmd-Tab, the Dock) gives the dashboard
  the keyboard, so Full Keyboard Access and Voice Control can work in it;
  "Use Dashboard with Keyboard" in the menu-bar menu does the same when the
  app is hidden from the Dock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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