Skip to content

Add device add/edit, mark done, and an Admin backup screen - #12

Merged
ShaneCurcuru merged 2 commits into
mainfrom
claude/project-thread-yd2q8i
Nov 7, 2026
Merged

ShaneCurcuru merged 2 commits into
mainfrom
claude/project-thread-yd2q8i

Conversation

@ShaneCurcuru

Copy link
Copy Markdown
Contributor

Requested by Shane · project thread

What and why

Finishes the v0.1 front end gaps from step 8 of docs/_prompts/plan/HomeIOT-Master-Plan.md (front end steps 4 and 5 in frontend-options.md): the device form, "mark done" for maintenance, and an Admin backup screen. Asked for by Shane ("continue implementing v0.1").

Devices

  • Add device (/devices/new) and Edit (/devices/$deviceId/edit), for Maintainers and Admins with manage access. Fields: name, category, status, Area and location (with "New location…" to create one inline), manufacturer/model/manual link (saved as a new product when changed), serial number (create only), install/purchase dates, price, vendor, warranty, notes. The critical flag is shown to Admins only.
  • Edits send only the fields that changed; cleared fields are sent as null.

Maintenance

  • Mark done on the overview's "due soon" list and on the device page, for Residents and up. It logs date, outcome, optional cost (in the property's default currency), and notes, then shows the new due date and updates cached task lists.

Backups (backend + front end)

  • New endpoints: GET /api/v1/backups, POST /api/v1/backups, GET /api/v1/backups/{name}. They make, list, and download .hiotbak files in the data folder's backups/, using the existing create_backup. Each create and download is written to the audit log.
  • Who can use them: a backup holds every property in the install, so the user must be an Admin of every property, otherwise they get 403. Without this, an Admin of one property could download another property's data.
  • Download names must match a strict pattern and resolve inside backups/.
  • The screen (/admin/backups, "Backups" in the nav for Admins) also lists the CLI commands for verify, merge or replace restore, and export. Restore stays CLI only, because it swaps the database under a running server.

Readings and decisions to check

Not done

  • Tag editing, identifier editing after create, deleting a device, and a service history list on the device page.
  • Restore from the UI (see above).

Testing

  • uv run ruff check ., ruff format --check, pyright: clean. uv run pytest: 287 passed, including 7 new backup API tests (403 for non-admins and for an Admin of only some properties, path traversal, CSRF, audit).
  • npm run lint, tsc -b, vitest run: 82 passed (new: form values, add/edit flows, mark done, backups page). License check passes.
  • Browser (Chromium, against domus serve with the sample home): added a device with a new location and product, edited it, marked a task done with a cost (the event saved with 24.50 USD and the task moved to next year), made a backup, downloaded it, and domus backup verify reported it OK. No horizontal scroll at phone width.

Posted by Claude on behalf of @ShaneCurcuru


Generated by Claude Code

Finishes the v0.1 front end gaps from step 8 of the master plan:

- Devices: "Add device" and "Edit" forms (name, category, status, area and
  location, with a new location inline, make/model/manual as a product,
  serial on create, purchase and warranty fields, notes; the critical flag
  for Admins only). Edits send only changed fields.
- Maintenance: "Mark done" on the overview and device page logs the date,
  outcome, optional cost in the property currency, and notes, then shows
  the new due date.
- Backups: GET/POST /api/v1/backups and GET /api/v1/backups/{name} to make,
  list, and download .hiotbak files, for users who are Admin of every
  property (a backup holds them all). The screen lists the CLI commands
  for verify, restore, and export; restore stays CLI only.

Posted by Claude on behalf of @ShaneCurcuru

Generated-by: Claude Code
@ShaneCurcuru ShaneCurcuru self-assigned this Nov 7, 2026
Resolves conflicts in the app's router list, schemas, nav, overview, and
front end routes, and regenerates openapi.json and schema.d.ts. The
Backups nav item now uses main's minRole style.

Posted by Claude on behalf of @ShaneCurcuru

Generated-by: Claude Code
@ShaneCurcuru
ShaneCurcuru marked this pull request as ready for review November 7, 2026 01:50
@ShaneCurcuru
ShaneCurcuru merged commit 578ba57 into main Nov 7, 2026
7 checks passed
@ShaneCurcuru
ShaneCurcuru deleted the claude/project-thread-yd2q8i branch November 7, 2026 01:55
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.

2 participants