Add visual config editor (TypeScript)#395
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
ha-form-based visual editor, reachable from the entities card's UI editor when editing acustom:multiple-entity-rowrow. Adapted from the duczz/ha-multiple-entity-row fork — thanks @duczz.ha-code-editor)getConfigElement/getStubConfig+window.customCardsAlso sets up incremental TypeScript migration:
.ts/.jscoexist, Babel strips types in webpack, andtsc --noEmittype-checks inyarn lint. New code is TS; existing modules migrate when touched. (Gotcha encoded in the commit: yarn resolves@babel/preset-typescriptto 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