Skip to content

Fetch device info only when the panel opens - #15

Merged
scott-tp merged 1 commit into
masterfrom
feature/lazy-device-status
Nov 21, 2026
Merged

scott-tp merged 1 commit into
masterfrom
feature/lazy-device-status

Conversation

@scott-tp

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

Copy link
Copy Markdown
Collaborator

Summary

Device info is hidden on load, but every visible card still requested the snapshot. That route fans out to seven TinyPilot calls, and it repeated every five minutes.

Load and page change now fetch screenshots only. The five-minute snapshot timer is gone.

Opening Show device info and clicking Refresh device info are what request the snapshot. Replacing an API key, or a software update that just finished, refreshes it only while that panel is still open.

Test plan

  • ./dev-scripts/check-javascript
  • ./venv/bin/pytest -q tests/test_preview_cache_js.py tests/test_remove_device_ui.py
  • ./dev-scripts/check-python
  • Hard-refresh, then confirm no /device/snapshot on load or page change, one on Show device info, none on Hide, one on Refresh device info, and none after five minutes
    Review on CodeApprove

The hidden device panel was still requesting the snapshot on load and every five minutes.
@scott-tp
scott-tp merged commit d20347f into master Nov 21, 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