Skip to content

Camera page updates - #52

Merged
dk307 merged 3 commits into
mainfrom
camera_page
Aug 8, 2026
Merged

Camera page updates#52
dk307 merged 3 commits into
mainfrom
camera_page

Conversation

@dk307

@dk307 dk307 commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Live View is now the default camera detail tab.
    • Added dedicated tabs for Live View, Timeline, and Details.
    • Improved live stream support for different remote connection formats.
    • Manual connection retries now cancel pending automatic retries.
  • Removed

    • Removed the Commands tab and its index management actions.
  • Bug Fixes

    • Improved validation of incoming live stream messages for more reliable connections.

dk307 added 2 commits August 7, 2026 22:07
- Move the live view into a tab (default), removing the standalone
  always-visible player above the tabs; drop the Commands tab (Reindex
  / Drop Index) from the camera detail page.
- Key LiveView by cameraId so per-camera quality state resets and the
  previous camera's WebRTC session is torn down on switch.
- Preserve sdpMid/sdpMLineIndex when adding remote ICE candidates,
  falling back to BUNDLE "0" only for bare go2rtc candidate strings.
- Log the requested stream src in /live/ws for diagnostics.
Prevents the scheduled auto-retry from firing after the user clicks
Retry, avoiding a redundant reconnect.
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b0e083b0-21b2-4096-80c1-a8c3777b5d26

📥 Commits

Reviewing files that changed from the base of the PR and between 4212165 and 6c20660.

📒 Files selected for processing (2)
  • tests/e2e/test_cameras.py
  • tests/e2e/test_e2e.py

📝 Walkthrough

Walkthrough

The camera page now opens on Live View, retains Timeline and Details, and removes Commands. WebRTC signaling validates answer and ICE payloads, and manual retry clears automatic retry timers. Related tests now select tabs explicitly.

Changes

Camera live view

Layer / File(s) Summary
Live stream signaling
app/api/cameras.py, frontend/src/components/VideoStream.tsx
live_ws logs the requested stream source. VideoStream validates JSON and SDP answers, accepts structured or string ICE candidates, and clears pending automatic retries before manual reconnects.
Camera page tabs and tests
frontend/src/pages/CameraDetail.tsx, frontend/src/pages/CameraDetail.test.tsx, tests/e2e/test_cameras.py, tests/e2e/test_e2e.py
Live View is the default tab. Timeline and Details remain available. The Commands panel and its mutations are removed. Unit and end-to-end tests select Timeline explicitly, and Commands tests are removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CameraDetail
  participant VideoStream
  participant live_ws
  participant go2rtc
  CameraDetail->>VideoStream: Render Live View tab
  VideoStream->>live_ws: Request stream source
  live_ws->>go2rtc: Check stream availability
  live_ws-->>VideoStream: Send signaling data
  VideoStream->>VideoStream: Validate SDP and ICE payloads
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title relates to the changed camera page but does not identify the main tab and Live View changes. Use a more specific title, such as "Make Live View the default camera tab and remove Commands".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch camera_page

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py00100% 
build_info.py50100% 
config.py240100% 
database.py23196%39
main.py821384%49–50, 58, 133–135, 137–142, 144
api
   __init__.py00100% 
   activity.py240100% 
   app_settings.py270100% 
   cameras.py3731696%233, 235, 237, 241, 523–526, 534–537, 541, 582, 614–615
   health.py34391%17–19
   locations.py380100% 
   logs.py280100% 
   recordings.py142199%88
   scanner.py280100% 
   storage.py60100% 
   system_info.py137199%33
   timeline.py290100% 
models
   __init__.py00100% 
   app_settings.py130100% 
   base.py80100% 
   camera.py320100% 
   download_event.py140100% 
   location.py90100% 
   purge_event.py140100% 
   recording.py38197%56
   scan_event.py140100% 
schemas
   __init__.py00100% 
   app_settings.py60100% 
   camera.py990100% 
   location.py110100% 
   recording.py80100% 
services
   __init__.py00100% 
   downloader.py156299%324–325
   go2rtc.py2810100% 
   hikvision.py175299%154–155
   log_buffer.py63297%77–78
   purger.py1400100% 
   reconcile.py170100% 
   scanner.py273399%347, 373, 435
   storage.py220100% 
   tz.py540100% 
workers
   __init__.py00100% 
   scheduler.py1230100% 
TOTAL25704598% 

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.66667% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.88%. Comparing base (f0a59b2) to head (6c20660).

Files with missing lines Patch % Lines
frontend/src/components/VideoStream.tsx 40.90% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #52      +/-   ##
==========================================
- Coverage   93.04%   92.88%   -0.17%     
==========================================
  Files          81       81              
  Lines        7438     7377      -61     
  Branches      755      751       -4     
==========================================
- Hits         6921     6852      -69     
- Misses        483      491       +8     
  Partials       34       34              
Flag Coverage Δ
backend 98.24% <100.00%> (-0.04%) ⬇️
frontend 90.01% <55.17%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The camera detail page now opens on the Live tab by default, keeps useful
content (stats, activity chart, timeline) behind the Timeline tab, and drops
the Commands tab entirely. The Playwright suite wasn't updated for that, so
CI (E2E) was red.

- Click the Timeline tab before asserting stat cards / activity chart /
  timeline bars in both test_cameras.py and test_e2e.py.
- Rewrite the tabs-switch test to reflect the Live-default / Timeline /
  Details layout and assert the Commands tab is gone.
- Remove the obsolete Commands panel and Drop Index tests (feature removed).
- Update the Hikvision details test to reach "Last Downloaded" under the
  Timeline tab.
@dk307
dk307 merged commit 7e13e44 into main Aug 8, 2026
9 checks passed
@dk307
dk307 deleted the camera_page branch August 8, 2026 22:12
@coderabbitai coderabbitai Bot mentioned this pull request Aug 11, 2026
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