Repository navigation
egocap: the side panel opens and closes, and the cameras take the room it leaves - #1643
NVshawnhwang wants to merge 2 commits into
Conversation
…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>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
🤖 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 The behaviour is clear and the accessibility work is careful (one real button with Legend: 🚫 Blocker · 💡 Suggestion · 🔍 Nit
Questions for the author
Actionables (for bots — copy-paste-ready for AI)
|
gareth-morgan-nv
left a comment
There was a problem hiding this comment.
🤖 Agent-generated (Claude Code · claude-sonnet-5-5)
Approved. Please address the comments in my review as you see fit.
…_recording_layout Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
NVdejung
left a comment
There was a problem hiding this comment.
🤖 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
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, andREADME.md:655("Press Space (outside any text field)") no longer holds after a toggle. The test atsrc/App.operatorLayout.test.tsx:455says the shortcuts keep working with the button focused, but presses onlyw, 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, ashideHandViewdoes (src/App.tsx:532); or have the Space handler skip this one button. Either way, add a test with a fake recognizer (as inRecordingPanel.voice.test.tsx): click Close, press Space → voice toggles and the panel stays closed.
Suggestions
src/styles.css:3311— please verify: the rail'smargin-left: -12pxlays 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 ofwindowWidth(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 inafterEach.
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#1642and 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#1644sharesApp.tsx,SettingsPanel.tsxand its test, the layout test,styles.cssandREADME.md(#1645:README.md), so restack the fix through#1644–#1646.#1586(gareth-morgan-nv, onmain) sharesApp.tsxandstyles.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 |
|
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 | w; duplicated helper |
src/CameraGrid.tsx |
LiveKit-only main tile: ego role, else named head, else first (was always first); comments updated | |
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 |
|
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
Branch:
nvShawnHwang/egocap_recording_layout, opened againstnvShawnHwang/egocap_hand_view.One commit:
egocap: the side panel opens and closes, and the cameras take the room it leavesSummary
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.
from 614 × 345 to 921 × 518.
has the same switch ("Show the side panel").
aria-expandedandaria-controls; focus stays on it across a change, and astatus line says what happened.
What to know
from its default camera when the panel is opened again.
rearrange the screen on a slip. The button is in the tab order.
the ego role, else one named
head, else the first). Before, the first LiveKit tile was large whatever its role.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