Skip to content

Add visual config editor (TypeScript)#395

Merged
jpettitt merged 3 commits into
masterfrom
visual-editor
Jul 6, 2026
Merged

Add visual config editor (TypeScript)#395
jpettitt merged 3 commits into
masterfrom
visual-editor

Conversation

@jpettitt

@jpettitt jpettitt commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a ha-form-based visual editor, reachable from the entities card's UI editor when editing a custom:multiple-entity-row row. Adapted from the duczz/ha-multiple-entity-row fork — thanks @duczz.

  • Tabbed layout: Main tab (top-level config + row actions + secondary info) and numbered tabs for each additional entity, with add / reorder / copy / cut / paste / delete and a clipboard scoped to the browser tab
  • Polymorphic secondary-info editor (none / custom text / HA token / entity-based)
  • State-based icon rows and per-entity custom CSS (ha-code-editor)
  • Tap/hold/double-tap action selectors per entity, and for the row in the Main tab
  • Registered via getConfigElement / getStubConfig + window.customCards

Also sets up incremental TypeScript migration: .ts/.js coexist, Babel strips types in webpack, and tsc --noEmit type-checks in yarn lint. New code is TS; existing modules migrate when touched. (Gotcha encoded in the commit: yarn resolves @babel/preset-typescript to the Babel 8 prerelease, which silently fails to strip generics under a Babel 7 core — pinned to 7.x.)

Test plan

  • yarn build (lint + type-check + 170 tests + webpack) passes; 20 new editor tests
  • Verified live in a local HA instance: tabbed editing, entity add/reorder/copy/paste, state-icon rows, custom CSS round-trip, YAML round-trips preserve existing configs

jpettitt and others added 3 commits July 5, 2026 19:34
Babel strips types in webpack (preset-typescript with allowDeclareFields
for Lit reactive-property declarations); tsc --noEmit type-checks in the
lint step. allowJs lets .ts and .js coexist while modules migrate
opportunistically. preset-typescript pinned to the 7.x line - yarn
resolved the Babel 8 prerelease, which silently fails to strip generic
type arguments under a Babel 7 core.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ha-form-based editor adapted from duczz/ha-multiple-entity-row (credit
@duczz), in TypeScript: tabbed main + additional entities with add/move/
copy/cut/paste/delete and a sessionStorage clipboard, polymorphic
secondary-info modes, state_icon row editor with draft preservation,
per-entity custom CSS via ha-code-editor, and action selectors. Wired
via getConfigElement/getStubConfig plus a customCards registration.
Written without Lit decorators (declare fields + static properties) to
avoid shadowing reactive accessors under Babel's class-field semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jpettitt jpettitt merged commit 3170447 into master Jul 6, 2026
2 checks passed
@jpettitt jpettitt deleted the visual-editor branch July 6, 2026 21:59
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