Skip to content

Stabilize split-screen panel lifecycle + feedBack rebrand#23

Open
carochacs wants to merge 6 commits into
got-feedBack:mainfrom
carochacs:main
Open

Stabilize split-screen panel lifecycle + feedBack rebrand#23
carochacs wants to merge 6 commits into
got-feedBack:mainfrom
carochacs:main

Conversation

@carochacs

@carochacs carochacs commented Jul 22, 2026

Copy link
Copy Markdown

Panel lifecycle fixes (screen.js)

  • Hide mode-inappropriate controls (lyrics/detect/channel buttons) while a panel
    is in Lyrics-pane or Jumping-Tab-pane mode — they're meaningless once the
    highway is stopped and the canvas is hidden.
  • Destroy live note detectors when entering Lyrics/Jumping-Tab mode instead of
    leaving them running with no visible on/off control.
  • Destroy the per-panel lyrics overlay on entering those modes (was stacking
    visibly on top of the full lyrics pane) and restore it on exit if it was on.
  • Rebuild note detectors across highway recreation so they stay bound to the
    live highway instance instead of a stale, stopped one.
  • Guard popOutPanel() against a race where teardownPanels() could dismantle
    a half-built layout while startSplitScreen() is still constructing it.
  • Recover all sub-panels (not just one) when docking a popup that had split
    itself into multiple panels; grow the layout to fit instead of silently
    dropping panels past capacity.
  • Toast instead of silently dropping a docked panel's state when no song is
    loaded at dock time.
  • Reflow panels when the Section Map plugin's bar height/visibility changes,
    via a ResizeObserver instead of only on window resize.
  • Emit splitscreen:panels-changed when canvas identity changes (arrangement
    switch, viz enter/exit), so consumers resolving panels by canvas reference
    (e.g. Camera Director) don't silently desync.
  • Null-check the audio element in the tab view's getCurrentTime() callback.

Rebranding (README.md, CLAUDE.md, screen.js)

  • Replace remaining "Slopsmith" references in user-facing text and docs with
    "feedBack" — README title/intro/install path/clone URL, CLAUDE.md's
    "loaded by feedBack core" and Git/PR conventions section, and the
    follower-orphaned overlay's fallback title.
  • Left untouched: window.slopsmithSplitscreen (back-compat alias —
    window.feedBackSplitscreen is the canonical one already exposed alongside
    it), the slopsmithViz_ factory naming convention, BroadcastChannel('slopsmith-ss'),
    and external slopsmith#NNN issue links (can't verify those trackers were renamed).

Docs (screen.js)

  • Add JSDoc blocks to all 144 top-level functions — addresses this org's
    reusable CI docstring-coverage gate, which reported ~31% against an 80%
    threshold.

Test plan

  • node -c screen.js — syntax valid
  • node --test tests/screen.test.js — 25/25 pass
  • Manual: enable Detect on a panel, switch to Lyrics/Jumping Tab, confirm
    the detector stops and re-enabling after switching back works
  • Manual: pop out a panel, split the popup into quad, dock one sub-panel,
    confirm all 4 return to the main window
  • Manual: dock a panel with no song loaded, confirm a toast appears
    instead of the panel silently vanishing
  • Manual: toggle the Section Map plugin's bar with split active, confirm
    panels reflow without a window resize

carochacs and others added 2 commits July 22, 2026 16:15
…etector across highway swaps (#5)

- Hide Lyrics/Detect/Channel toggle buttons while a panel is in Lyrics-pane
  or Jumping-Tab-pane mode, and restore them on exit (matches CLAUDE.md's
  documented button-hiding contract).
- Destroy the per-panel lyrics overlay when entering Lyrics/JT mode (it was
  rendering on top of the full lyrics pane / JT pane) and restore it on exit
  if it was on.
- Rebuild the per-panel note detector in recreatePanelHighway() so it stays
  bound to the live highway instance across arrangement switches and viz
  mode transitions, instead of being orphaned on a stopped one.
- Guard popOutPanel() with the _starting in-flight check (same pattern as
  rebuildLayout()/_redockPanel()) so a pop-out can't race a still-building
  startSplitScreen().
- Null-check #audio in the tab-view getCurrentTime callback.

Addresses items 2-4 and 7 of the shared-architecture bug audit filed in
#4 (item 1, invert persistence, was
already fixed in this repo).

