fix(hig): rebuild the key view loop so Tab crosses window panes (#1490)#1512
Conversation
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
There was a problem hiding this comment.
💡 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() |
There was a problem hiding this comment.
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 👍 / 👎.
Part of #1490 (keyboard, focus, accessibility). The cross-pane Tab item.
MainSplitViewControllernever calledrecalculateKeyViewLoop(), so the AppKit key view loop had no defined traversal across the threeNSSplitViewItempanes (sidebar, detail, inspector). This callswindow.recalculateKeyViewLoop()at the end ofviewWillAppear, the documented mechanism for letting AppKit rebuild the geometric Tab order (leading sidebar to trailing detail to inspector). Both the sidebarListand the data-gridNSTableVieware 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/NSHostingControllerboundary, 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.