Skip to content

feat: setup wizard frontend - #66

Merged
frahlg merged 1 commit into
masterfrom
worktree-agent-a2777b14
Apr 16, 2026
Merged

frahlg merged 1 commit into
masterfrom
worktree-agent-a2777b14

Conversation

@frahlg

@frahlg frahlg commented Apr 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds web/setup.html and web/setup.js — an 8-step setup wizard for first-time configuration
  • Steps: Welcome, Site basics (name/fuse/zone), Network scan + manual IP, Driver picker (from /api/drivers/catalog with protocol filtering), Driver configuration (IP/port/unit-id/site-meter/battery), Device summary (add more loop), Optional integrations (EV Easee, Home Assistant MQTT, price provider), Review + Save (POST /api/config)
  • Dark theme matching the existing dashboard via web/style.css CSS variables, wizard-specific styles inline in a <style> block

Test plan

  • Open /setup.html in a browser and verify each step renders correctly
  • Verify step dots update as you navigate forward/back
  • Test the "Skip (no devices)" path: step 1 -> 2 -> 3 -> skip -> 7 -> 8
  • Test the manual IP entry path through steps 3-6
  • Verify driver catalog dropdown populates from /api/drivers/catalog
  • Verify the review step shows a readable summary
  • Test save: POST to /api/config with the built config JSON
  • Check mobile layout at 480px breakpoint

🤖 Generated with Claude Code

8-step wizard for first-time configuration: site basics, network
device scan, driver selection from catalog, driver configuration,
optional integrations (EV, HA, price), review and save via
POST /api/config.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@frahlg
frahlg merged commit bc1a285 into master Apr 16, 2026
github-actions Bot pushed a commit that referenced this pull request Apr 16, 2026
## [0.5.0](v0.4.0...v0.5.0) (2026-04-16)

### Features

* add setup wizard frontend (web/setup.html + web/setup.js) ([#66](#66)) ([bc1a285](bc1a285))
* bootstrap mode + network scanner for onboarding wizard ([#67](#67)) ([267cef4](267cef4))
* wizard dashboard trigger + driver catalog enrichment ([#68](#68)) ([78c83cf](78c83cf))

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6622f37144

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/setup.js
statusEl.innerHTML = '<span class="spinner"></span> Scanning network...';
resultsEl.style.display = 'none';

fetch('/api/scan')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Point device scan at an implemented API endpoint

The scan step calls fetch('/api/scan'), but the server route table only registers /api/health, /api/status, /api/config, /api/drivers/catalog, etc., and does not expose /api/scan (go/internal/api/api.go, routes()). In practice this means the “Scan network” button can never return devices in the current backend and will always fall into the error path, so the primary discovery flow is non-functional unless users switch to manual IP entry.

Useful? React with 👍 / 👎.

Comment thread web/setup.html

<div class="wizard-actions">
<button class="btn-secondary" onclick="goStep(2)">Back</button>
<button class="btn-skip" onclick="goStep(7)">Skip (no devices)</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Block the skip-devices flow from reaching an invalid save

The wizard explicitly offers “Skip (no devices)” and allows proceeding to save, but buildConfig() serializes drivers directly from configuredDrivers, so that path posts an empty driver list; backend validation rejects this (config.Validate() requires at least one driver and one is_site_meter). This creates a guaranteed dead-end for a documented flow, where users complete all steps only to hit a 400 validation error at the end.

Useful? React with 👍 / 👎.

@frahlg
frahlg deleted the worktree-agent-a2777b14 branch August 7, 2026 08:18
frahlg added a commit that referenced this pull request Dec 2, 2026
The setup guide wrote control_interval_s 5, slew_rate_w 500 and
min_dispatch_interval_s 5. It copied the defaults when it was added in
April (#66); the defaults moved to 2 s / 3000 W / 2 s in May (#293,
#298) and the guide did not follow. Settings → Control showed the same
old values as its fallbacks.

The guide now sends 2 / 3000 / 2, and Settings → Control shows them.
It cannot leave the fields out: with a house password the box stores
the guide's settings as sent and fills no defaults, so a missing
slew_rate_w would turn the ramp limit off.

wizardOrDefaultSeed still knows a guide seed only by 5 / 500 / 5. An
older Core saves 2 / 3000 / 2 for an untuned home, and that save must
import after a rollback.

Tests: a guard that the guide and the Control tab match applyDefaults,
the seed check for the old and new values, and an older Core's save
with default timings importing over live Settings.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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