Skip to content

Editor handle v2: class-aware validation, selection/validation API, themes, round-360, shortcuts - #11

Merged
navado merged 9 commits into
mainfrom
feat/editor-chat-handle-v2
Jul 12, 2026
Merged

Editor handle v2: class-aware validation, selection/validation API, themes, round-360, shortcuts#11
navado merged 9 commits into
mainfrom
feat/editor-chat-handle-v2

Conversation

@navado

@navado navado commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Editor-side half of the webshell editor↔chat integration (consumed by yey-boats/navigator via the vendor/midl submodule):

  • validateModel(model, manifest, className?) — validates against the selected class by id (was always classes[0]; the status bar claimed otherwise). All internal callers (save gate, status bar, preview, source editor) now pass the live class.
  • MidlEditorHandle v2: getSelection(), getValidationIssues() (manifest + device-lint, correct class), getTargetClass() — powers the chat panel's per-turn editor context.
  • round-360 in the class switcher + round-N dimension parsing.
  • red-night + classic renderer palettes (catalog-advertised themes now render honestly); preview-theme selector offers all five; clinometer palette entry.
  • Keyboard shortcuts: Delete/Backspace remove selected element (typing-focus guard), Esc deselect, Cmd/Ctrl+S save.

Test plan

  • editor 407/407, web 140/140, ts 147/147 (vitest)
  • make gen-manifest byte-identical, make check-catalog pass
  • Consumed and e2e-tested from the navigator branch (Playwright Builder chat flow)

Merge note: please merge with a merge commit or rebase (not squash) — the navigator PR pins the submodule to ebb7bd3; a squash would strand the pin.

🤖 Generated with Claude Code

navado and others added 9 commits July 12, 2026 13:54
…ses[0] fallback

validateModel(model, manifest, className?) — the optional third arg selects
the manifest device class to validate against; omitted or unknown names fall
back to manifest.classes[0] (historical two-arg behavior unchanged).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Status bar, save gate, usePreview and SourceEditor now validate against the
class the user actually selected (SourceEditor gains an optional className
prop), so '✓ Valid for {class}' agrees with what was validated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…torHandle

getSelection() exposes the selected grid cell + its element id (nulls when
nothing/empty selected). getValidationIssues() merges validateModel (source
'manifest') with lintDeviceCapabilities for the selected class (source
'device-lint', drop->error, degrade->warning), returning [] until the
manifest loads. New ValidationIssue type exported from the editor barrel.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ion parsing

SUPPORTED_CLASSES gains round-360; getDeviceDimensions (now exported) parses
round-N as N x N. Non-manifest classes stay gated behind the existing
isClassSupported '(preview unsupported)' treatment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
red-night is night-vision-safe (true-black ground, red-only inks, no
blue/green bleed; semantic pairs split on brightness); classic is a
cream/brass analog-instrument look. theme() resolves both; THEMES now
declares five themes with full Theme + WidgetColors coverage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tte entry

The preview-theme selector now lists all five renderer themes (night, day,
high-contrast, red-night, classic); Palette gains a curated clinometer
TYPE_META entry (label, description, heel-arc icon) instead of the generic
fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ect, Cmd/Ctrl+S save

Window keydown listener with a typing focus guard (inputs, textareas,
selects, contenteditable — covers the source-mode editor) so Delete while
editing text never removes a widget; Cmd/Ctrl+S preventDefaults the browser
save dialog and runs the normal save path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…chat context (M-2)

The Builder reported a hardcoded targetClass to the bundle while
getValidationIssues() validated against the LIVE class switcher
selection, so ctx.targetClass and ctx.validationIssues could disagree
after a class switch. Expose the live className through the handle so
callers source both from the same state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ixes CI red since MIDL-3)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@navado
navado merged commit fadb2a2 into main Jul 12, 2026
1 check 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.

1 participant