LearnNewsExamplesConnect
Frontmatter
assigneesneo-gpt-sophie
createdAtNov 6, 2026, 10:57 PM
updatedAtNov 7, 2026, 12:35 AM
githubUrlhttps://github.com/neomjs/neo/issues/20492
authorneo-gpt-sophie
commentsCount0
parentIssue15614
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 7, 2026, 12:35 AM

Demo B composes its keyboard host policy

Closed v13.4.0/archive-v13-4-0-chunk-4 enhancementairefactoringdashboard
neo-gpt-sophie
neo-gpt-sophie commented on Nov 6, 2026, 10:57 PM

Context and problem

This is the already-planned keyboard-host phase of #15614. At dev d7e91ec544, examples/dashboard/crossWindow/DemoBWorkspace.mjs remains 3,440 lines after the gesture phase. Its keyboard routing, target enumeration, preview and directional-focus policy form a coherent block of approximately 360 lines inside the composition owner. The aim is a smaller, readable host with unchanged behavior, not another command implementation.

Architectural reality and prescription

The Engine's src/dashboard/dock/interaction/KeyboardCommands.mjs already owns the cycle and terminal machine. Demo B owns the policy connecting it to live windows, documents, previews and announcements. Prescription checked: examples/dashboard/crossWindow/DemoBCrossWindowGesture.mjs — the existing state-free registered prototype mixin is the matching composition mechanism; moving this policy into Engine KeyboardCommands would promote demo-specific window names and three-host assumptions.

Create sibling DemoBKeyboardHost.mjs as a registered Neo.core.Base mixin. Extract these existing host methods: announceKeyboardOutcome, onDockHostKeyDown, resolveFocusedDockItem, resolveDockWorkspaceId, enumerateKeyboardTargets, setKeyboardTargetHighlight, commitKeyboardTransfer, focusNamedWindow, focusDockWorkspaceWindow. Preserve their public/wrappable host entry points. Methods needing Demo B's static IDs/grammar use small host facades passing those values to the extracted implementation, as the gesture phase already does; do not import the host back into the mixin.

Keep the command factory call, listener registration, command instance, origin-window field, highlight generation, maps, pane references and destruction on the host. Internal cross-calls must resolve current host methods. There is no additional controller instance, event listener, state owner or lifecycle.

The earlier TopologyLibrary candidate is rejected for this behavior-preserving phase: its cloned reads and refused invalid writes change the plain holder's contract. Transient libraries or mirrored collection state would add complexity. The parent retains the larger host/lifecycle and perspective work.

Contract Ledger

Surface Authority Required behavior Failure/lifetime boundary Docs Evidence
Keyboard host entry points Current DemoBWorkspace methods 703–1052 and constructor callbacks 601–612 Names, arguments, promises and dynamic method replacement remain callable on the same workspace Same absent-focus and main-only detach refusals Mixin JSDoc + facade references Existing identity/routing tests plus callback-replacement control
Highlight and announcements Current setKeyboardTargetHighlight, announceKeyboardOutcome Same shared preview payload, generation fence and every live announcement region Late geometry cannot paint over clear/new target/destruction Existing method JSDoc Existing delayed-highlight and three-window controls
Commit and focus Current commitKeyboardTransfer, focusDockWorkspaceWindow, focusNamedWindow Same Group commit/projection ordering and directional Main call Same Boolean focus refusal and unknown-item result Existing method JSDoc Unit controls + native keyboard journeys
Ownership Existing host constructor/destructor and Neo.setupClass mixins Host retains every collaborator and state; extracted methods execute with host this No new construction/destruction/listener path Class summary Source diff, focused/full unit suites and native journeys

Acceptance Criteria

  • The nine-method keyboard host policy is extracted into the sibling module; DemoBWorkspace gets smaller and the new module remains below the parent's 1,000-line target. Necessary static-ID facades stay in the host.
  • Public method wrappers and construction-time callbacks still observe methods replaced after construction; no collaborator instance or host state is duplicated.
  • Existing DemoBWorkspace, TourRunner and DockKeyboardCommands unit coverage passes, with targeted new boundary controls only where the extraction creates an otherwise unwitnessed seam; full unit suite passes.
  • Native DemoBKeyboardDetachNL journeys pass: real popup detach, cycle/highlight/Escape with zero mutation, popup-origin return and truthful focus announcements. Existing cross-window/third-claimant/tear-out/perspective regression witnesses remain green.
  • No changes to Engine keyboard/Group/gesture protocol behavior, model schemas, persistence, window acquisition policy or host lifecycle. Full JSDoc identifies the new module. The standard docs generator does not include examples, so no unrelated generator or hierarchy expansion is required.

Scope and avoided traps

No TopologyLibrary adoption, Workspace superclass swap, new controller, new keyboard grammar, new window behavior, or automatic persistence. This leaf does not close #15614 or certify its final 1,500-line target; remaining host/lifecycle decomposition stays there. The keyboard phase is independent of that ownership mapping and can proceed without changing it.

Decision Record impact: aligned with the existing composition boundary of neomjs/neo#adr:docking-design; no amendment. Structure-map gate: N/A, existing Body example role; sibling-file-lift beside the gesture mixin. Ownership: Sophie, immediate implementation of the current owned decomposition stream; not offered as an unclaimed contributor leaf.

Live latest-open + closed sweep: latest 20 created-descending open issues and closed search "DemoB keyboard" checked 2026-11-06T21:56Z; #15250, #15485 and #15517 retain delivered keyboard semantics, no extraction duplicate. Their Out of Scope sections were read. Recent all-status A2A showed no competing claim. MC problem-noun sweep returned unrelated initialization records; parent conversation/source govern this read. Own-assignment sweep: two open tickets (#9553, #6611), neither this surface.

Related: #15614; #20478; #20479; #15250; #15485; #15517.

Origin Session ID: 7367b697-abdc-4e46-963d-5c57378b3551 Retrieval Hint: DemoBWorkspace keyboard host decomposition dynamic facade directional focus highlight generation

tobiu referenced in commit 07e0cc8 - "chore(dashboard): compose Demo B keyboard host (#20492) (#20494) on Nov 7, 2026, 12:35 AM
tobiu closed this issue on Nov 7, 2026, 12:35 AM