Bug Description
When FSNotes launches, no view has keyboard focus. The last-viewed note is displayed correctly, but the folder in the sidebar is grayed out, the note in the notes list is grayed out, and no pane responds to keyboard input until the user clicks somewhere.
Steps to Reproduce
- Open FSNotes
- Observe the sidebar and notes list — both selections are gray (unfocused)
- Press Up/Down arrow keys — nothing responds
Expected Behavior
On launch, the notes list should have keyboard focus (blue selection), allowing immediate keyboard navigation.
Actual Behavior
No view is first responder. All selections appear gray/unfocused. The user must click on a pane before keyboard navigation works.
Root Cause
In ViewController.swift, neither viewDidLoad() nor viewDidAppear() sets an initial first responder. The storyboard's initialFirstResponder outlet is not connected, so AppKit has no default target.
Proposed Fix
Set focus to the notes list inside configureNoteList(), after the updateTable completion handler finishes loading content. This must be placed inside the async completion — not in viewDidAppear() or after the configureNoteList() call — because updateTable() loads data asynchronously and dispatches back to the main queue:
private func configureNoteList() {
updateTable() {
DispatchQueue.main.async {
// ... existing welcome note and window restore code ...
// Set initial focus to notes list after content is loaded
NSApp.mainWindow?.makeFirstResponder(self.notesTableView)
// ... existing preLoadProjectsData call ...
}
}
}
Placing makeFirstResponder anywhere earlier (e.g. viewDidAppear, or synchronously after configureNoteList()) has no effect because the table has no content yet — updateTable hasn't completed.
Environment
- macOS
- FSNotes latest (main branch)
Bug Description
When FSNotes launches, no view has keyboard focus. The last-viewed note is displayed correctly, but the folder in the sidebar is grayed out, the note in the notes list is grayed out, and no pane responds to keyboard input until the user clicks somewhere.
Steps to Reproduce
Expected Behavior
On launch, the notes list should have keyboard focus (blue selection), allowing immediate keyboard navigation.
Actual Behavior
No view is first responder. All selections appear gray/unfocused. The user must click on a pane before keyboard navigation works.
Root Cause
In
ViewController.swift, neitherviewDidLoad()norviewDidAppear()sets an initial first responder. The storyboard'sinitialFirstResponderoutlet is not connected, so AppKit has no default target.Proposed Fix
Set focus to the notes list inside
configureNoteList(), after theupdateTablecompletion handler finishes loading content. This must be placed inside the async completion — not inviewDidAppear()or after theconfigureNoteList()call — becauseupdateTable()loads data asynchronously and dispatches back to the main queue:Placing
makeFirstResponderanywhere earlier (e.g.viewDidAppear, or synchronously afterconfigureNoteList()) has no effect because the table has no content yet —updateTablehasn't completed.Environment