You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(onboarding): welcome-flow polish from manual testing
- Sidebar shows Home when it's the only enabled gear. The status
middleware was short-circuiting on box-count==0 and never injecting
system gears into the nav order; now system gears load first
regardless of box state, and box-scoped gears are appended only
when a box exists.
- /settings/gears no longer 400s with plain "No servers configured"
when no boxes are registered. Renders the Home gear plus a "No
boxes configured" CTA card linking to /settings/boxes/new. Inline
copy switched to "box" terminology to match issue #49.
- Welcome screen uses the shared ui.Toggle slider instead of a bare
<input type="checkbox">. ui.Toggle gained a value parameter so it
can submit a specific value when multiple toggles share a name
(multi-select checkbox group). CLAUDE.md adds "Toggle switches —
never use a bare <input type=checkbox>" under UI Conventions so
this stays the canonical pattern.
- Home empty-state icon scaled up via new HomeIconClass(class)
wrapper. Sidebar HomeIcon() unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
### Toggle switches — never use a bare `<input type="checkbox">` in templates
204
+
205
+
For every boolean input in a `.templ` file — feature opt-ins, settings, "enable this gear", "show all", per-row enable/disable — use the shared slider component in [internal/framework/ui/toggle.templ](gearbox/internal/framework/ui/toggle.templ):
@ui.ToggleWithLabel("notify-email", "notify_email", "1", "Email notifications", "Send a digest each morning", true, false)
216
+
```
217
+
218
+
**Rules of thumb:**
219
+
220
+
- The underlying input is `sr-only` but real — it submits with the form and respects `checked` / `disabled`. No JS required for plain forms.
221
+
- Pass `value` when multiple toggles share a `name` (e.g., a multi-select checkbox group posting as `name="gears"`). Leave empty when a single boolean field submits as the default `"on"`.
222
+
- For AJAX toggles that POST on change (no enclosing form), the per-row `gear-toggle``<button role="switch">` pattern in [gears.templ](gearbox/internal/framework/templates/pages/gears.templ) is the established alternative — but for **anything inside a `<form>`**, use `@ui.Toggle`.
223
+
- Never inline `peer-checked:after:...` Tailwind salads in a new template — that's a sign you should be calling `@ui.Toggle`. Existing inline copies in `overview.templ` and `admin_user_permissions.templ` are tech debt; migrate them when you're already editing those files.
Per-box gears (HAProxy, Metrics, Logs, Services, Certificates, Traffic, Alerts, OS Updates) need a registered box to run against. Add one to enable them.
0 commit comments