Skip to content

feat: per-panel names + top-right Pop/Dock + expose panels to plugins (incl. follower windows)#20

Merged
byrongamatos merged 2 commits into
mainfrom
feat/panel-naming-and-popout-camera
Jul 9, 2026
Merged

feat: per-panel names + top-right Pop/Dock + expose panels to plugins (incl. follower windows)#20
byrongamatos merged 2 commits into
mainfrom
feat/panel-naming-and-popout-camera

Conversation

@topkoa

@topkoa topkoa commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

  • 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, restored on split start.
  • Exposed via the API: getPanels() -> [{index,name,canvas,focused,poppedOut}], panelName(i), setPanelName(i,name); changes fire splitscreen:panels-changed on the window.feedBack bus.
  • Pop-out carries the panel's name + panelIndex to the follower window, so a popped panel keeps its identity and a follower can resolve which panel it is.
  • Also exposes window.feedBackSplitscreen as an alias of window.slopsmithSplitscreen (slopsmith → feedBack rename in flight); consumers read feedBackSplitscreen || slopsmithSplitscreen.

Pop/Dock relocated + follower panels exposed

  • The ⇱ Pop / ⇲ Dock button moves from the bottom mini-bar to the panel's top-right, next to the name — reachable even when the bottom bar is hidden, and clear of the main player's overlapping transport. Same element + click wiring; only parent/styling changed.
  • buildFollowerLayout now fires splitscreen:panels-changed when a follower window builds/splits. getPanels() already reflects a follower's own panels (it sets active and populates panels), so panel-targeting plugins can steer each sub-panel of a popped-out window, not just its primary panel.

Docs

  • README: panel naming, the Pop-next-to-name placement, and a new "Per-panel identity & names" integration section documenting getPanels()/panelName()/setPanelName()/panelIndexFor()/onFocusChange + the panels-changed event.

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

    • Panels now support editable, per-panel names that persist across sessions and remain consistent through dock and pop-out flows.
    • Exposed panel naming/registry capabilities via the splitscreen interface, including an update event when panels are added/removed/renamed.
  • Bug Fixes

    • Improved restoration of saved panel names on startup, including follower-mode and rebuilt layouts.
    • Keeps the on-screen panel name display synchronized after edits and layout changes.
  • Documentation

    • Updated README with instructions for naming panels and how pop-out behavior and panel targeting work.

…-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>
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

Editable Panel Names

Layer / File(s) Summary
Public API and persistence helpers
screen.js, README.md
The splitscreen API gains panel enumeration and name accessors, adds the window.feedBackSplitscreen alias, persists name in panel preferences, emits splitscreen:panels-changed on name updates, and documents the panel-targeting API in the README.
Editable panel name UI
screen.js, README.md
The panel chrome replaces the static P# label with an editable nameInput, moves the pop button beside it, commits sanitized name edits from blur or Enter, and updates the README to describe name editing and pop button placement.
Name restore and follower propagation
screen.js
Main-window panel creation restores saved names into panel.name and nameInput; pop-out URLs carry panelIndex and name; follower bootstrap stores cfg.name; follower panel building applies FOLLOWER.name, defaults other panels to P#, and refreshes the active follower grid.

Estimated code review effort: 2 (Simple) | ~15 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: per-panel names, top-right Pop/Dock placement, and plugin exposure including follower windows.
✨ 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 feat/panel-naming-and-popout-camera

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
screen.js (1)

948-967: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider a maxlength attribute 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. A maxlength="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

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e0fefff4-b09e-48ed-aa3d-aaff6aaabc40

📥 Commits

Reviewing files that changed from the base of the PR and between 7a2e508 and 19fa513.

📒 Files selected for processing (1)
  • screen.js

Comment thread screen.js
popupId: params.get('popupId') || '',
filename: params.get('filename') || '',
arrangement: parseInt(params.get('arrangement'), 10) || 0,
name: params.get('name') || '',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ 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.js

Repository: 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.js

Repository: 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>
@topkoa topkoa changed the title feat: editable per-panel names + expose to plugins + pop-out name carry feat: per-panel names + top-right Pop/Dock + expose panels to plugins (incl. follower windows) Jul 9, 2026
@byrongamatos
byrongamatos merged commit b85406e into main Jul 9, 2026
3 checks passed
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.

2 participants