feat: per-panel names + top-right Pop/Dock + expose panels to plugins (incl. follower windows)#20
Conversation
…-out carry
Panels get a stable, user-facing name so other plugins (Camera Director) can
target them, and so a popped-out panel keeps its identity.
- Editable name field at each panel's TOP-RIGHT (not the bottom bar: the main
player's auto-hiding transport + left icon rail overlap the panel bottom and
blocked the leftmost panels' controls). Persists in panel prefs
(panelToPrefs -> splitscreenPanelPrefs), restored on split start.
- Expose via the API: getPanels() -> [{index,name,canvas,focused,poppedOut}],
panelName(i), setPanelName(i,name); changes fire `splitscreen:panels-changed`
on the window.feedBack bus for cross-plugin consumers.
- Pop-out carries the panel's name + slot index to the follower window
(URL params `name`, `panelIndex`), so a popped-out panel keeps its name and a
follower can resolve which panel it is (e.g. Camera Director applies that
panel's camera in the popup).
- Also expose window.feedBackSplitscreen as an alias of window.slopsmithSplitscreen
(slopsmith -> feedBack rename in flight); consumers read
`feedBackSplitscreen || slopsmithSplitscreen`.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Kris Anderson <topkoa@gmail.com>
📝 WalkthroughWalkthroughThis change adds persistent, editable per-panel names to the splitscreen plugin. Panel names are stored in preferences, exposed through a public API, rendered as editable inputs, and propagated across pop-out and follower-window flows. ChangesEditable Panel Names
Estimated code review effort: 2 (Simple) | ~15 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
screen.js (1)
948-967: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a
maxlengthattribute to match the 40-char server-side truncation.The input has no
maxlength, so users can type an arbitrarily long name before it gets silently truncated to 40 chars on blur/commit. Amaxlength="40"would give immediate feedback instead of a surprising truncation.💡 Optional refinement
nameInput.type = 'text'; nameInput.value = `P${index + 1}`; nameInput.spellcheck = false; + nameInput.maxLength = 40; nameInput.title = 'Rename this panel';🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@screen.js` around lines 948 - 967, The panel rename field in the nameInput setup should enforce the same 40-character limit used by _commitPanelName so users get immediate feedback instead of silent truncation on blur. Add a maxlength constraint to the existing input element in the panel creation flow around nameInput, keeping the UI behavior aligned with the server-side commit logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@screen.js`:
- Line 373: The follower bootstrap in the config parsing logic is dropping the
forwarded panel identity because only `name` is being read from the params.
Update the parameter parsing near the `FOLLOWER` setup in
`popOutPanel()`/bootstrap handling to also read `panelIndex` from the incoming
query params, so popup-specific panel logic can use the value that was passed
through.
---
Nitpick comments:
In `@screen.js`:
- Around line 948-967: The panel rename field in the nameInput setup should
enforce the same 40-character limit used by _commitPanelName so users get
immediate feedback instead of silent truncation on blur. Add a maxlength
constraint to the existing input element in the panel creation flow around
nameInput, keeping the UI behavior aligned with the server-side commit logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| popupId: params.get('popupId') || '', | ||
| filename: params.get('filename') || '', | ||
| arrangement: parseInt(params.get('arrangement'), 10) || 0, | ||
| name: params.get('name') || '', |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether FOLLOWER.panelIndex is read/used anywhere else in screen.js
rg -n 'panelIndex' screen.jsRepository: got-feedBack/feedBack-plugin-splitscreen
Length of output: 344
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the relevant surrounding code for follower bootstrap and pop-out URL handling.
sed -n '360,430p' screen.js
printf '\n---\n'
sed -n '2435,2460p' screen.js
printf '\n---\n'
sed -n '3800,3825p' screen.jsRepository: got-feedBack/feedBack-plugin-splitscreen
Length of output: 6354
Parse panelIndex in the follower bootstrap
popOutPanel() forwards panelIndex, but the FOLLOWER config only reads name, so the popup loses the panel identity it was sent. Add panelIndex to the parsed params so popup-specific panel logic can use it.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@screen.js` at line 373, The follower bootstrap in the config parsing logic is
dropping the forwarded panel identity because only `name` is being read from the
params. Update the parameter parsing near the `FOLLOWER` setup in
`popOutPanel()`/bootstrap handling to also read `panelIndex` from the incoming
query params, so popup-specific panel logic can use the value that was passed
through.
Two follow-ups to the per-panel naming work, plus README. - Relocate the ⇱ Pop / ⇲ Dock button from the bottom mini-bar to the panel's TOP-RIGHT, just left of the name. It stays reachable when the bottom bar is hidden and clears the main player's overlapping transport. Same element and click wiring — only its parent + styling changed (now a translucent pill in a top-right flex cluster with the name). - Fire `splitscreen:panels-changed` at the end of buildFollowerLayout so a follower window that splits (or rebuilds) announces its panels promptly. getPanels() already reflects them (the follower sets `active` and populates `panels`), so panel-targeting plugins like Camera Director can steer each sub-panel of a popped-out window, not just its primary panel. - README: document panel naming, the Pop-next-to-name placement, and a "Per-panel identity & names" section covering getPanels()/panelName()/ setPanelName()/panelIndexFor()/onFocusChange + the panels-changed event. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Kris Anderson <topkoa@gmail.com>
Per-panel identity for splitscreen: a stable, user-facing name for each panel so other plugins (Camera Director) can target it, plus multi-window plumbing.
Panel names
getPanels() -> [{index,name,canvas,focused,poppedOut}],panelName(i),setPanelName(i,name); changes firesplitscreen:panels-changedon thewindow.feedBackbus.name+panelIndexto the follower window, so a popped panel keeps its identity and a follower can resolve which panel it is.window.feedBackSplitscreenas an alias ofwindow.slopsmithSplitscreen(slopsmith → feedBack rename in flight); consumers readfeedBackSplitscreen || slopsmithSplitscreen.Pop/Dock relocated + follower panels exposed
buildFollowerLayoutnow firessplitscreen:panels-changedwhen a follower window builds/splits.getPanels()already reflects a follower's own panels (it setsactiveand populatespanels), so panel-targeting plugins can steer each sub-panel of a popped-out window, not just its primary panel.Docs
getPanels()/panelName()/setPanelName()/panelIndexFor()/onFocusChange+ thepanels-changedevent.Companion: Camera Director PR #2 (the reference consumer — per-panel cameras, steer popped-out panels from main) and got-feedback/feedback #823 (highways read the per-panel camera).
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Documentation