Co-authored-by: Claude <noreply@anthropic.com>
…d docs (#7)

- README: title, intro line, install path/clone URL (was pointing at the
  stale topkoa/slopsmith-plugin-splitscreen fork instead of this repo),
  "runs on any feedBack core", and the Requirements section.
- CLAUDE.md: "loaded by feedBack core", and the Git/PR conventions section
  (was entirely stale, pointing at topkoa/slopsmith-plugin-splitscreen and
  an "upstream" that isn't this repo's actual setup).
- screen.js: the follower-orphaned overlay's user-visible fallback title
  ("Main Slopsmith window closed" -> "Main feedBack window closed").

Left untouched: window.slopsmithSplitscreen (back-compat alias consumers
still read), the slopsmithViz_<id> factory naming convention, and
BroadcastChannel('slopsmith-ss') — these are real external integration
contracts other plugins depend on, not branding. Also left sibling-plugin
repo links (Stems, Jumping Tab) and slopsmith#NNN issue references as-is
since I can't verify whether those external repos/trackers were renamed.

Co-authored-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The plugin is rebranded for feedBack and its split-screen runtime is hardened across device binding, detector and overlay lifecycles, layout resizing, pop-out/redock restoration, and follower or remote-panel synchronization.

Changes

Split-screen updates

Layer / File(s) Summary
feedBack documentation and repository guidance
CLAUDE.md, README.md
Documentation, installation commands, repository references, and requirements now use feedBack naming.
Panel state, device, and detector lifecycle
screen.js
Panel preferences, device bindings, detector state, highway recreation, visualization controls, and lyrics transitions are coordinated across lifecycle changes.
Layout sizing and runtime interaction guards
screen.js
Panel sizing reacts to section-map changes, controls refresh layouts, and runtime paths handle missing audio and split-start transitions.
Multi-panel pop-out and redock restoration
screen.js
Dock messages preserve multiple panel states, which are restored through best-fit layouts with growth and overflow handling.
Follower and remote panel synchronization
screen.js
Follower rebuilds, transport handling, song toasts, and remote reconnect flows preserve panel configuration and synchronization state.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Popup
  participant MainWindow
  participant SplitScreen
  participant RemoteViewer
  Popup->>MainWindow: send finalStates
  MainWindow->>SplitScreen: restore multi-panel layout
  SplitScreen->>RemoteViewer: synchronize follower panel state
  RemoteViewer->>MainWindow: reconnect and resume remote session
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 clearly captures the main lifecycle stabilization work and the feedBack rebrand reflected in the changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@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

🤖 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`:
- Around line 1665-1667: Update exitLyricsMode() and exitJumpingTabMode() to
call _showVizControls(panel, pluginId) after restoring the mode-specific
controls and before hookPanelReady(). Ensure normal-arrangement transitions
restore each panel’s active visualization controls.
🪄 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: 7a8e2bdf-67ad-47b2-962d-d557cf3f8e84

📥 Commits

Reviewing files that changed from the base of the PR and between cdd30d8 and 94e75f8.

📒 Files selected for processing (3)
  • CLAUDE.md
  • README.md
  • screen.js

Comment thread screen.js
Comment on lines +1665 to +1667
panel.lyricsBtn.style.display = '';
if (panel.detectBtn) panel.detectBtn.style.display = '';
if (panel.channelBtn) panel.channelBtn.style.display = '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
rg -n -C 8 'function (exitLyricsMode|exitJumpingTabMode|hookPanelReady)|_hideVizControls|_showVizControls' screen.js

Repository: got-feedBack/feedBack-plugin-splitscreen

Length of output: 9194


🏁 Script executed:

#!/bin/bash
set -eu
printf '--- hookPanelReady ---\n'
sed -n '1544,1608p' screen.js | cat -n
printf '\n--- exitLyricsMode section ---\n'
sed -n '1652,1698p' screen.js | cat -n
printf '\n--- exitJumpingTabMode section ---\n'
sed -n '1735,1810p' screen.js | cat -n
printf '\n--- select change handling ---\n'
sed -n '2008,2072p' screen.js | cat -n

Repository: got-feedBack/feedBack-plugin-splitscreen

Length of output: 269


🏁 Script executed:

#!/bin/bash
set -eu
sed -n '1544,1608p' screen.js | cat -n
sed -n '1652,1698p' screen.js | cat -n
sed -n '1735,1810p' screen.js | cat -n
sed -n '2008,2072p' screen.js | cat -n

Repository: got-feedBack/feedBack-plugin-splitscreen

Length of output: 13438


Restore visualization controls when exiting lyrics/jumping-tab modes.

enterLyricsMode() and enterJumpingTabMode() call _hideVizControls(panel), but exitLyricsMode() and exitJumpingTabMode() only reset the lyrics, detector, channel, and mastery controls. If the user leaves these modes by selecting a normal arrangement, _showVizControls(panel, pluginId) is never called, so the playlist/transport highway may lose its per-panel vis controls after the first transition. Restore the active viz controls in the exit paths before calling hookPanelReady().

🤖 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 1665 - 1667, Update exitLyricsMode() and
exitJumpingTabMode() to call _showVizControls(panel, pluginId) after restoring
the mode-specific controls and before hookPanelReady(). Ensure
normal-arrangement transitions restore each panel’s active visualization
controls.

carochacs and others added 2 commits July 23, 2026 03:16
…eflow (#6)

* fix: notify plugins when recreatePanelHighway() replaces panel.canvas

recreatePanelHighway() (called on arrangement switches and viz mode
enter/exit) discards the old <canvas> and creates a fresh one to sidestep
the browser's per-canvas context-type lock, but never emitted
splitscreen:panels-changed. The documented window.slopsmithSplitscreen API
(panelIndexFor/panelChromeFor/settingsAnchorFor/isCanvasFocused) all resolve
via canvas identity, and getPanels() hands consumers a canvas reference —
any plugin (e.g. Camera Director) caching that reference would silently stop
resolving the panel after the next arrangement switch or viz toggle, with no
signal telling it to refresh.

* fix: recover all sub-panels when docking a self-split popup; reflow on section-map resize

- dockFollowerPanel() now captures every current sub-panel in the popup
  (finalStates, plural) instead of only the one whose Dock button was
  clicked. The main-side `popups` Map tracks one entry per popup WINDOW,
  not per sub-panel, so closing the window on a single sub-panel's dock
  previously discarded the other 1-3 sub-panels' state.
- _redockPanel() now accepts finalStates and builds one newPrefs entry per
  captured sub-panel, growing `layout` to the smallest LAYOUTS entry that
  fits the resulting panel count (falls back to the largest available and
  toasts if it still doesn't fit). This also fixes a related bug where
  redocking a single panel into an already-full layout silently dropped it
  (startSplitScreen only ever builds LAYOUTS[layout].panels slots).
- sizeCanvases() now lazily attaches a ResizeObserver to #section-map (the
  Section Map plugin's bar) so panels reflow when it changes height/visibility
  on its own, not just on the window resize / activation / layout-change /
  controls-toggle triggers sizeCanvases() was already called from.

Resolves the last two items (5 and 6) of the shared-architecture bug audit
tracked in #4.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Converts every existing single-line `//` comment immediately preceding a
function declaration into a `/** ... */` JSDoc block, and adds a minimal
JSDoc block (name-derived summary + @param placeholders) to the functions
that had no preceding comment at all. 0/144 -> 144/144 functions now have a
JSDoc block preceding them.

Intended to satisfy the org's reusable CI docstring-coverage gate
(got-feedback/.github/.github/workflows/reusable-ci.yml), which reported
37.50% against an 80% threshold on an upstream PR for this plugin
(got-feedBack#23). This fork's CI has never
actually run the reusable workflow (no workflow runs found), so this is a
preemptive fix rather than a response to a failing check here.

No behavior change — comment-only diff, verified with node -c and the
existing test suite (25/25 passing).

Co-authored-by: Claude <noreply@anthropic.com>

@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

🤖 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`:
- Around line 3546-3555: Update _redockPanel so a missing currentFilename does
not silently discard the captured popup state: handle this condition before
deleting the popups entry, preserve the entry for a later redock, and provide
the same user-facing feedback used by the nearby overflow-drop path. Keep normal
redocking unchanged when currentFilename is available.
🪄 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: 0ae559ce-2990-4326-a326-763bf9f4acea

📥 Commits

Reviewing files that changed from the base of the PR and between 94e75f8 and 6c7df12.

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

Comment thread screen.js Outdated
…#9)

* fix: destroy live note detector when entering Lyrics/Jumping-Tab mode

enterLyricsMode()/enterJumpingTabMode() hide detectBtn/channelBtn (fixed in
#5) because they're meaningless once the highway is stopped and the canvas
hidden, but a detector already running when the user switches into one of
these modes kept running silently — hiding its only on/off control left no
way to stop it from the UI, and detect on/off isn't persisted in prefs (only
channel/device/offset are), so it's purely an in-session toggle with no
other place tracking "should this still be on".

Now toggleDetect(panel) runs (destroying it) whenever a live detector exists
at mode entry, matching the button hide. Viz mode is unaffected — it keeps
the highway alive and detectBtn/channelBtn visible by design.

* fix: stop detector before the highway/controls in Lyrics/JT mode entry

Addresses CodeRabbit review on #9: toggleDetect(panel) ran after
panel.hw.stop() and after detectBtn was hidden, leaving the detector briefly
bound to an already-stopped highway and updating button style after the
button was already hidden. Moved the detector teardown up to run first,
before the highway stops and its controls hide.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

_redockPanel() deleted the popups entry and bailed silently when
currentFilename was empty, dropping the popped-out panel's state with
no feedback — unlike the overflow-drop path a few lines down, which
already toasts. Addresses a CodeRabbit review comment on upstream
got-feedBack#23.

Co-authored-by: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@carochacs carochacs changed the title Hide inappropriate buttons and rebrand to feedBack Fix panel mode-transition lifecycle bugs, finish feedBack rebrand, add JSDoc coverage Jul 23, 2026
@carochacs carochacs changed the title Fix panel mode-transition lifecycle bugs, finish feedBack rebrand, add JSDoc coverage Stabilize split-screen panel lifecycle + feedBack rebrand Jul 23, 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