Skip to content

Stop storing previews and add Replace API key - #8

Merged
scott-tp merged 12 commits into
masterfrom
feature/previews-and-keys
Nov 11, 2026
Merged

scott-tp merged 12 commits into
masterfrom
feature/previews-and-keys

Conversation

@scott-tp

@scott-tp scott-tp commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Live previews return to the browser only; Cache Storage holds the last frame per device and exposes a clear function for sign-out (privacy promise). Cache Storage needs HTTPS or localhost; LAN HTTP degrades to session-only memory.
  • Dedicated PUT /api/devices/<id>/api-key with a Replace API key confirm modal (not inline form) updates the encrypted Automation key without removing the device.
  • Visible devices re-snapshot about every five minutes; preview states are Live / Cached / Offline / No signal / Loading (spinner).
  • Drop unused SQLite columns (needs SQLite 3.35+) and delete leftover screenshot files on startup; bump to 0.4.0 for Cloud repin.

Test plan

  • pytest -q green (66 passed locally)
  • Manual (Docker): live / cached / offline / no-signal labels and overlay; spinner loading; Replace API key modal
  • CI passes
  • Manual: Replace API key → snapshot works with new key; response never shows the key
  • Manual: start once on a copy of an old-schema DB; start again on the new schema (idempotent)
  • Confirm data/screenshots/ emptied / unused
  • Confirm Cache Storage clear via window.tinypilotPreviewCache.clearPreviewCache()
    Review on CodeApprove

Match the privacy promise: live screenshots stay in the browser Cache
Storage, unused schema columns drop on init, and device cards can replace
an Automation API key without removing the device.
Author display:flex on .preview-placeholder overrode the hidden
attribute, so a successful JPEG stayed covered by the loading gradient.
Drop the shimmer and monitor icon so empty preview states match the
dashboard subtitle style; Connected already implies the computer side.
Match No signal / Offline as large centered labels; drop the corner
badge so offline-with-cache uses the same treatment.
Also align empty Offline with the dark No signal well, yellow-caution
non-live preview status copy, and Offline/No signal checked phrasing.
Place the action beside Remove device and reuse the remove-modal
layout with a password field, hint, and Save/Cancel.
Drop the remove re-add disclaimer, split replace-key instructions onto
two spaced lines, and give modal instructions consistent spacing.
Drop the smaller custom instruction block; keep normal subtitle font
with a looser line-height for the replace-key line break.
Keep RequestException and non-signal ValueErrors off the no-signal path, drop the sticky offline flag, and document Cache Storage / SQLite limits.
@scott-tp
scott-tp merged commit a06c76a into master Nov 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant