Skip to content

fix(hig): rebuild the key view loop so Tab crosses window panes (#1490)#1512

Merged
datlechin merged 2 commits into
mainfrom
a11y/tab-between-panes
May 30, 2026
Merged

fix(hig): rebuild the key view loop so Tab crosses window panes (#1490)#1512
datlechin merged 2 commits into
mainfrom
a11y/tab-between-panes

Conversation

@datlechin

Copy link
Copy Markdown
Member

Part of #1490 (keyboard, focus, accessibility). The cross-pane Tab item.

MainSplitViewController never called recalculateKeyViewLoop(), so the AppKit key view loop had no defined traversal across the three NSSplitViewItem panes (sidebar, detail, inspector). This calls window.recalculateKeyViewLoop() at the end of viewWillAppear, the documented mechanism for letting AppKit rebuild the geometric Tab order (leading sidebar to trailing detail to inspector). Both the sidebar List and the data-grid NSTableView are key-view-loop participants, so Tab should now move focus between panes.

This is the one item the HIG research flagged as not explicitly documented for an NSViewRepresentable/NSHostingController boundary, so it needs a real build to confirm Tab actually crosses from the SwiftUI sidebar into the representable grid. The call is harmless if a given pane does not participate (it just orders the views that do), and there is no custom focus handling.

Lint clean, style gate clean.

@datlechin datlechin merged commit 1dd10de into main May 30, 2026
3 checks passed
@datlechin datlechin deleted the a11y/tab-between-panes branch May 30, 2026 07:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79064648f1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


installObservers()
recomputeWindowMinSize()
window.recalculateKeyViewLoop()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recalculate the loop after materializing the inspector

When the inspector is hidden on launch, this marks the key-view loop dirty before the inspector pane contains its real controls (viewDidLoad installs Color.clear until showInspector() calls materializeInspectorIfNeeded()). If the user tabs anywhere before opening the inspector, AppKit will rebuild the loop without those inspector views; later showInspector() swaps in the inspector and expands the split item without another recalculateKeyViewLoop(), so Tab still cannot reach the inspector pane. Consider recalculating after materializing/showing panes as well as on initial appearance.

Useful? React with 👍 / 👎.

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