Skip to content

egocap: the side panel opens and closes, and the cameras take the room it leaves - #1643

Open
NVshawnhwang wants to merge 2 commits into
nvShawnHwang/egocap_hand_viewfrom
nvShawnHwang/egocap_recording_layout
Open

NVshawnhwang wants to merge 2 commits into
nvShawnHwang/egocap_hand_viewfrom
nvShawnHwang/egocap_recording_layout

Conversation

@NVshawnhwang

Copy link
Copy Markdown
Collaborator

Branch: nvShawnHwang/egocap_recording_layout, opened against nvShawnHwang/egocap_hand_view.

One commit:

  1. egocap: the side panel opens and closes, and the cameras take the room it leaves

Summary

The side panel (hand view, 3D view, details) was always shown. One button on the boundary between the cameras and
the panel now closes it and opens it again.

  • Closed, the cameras, the status bar and the controls take the full width. At 1440 × 900 the head picture goes
    from 614 × 345 to 921 × 518.
  • The choice is this browser's and is remembered; the panel's width is kept while it is closed. Settings, Display
    has the same switch ("Show the side panel").
  • The button is one real button with aria-expanded and aria-controls; focus stays on it across a change, and a
    status line says what happened.

What to know

  • Closed, the panel's content is not mounted, so the 3D view holds no connection it does not show. It starts
    from its default camera when the panel is opened again.
  • No keyboard shortcut. The recording shortcuts are bare keys that are live during a take; one more would
    rearrange the screen on a slip. The button is in the tab order.
  • Three smaller changes came with it:
    • Cameras that arrive over LiveKit now choose the large tile by the same rule as the others (the camera assigned
      the ego role, else one named head, else the first). Before, the first LiveKit tile was large whatever its role.
    • The status bar puts the counts on a row of their own by the main column's width, not the window's.
    • A tile's caption wraps inside its tile, and the stacked layout of a narrow window keeps the main column's height.
  • At 1024 × 768 with the panel open the cameras are small, as before; closing the panel is the remedy there.

How it was tested

The page's lint, tests (700 passing) and build. The layout was measured in a headless browser at 1440 × 900,
1920 × 1080 and 1024 × 768 with the panel at its default, widest and closed. The CSS-only changes were checked in
the browser, not by tests.

🤖 Generated with Claude Code

…m it leaves

The side panel (hand view, 3D view, details) was always shown. One button
on the boundary between the cameras and the panel now closes it and opens
it again; closed, the cameras, the status bar and the controls take the
full width. The choice is this browser's and is remembered; the panel's
width is kept while it is closed. Settings, Display has the same switch.

- Closed, the panel's content is not mounted, so the 3D view holds no
  connection it does not show; it starts from its default camera when the
  panel is opened again.
- No keyboard shortcut is bound: the recording shortcuts are bare keys
  that are live during a take, and one more would rearrange the screen on
  a slip. The button is in the tab order.
- Cameras that arrive over LiveKit choose the large tile by the same rule
  as the others: the camera assigned the ego role, else one named head,
  else the first.
- The status bar puts the counts on a row of their own by the width of
  the main column, not the window's, so a closed panel gives the row
  back. A tile's caption wraps inside its tile. The stacked layout of a
  narrow window keeps the main column's height.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@gareth-morgan-nv

Copy link
Copy Markdown
Contributor

🤖 Agent-generated (Claude Code · claude-sonnet-5-5)

Summary

This adds one button on the boundary between the cameras and the side panel that closes and reopens the panel, remembers the choice in the browser, mirrors it in Settings, and lets the cameras use the freed width. I read SidebarToggle.tsx, sidebarOpen.ts, and the changes to App.tsx, CameraGrid.tsx, SettingsPanel.tsx and styles.css. I did not run the page or the tests.

The behaviour is clear and the accessibility work is careful (one real button with aria-expanded and aria-controls, focus kept on it, a status line, content unmounted while closed so the 3D view holds no connection). Layout readability is the weak spot: the toggle label is vertical text in a 24 px rail, and the PR bundles three unrelated layout and behaviour changes that deserve separate review.

Legend: 🚫 Blocker · 💡 Suggestion · 🔍 Nit

