Skip to content

Comments

feat: support for initial card editor#1

Merged
troinine merged 7 commits intomainfrom
feature/card-editor
Dec 8, 2025
Merged

feat: support for initial card editor#1
troinine merged 7 commits intomainfrom
feature/card-editor

Conversation

@troinine
Copy link
Owner

@troinine troinine commented Dec 8, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a visual card editor for the weather forecast card, enabling users to configure the card through a UI instead of manually editing YAML. The implementation includes schema-based form rendering using Home Assistant's form helpers, with support for all card configuration options.

Key Changes:

  • Added a new editor component (weather-forecast-card-editor.ts) with comprehensive form schemas for all configuration options
  • Introduced getConfigElement() and getStubConfig() static methods to integrate the editor with Home Assistant's UI
  • Refactored configuration defaults into a reusable DEFAULT_CONFIG constant and added support for a new show_forecast boolean option

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/weather-forecast-card.ts Added editor integration methods, extracted configuration defaults to a constant, and implemented conditional rendering for the forecast section
src/types.ts Extracted inline forecast and forecast_action types into named interfaces and added show_forecast boolean property
src/index.ts Imported the new editor module to register it globally
src/editor/weather-forecast-card-editor.ts New file implementing the complete visual editor with form schemas, localization, and config transformation logic
src/components/wfc-weather-condition-icon-provider.ts Enhanced icons_path handling with trimming and trailing slash removal
package.json Updated publicUrl path from weather-forecast-card to ha-weather-forecast-card
Comments suppressed due to low confidence (1)

src/editor/weather-forecast-card-editor.ts:397

  • This statement is unreachable.
    return undefined;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@troinine troinine marked this pull request as ready for review December 8, 2025 15:15
@troinine troinine requested a review from Copilot December 8, 2025 15:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

troinine and others added 2 commits December 8, 2025 17:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
@troinine troinine merged commit 0a290f3 into main Dec 8, 2025
3 checks passed
@troinine troinine deleted the feature/card-editor branch December 8, 2025 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant