Skip to content

Share the nominal key declaration overlap contract - #215

Merged
trissim merged 1 commit into
mainfrom
work/toad-keymap--declaration-overlap
Oct 30, 2026
Merged

trissim merged 1 commit into
mainfrom
work/toad-keymap--declaration-overlap

Conversation

@trissim

@trissim trissim commented Oct 30, 2026

Copy link
Copy Markdown

Summary

1 source file, one nominal declaration metaclass, one default overlap implementation. Paired with OpenHCSDev/toad#1338 (P917).

Declaration ownership

Before: KeyInvocation.overlaps_declaration(type[KeyDeclaration]) admits only native command classes. Toad's MenuDeclaration is itself a class-valued invocation and declares keys through its metaclass; passing it violates that annotation. Native and Menu families also separately supplied the default permits_key_overlap=False answer.

After: KeyDeclarationType(ABCMeta) is the nominal contract for key-declaring classes and supplies the default overlap method. KeyDeclaration uses that metaclass. Both overlap argument annotations consume KeyDeclarationType. Toad composes it with FamilyMeta for both Action and Menu, removes MenuCommand's duplicate default, and keeps only the real mutually-exclusive family overrides.

No cast, Any, bare-type widening, registration roster, Toad forwarding shim, or behavior-kind test. Existing double dispatch and explicit overlap decisions remain.

Source evidence

Retained source inventory: 882 Toad source/test + Textual source modules, zero parse omissions. Read the native invocation/declaration methods and every Toad overlap override. Whole-source search: rg -n 'permits_key_overlap|overlaps_declaration|KeyDeclarationType' src in both repositories. Source evidence does not establish runtime metaclass composition.

Verification and remaining owner controls

No author pytest, collection, type-checker, imports, UI/provider or installation runs: integration owns combined qualification. Required controls: import Action/Menu with the paired source; verify C3/metaclass compatibility, native↔Menu and native↔native overlap directions, exclusive collapse/expand alternatives, remap/unbind/Reset, and captured Menu effects. The Toad PR's genuine annotation-cycle growth remains explicitly open for integration's owner shape.

Assumed: paired runtime import/type qualification, hosted gate status and physical keyboard acceptance are not established by this source diff.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 17:29

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim merged commit 76f9ef7 into main Oct 30, 2026
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