Finding
💡 CameraGrid.tsx liveKitPrimaryIndex — this changes which LiveKit tile is the large one for every existing station that streams over LiveKit only: before, the first tile was large; now it is the camera assigned the ego role, else one named head, else the first. It is the right rule and matches the other tiles, but it is a behaviour change to an existing client that has nothing to do with the side panel. Please move it into its own PR (it is small and testable on its own), so a station that is surprised by a different large tile can find the cause.
💡 styles.css — the status bar's wrap rule moves from @media (max-width: 1100px) to @container op-main (max-width: 720px), and the caption wrap rules change for every camera tile. Both are existing-screen changes unrelated to opening and closing a panel, and the PR notes they were checked in the browser and not by tests. A reviewer cannot judge the 1100 px to 720 px change from the diff. Please include before/after screenshots at 1024, 1440 and 1920 px, or split them out.
💡 styles.css .op-sidebar-toggle-label and .op-rail — the label "Close side panel" / "Open side panel" is rotated text (writing-mode: vertical-rl) at 12 px in a 24 px strip, and when closed the whole rail is the tab. Rotated text is slower to read than horizontal text, and the whole control is only a few pixels wide; for an operator mid-take at arm's length this is easy to miss, and the arrow glyph (»/«) is hidden from assistive technology so it carries meaning only for sighted users. A short horizontal tab, or an icon with a horizontal label on hover and a visible text label in the Settings checkbox, would be easier to read and hit.
💡 App.tsx toggleSidebar / SidebarResizer — the resizer is mounted only while open, and its drag state (dragging) lives inside it while resizing lives in App. If the panel is closed from the keyboard or Settings while a drag is in progress, the resizer unmounts without calling onDragChange(false), leaving op-body--resizing set and the 3D view's pointer shield on. Unlikely, but the fix is one line: call setResizing(false) in showSidebar. Not verified in a browser.
💡 App.tsx — closing the panel unmounts HandView, PoseViserPanel and CaptureTree; the README records that the 3D view's camera and the Details disclosures reset on reopening. That is a deliberate trade, but the reset of the 3D camera is the most likely thing to annoy an operator who closes the panel for a long take and reopens it to check something. Consider keeping the 3D view's last camera pose in App state and passing it back.
🔍 App.tsx — two role="status" regions now exist (the panel's change notice in the rail, and the hand-view hidden notice inside the panel). Keep only one live region for the side panel, and let the hand-view text be plain text inside it.
🔍 styles.css .op-resizer — the resizer changes from a fixed 12 px strip with its line at left: 5px to flex: 1 with the line at right: 5px, below the toggle button. The grab area now starts beneath the button; say so in the comment, since the divider used to run the full height.
🔍 frontend/README.md — the README text added for the camera stage gives a fill ratio ("about 2.7 times as wide as it is tall") that depends on the camera count and aspect; it will drift. State the rule, not the figure.

Questions for the author

  • At 1024 x 768 with the panel open the cameras are small, as before; do you want the panel to default to closed under a certain width rather than leaving the choice to the operator?
  • Is the stacked layout's toggle (a bar across the page between the cameras and the panel) tested on a touch device? I could not check.

Actionables (for bots — copy-paste-ready for AI)

Agent-generated suggestions, not human-vetted obligations. Skip anything wrong, already addressed, or not worth the churn.

  • CameraGrid.tsx — move the LiveKit primary-tile rule into a separate PR.
  • styles.css — split the status-bar container query and the caption wrap rules out, or attach before/after screenshots.
  • styles.css / SidebarToggle.tsx — replace the vertical text label with a horizontal control.
  • App.tsx showSidebar — call setResizing(false) when the panel closes.
  • App.tsx — use one live region for side-panel announcements.
  • frontend/README.md — replace the "2.7 times" figure with the rule.

@gareth-morgan-nv gareth-morgan-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Agent-generated (Claude Code · claude-sonnet-5-5)

Approved. Please address the comments in my review as you see fit.

@NVshawnhwang
NVshawnhwang requested a review from NVdejung December 1, 2026 20:25
…_recording_layout

Signed-off-by: Shawn Hwang <shhwang@nvidia.com>

@NVdejung NVdejung left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated first-pass review (Claude, for Dejun) — I'll follow up personally where needed.

Summary — Adds one button on the boundary between the cameras and the side panel, plus a matching switch in Settings → Display, that closes and reopens the panel; the choice is remembered per browser, the panel's content is unmounted while closed, and the main column takes the width. Three smaller layout changes come along, as the description says. Carefully built and well tested; one clash with the existing Space shortcut needs fixing before merge.

Must fix

  1. src/App.tsx:517 — After a press, focus is put on the toggle. Space is the page-wide voice on/off shortcut, and its handler deliberately yields to a focused button (src/RecordingPanel.tsx:631). So an operator who closes the panel and then presses Space to start voice commands gets the panel back instead (content remounted, 3D view at its default camera) and voice unchanged. That is the "rearrange the screen on a slip" case the description rules out, and README.md:655 ("Press Space (outside any text field)") no longer holds after a toggle. The test at src/App.operatorLayout.test.tsx:455 says the shortcuts keep working with the button focused, but presses only w, whose handler never checks for buttons. Chrome focuses a clicked button by itself, so deleting the .focus() call is not enough. For example: keep focus on the toggle only after keyboard activation (event.detail === 0), and after a pointer click blur it or move focus to a non-button, as hideHandView does (src/App.tsx:532); or have the Space handler skip this one button. Either way, add a test with a fake recognizer (as in RecordingPanel.voice.test.tsx): click Close, press Space → voice toggles and the panel stays closed.

Suggestions

  • src/styles.css:3311 — please verify: the rail's margin-left: -12px lays it over the rightmost 12 px of .op-main, which is where the column's own vertical scrollbar is drawn when it scrolls (overflow-y: auto, src/styles.css:2922: a short window, a long take outcome). Likely result: the scrollbar sits under the toggle and, below it, under the divider, so grabbing the thumb starts a resize; closed, the tab covers it full height. Wheel scrolling still works. Headless Chromium usually hides scrollbars, so the description's measurements would miss this. To avoid the overlap without losing camera width: no negative margin, and take the 12 px from .op-main's right padding while the rail is beside it.
  • src/App.tsx:762 — stale comment: the hand-view status line is described as "Always in the page", but it is now inside {sidebarOpen && …} and exists only while the panel is open.
  • src/App.operatorLayout.test.tsx:262 — nit: a second copy of windowWidth (the first is at L950). The reset at the end of a test body is skipped when an assertion fails, so one failure leaves later tests at 1600 px; hoist the helper and reset in afterEach.

Still open from the earlier review: moving the LiveKit main-tile change into its own PR. The change itself checks out: the main tile is placed by class (src/styles.css:3006), so it lands on the left wherever it is listed, and the new tests cover ego, head and first.

Conflicts

  • With the base nvShawnHwang/egocap_hand_view (head of #1642): 0 commits behind, clean local 3-way merge, no rebase needed. It lands after #1642 and the stack under it (#1634–#1641).
  • With open PRs: stack parents #1637–#1642 (same author) share these frontend files but sit below this branch, so nothing conflicts now. Stack child #1644 shares App.tsx, SettingsPanel.tsx and its test, the layout test, styles.css and README.md (#1645: README.md), so restack the fix through #1644–#1646. #1586 (gareth-morgan-nv, on main) shares App.tsx and styles.css; not computed (different base). Whichever lands second rebases; anything it adds to the side panel is now unmounted while the panel is closed.
Change-by-change (13 files)

Read in full; the CSS was judged by reading, not rendered. Paths are under examples/egocap/frontend/.

File / area What changed Makes sense?
src/sidebarOpen.ts (new) Open/closed kept in localStorage (egocap.sidebar); open by default and when storage is blocked or holds junk ✅ mirrors sidebarWidth.ts
src/sidebarOpen.test.ts (new) Default, round trip, junk, blocked read and write, width key untouched ✅
src/SidebarToggle.tsx (new) One <button> with aria-expanded/aria-controls, label in words, arrow aria-hidden; ref as a prop (React 19) ✅
src/SidebarToggle.test.tsx (new) Names, state attributes, arrow kept out of the name, one call per click, ref ✅
src/App.tsx Open state and status notice; rail = toggle + status line + divider (divider only while open); aside kept with id/hidden, content mounted only while open; op-body--sidebar-closed (not while the feed is unavailable); props passed to Settings ⚠️ focus vs Space (must fix); stale comment at L762
src/SettingsPanel.tsx "Show the side panel" checkbox and help text in Display → Layout; two props; docstrings updated ✅
src/SettingsPanel.test.tsx Checkbox state and callback, description, no token needed, width reset while closed ✅
src/App.operatorLayout.test.tsx 16 new tests (close/open, focus, notices, persistence, blocked storage, width kept and refit, hand view independent, Settings in sync, shortcuts, red frame, unavailable feed), one renamed ⚠️ shortcut test presses only w; duplicated helper
src/CameraGrid.tsx LiveKit-only main tile: ego role, else named head, else first (was always first); comments updated ⚠️ correct, but unrelated to the panel (split still requested)
src/CameraGrid.livekit.test.tsx Head listed second, ego beats head, fallback to first ✅
src/CameraGrid.test.tsx Ego camera listed in the middle gets the main tile, DOM order kept ✅
src/styles.css Rail and toggle styles; .op-sidebar[hidden]; divider grows within the rail with its line kept 5 px from the panel; status-bar counts take their own row by a container query on op-main (≤ 720 px) instead of the window media query (≤ 1100 px), .op-health still handled by the existing 1080 px rule; captions wrap inside the tile; stacked layout keeps the main column's height and shows the toggle as a bar ⚠️ rail over the main column's scrollbar (verify)
README.md Display tab, main-camera rule, caption and aspect note, "Closing the side panel" and "Resizing the side panel" bullets ✅ matches the code
Public repository Pattern scan of added lines, file names, title, description and commit message is clean; fixtures use generic names ✅

Reviewed at f80e7fe · 13 files · 2026-12-01 14:37 PST

This branch was successfully deployed

1 active deployment
dev — ff85701c Deployed Dec 2, 2026 by NVshawnhwang via publish-wheel #7716
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants