Skip to content

Make installHostKeyRouting the single entry for host focus handling - #176

Merged
satoshi-szk merged 1 commit into
novonotes:novonotes-internalfrom
satoshi-assistant:claude/host-key-routing-single-entry
Oct 16, 2026
Merged

satoshi-szk merged 1 commit into
novonotes:novonotes-internalfrom
satoshi-assistant:claude/host-key-routing-single-entry

Conversation

@satoshi-assistant

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #175. After installHostKeyRouting was added, the focus restorer could be obtained in two ways (createHostFocusRestorer and the routing's restoreHostFocus), and the routing options were still named HostFocusRestorerOptions. Two entry points make it easy to restore focus without installing the routing.

Public API after this change:

  • installHostKeyRouting(runtime, options?) returns { restoreHostFocus, dispose }
  • HostKeyRouting, HostKeyRoutingOptions
  • defaultIsEditableElement, EditableElementPredicate: kept so that a GUI can extend the editable predicate

Removed from the public API: createHostFocusRestorer, HostFocusRestorer, HostFocusRestorerOptions. They remain internal building blocks.

wrac-gain now installs the routing and uses the returned restorer.

Tests

  • wrac-frontend-runtime: npm test, npm run build
  • wrac-gain: vite build

🤖 Generated with Claude Code

After installHostKeyRouting was added, a GUI could get the focus restorer either from createHostFocusRestorer or from the routing, and the routing options were still named after the restorer. Two entry points invite GUIs that restore focus without installing the routing.

createHostFocusRestorer and HostFocusRestorer are now internal, the options are HostKeyRoutingOptions, and wrac-gain uses the restorer returned by installHostKeyRouting. defaultIsEditableElement and EditableElementPredicate stay public so a GUI can extend the editable predicate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@satoshi-szk
satoshi-szk merged commit e194b4d into novonotes:novonotes-internal Oct 16, 2026
8 checks passed
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.

2 participants