[PR #1475] [MERGED] fix(beholder): keep Beholder open when its shortcut window minimizes (1.3.14) #1479

Closed
opened 2026-10-21 05:11:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1475
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/beholder-stay-open


📝 Commits (2)

  • c3c3daf fix(beholder): keep Beholder open when its shortcut window minimizes (1.3.14)
  • f5dc837 Merge branch 'staging' into fix/beholder-stay-open

📊 Changes

15 files changed (+545 additions, -35 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+3 -1)
➕ artifacts/beholder-1.3.14.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -0)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -0)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -0)
📝 packages/beholder/CHANGELOG.md (+4 -0)
📝 packages/beholder/client.js (+67 -7)
📝 packages/beholder/manifest.json (+3 -3)
📝 packages/beholder/src/76-onboard.js (+12 -2)
📝 packages/beholder/src/80-dock.js (+53 -3)
📝 scripts/build-beholder-package.mjs (+1 -1)
➕ tests/beholder-host-release.regression.ts (+366 -0)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1474

Follows Pasta-Devs/Marinara-Agents#1469 (Beholder 1.3.13), which fixed Pasta-Devs/Marinara-Engine#7800 for the first-open note and the build menu only.

Why this change

  • Maintainer decision (2026-10-19): when Beholder is opened from its shortcut, a click elsewhere in the chat must not close it. Once the panel is open, it stays open until the user closes it.
  • Today any press outside the Engine's shortcut window minimizes that window. A minimized window unmounts its content, including the marinara-capability-beholder host element, and BH.dock.releaseHost() then closed Beholder. Pasta-Devs/Marinara-Agents#1469 only exempted the note and the build menu, so a click on a message, the composer or the chat background still closed Beholder.
  • A second gap: registerHost() only counted host elements inside .rpg-chat-area. Since Engine 2.5.0 the shortcut window and the Tracker Panel launcher are both outside it, so no host was ever counted. Releasing either one closed Beholder even while the other was still mounted.
  • The fix is package-side. The Engine is right to unmount a minimized window's content, and keeping the panel alive in the package reaches Engine 2.5.0 users with a package update. No Engine change is needed.

What changed

  • packages/beholder/src/80-dock.js
    • registerHost() counts every host element, wherever it sits. Only an element inside the chat area still decides where the panel lives.
    • releaseHost() no longer closes an open panel when the last host goes. It closes only a panel that is already closed, or one whose chat is gone.
    • While no host is mounted, nothing tells the dock that the chat changed. showsOwnChat() reads the chat id that the composer in the panel's own chat area carries ([data-chat-composer][data-chat-id], Engine 2.5.0 and later). A MutationObserver (watchHostless()) closes the panel once that chat changes or the chat view goes away, so a stale panel never shows the old chat or writes notes, edits or builds to it. A returning host or close() disconnects the observer.
    • On an Engine that does not name the chat there (before 2.5.0, where the toolbar host did not unmount on outside clicks), showsOwnChat() is false and the panel closes with its host as before.
    • close() disconnects that observer and calls BH.onboard.hide() instead of removing the note node directly.
  • packages/beholder/src/76-onboard.js: new hide(). Closing Beholder while the first-open note is up now also removes the note's window resize listener. Before, only the node was removed and the listener stayed. The note is still not marked as read.
  • Behaviour of the shortcut: pressing it again while the panel is open shows the eye as pressed, and pressing the eye toggles the same panel shut. That is the existing toggle behaviour. There is never a second panel.
  • Opening from the Tracker Panel works as before. By the same rule, closing the Tracker Panel while Beholder is open now leaves Beholder open (it used to close it).
  • tests/beholder-host-release.regression.ts (new): loads the real 76-onboard.js and 80-dock.js against a small fake page. It covers: the host is released while the panel is open, so the panel stays open; unrelated page changes keep it open; the shortcut again toggles the same single panel; closing later leaves no observer, note, resize listener or pending frame; a hostless chat switch closes the panel; leaving the chat view closes it; with the Tracker Panel host still mounted, nothing is watched; an Engine without the composer chat id closes as before; a closed panel stays closed. It fails on the 1.3.13 source at "losing the host after a click elsewhere must not close the panel".
  • .github/workflows/pull-request-checks.yml: the Beholder contract step also runs the new regression.
  • Version 1.3.14, above every published Beholder version (the highest is 1.3.13). Added a packages/beholder/CHANGELOG.md entry.
  • Rebuilt with node scripts/build-beholder-package.mjs: packages/beholder/client.js, manifest.json, artifacts/beholder-1.3.14.zip, and the catalog/ lanes and notes.

Package and security impact

  • Affected package IDs: beholder
  • Engine compatibility impact: none. The range is unchanged (>=2.4.4 <4.0.0). The new behaviour uses the composer's data-chat-id, which Engine 2.5.0 and later render. Older Engines fall back to the previous behaviour.
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none; a normal package update

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Commands run by the agent:

  • npm run check: Prettier clean; ESLint 0 errors (811 existing repo-wide warnings, none in the touched files)
  • node scripts/validate-catalog.mjs: passed (v2=39, v3=39)
  • node scripts/test-catalog-lanes.mjs: passed
  • node scripts/validate-package-locales.mjs: passed
  • node scripts/tests/catalog-release-notes.regression.mjs: OK
  • npx tsx tests/beholder-client-contract.regression.ts: passed
  • npx tsx tests/beholder-host-release.regression.ts: passed. The same file run against the 1.3.13 source fails at the "panel stays open" assertion.
  • npx tsx tests/beholder-parity.regression.ts: 239/239
  • node scripts/build-beholder-package.mjs run twice: byte-identical output; the artifact's client.js matches packages/beholder/client.js
  • git diff --check: clean
  • One-off local browser check (not committed): the built client.js in headless Chromium, on a page shaped like Engine 2.5.0's Roleplay chat (a chat area with a named composer, the shortcut window outside it). 1.3.14 passed all 11 steps: open; host removed and panel still open; unrelated changes keep it open; shortcut again shows it pressed and toggles the single panel shut; the x closes it and removes the note and note box; a hostless chat switch closes it; leaving the chat view closes it; no page errors. 1.3.13 fails at "panel stays open". This was not a real Engine; see the manual list below.

Manual verification notes

  • Manually verify in a Roleplay chat on a computer: open Beholder from its shortcut bubble, then click a message, the composer and the chat background. The shortcut window minimizes; Beholder stays open each time.
  • Manually verify the same on a phone (sheet layout): open Beholder from the shortcut, tap elsewhere in the chat. Beholder stays open.
  • Manually verify that reopening the shortcut window while Beholder is open shows the eye as pressed, and pressing it closes Beholder. There is no second panel.
  • Manually verify that Beholder's own x still closes it, and that the message badges and the note box go with it.
  • Manually verify that with Beholder open and the shortcut window minimized, switching to another chat closes Beholder. It must not show or edit the previous chat's state.
  • Manually verify that leaving the Roleplay chat (to Home or another mode) while Beholder is open and its shortcut window is minimized closes it, and coming back shows it closed.
  • Manually verify that opening Beholder from the Tracker Panel launcher works as before, and that with the Tracker Panel open a chat switch moves Beholder to the new chat.
  • Manually verify with a cleared marinara.beholder.onboarded: open from the shortcut, close Beholder with the first-open note still up. The note goes away and shows again on the next open.
  • Manually verify the docked case: put the Beholder control into Chat Settings, open Beholder there, then close Chat Settings. Beholder stays open.

Known behaviour, not changed here: switching the Beholder agent off in Chat Settings while its panel is open leaves the panel open until the user closes it. With no host mounted, the package cannot tell "switched off" apart from "shortcut window minimized". If that should close Beholder, the Engine would need to signal it, for example by keeping the minimized control window's content mounted. That would be a separate Engine change.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

The agent found no documentation that describes Beholder closing with its shortcut window.

UI evidence (if applicable)

None from the agent.

Summary by CodeRabbit

  • Bug Fixes
    • Beholder now stays open when you click elsewhere in chat after opening it from its shortcut. It closes when you close it or leave the chat.
  • Release
    • Beholder updated to version 1.3.14.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1475 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/beholder-stay-open` --- ### 📝 Commits (2) - [`c3c3daf`](https://github.com/Pasta-Devs/Marinara-Agents/commit/c3c3dafe24e60213153207f028b3dc1d781142f3) fix(beholder): keep Beholder open when its shortcut window minimizes (1.3.14) - [`f5dc837`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f5dc8371cf361f69d0ca99a12a60af8354768444) Merge branch 'staging' into fix/beholder-stay-open ### 📊 Changes **15 files changed** (+545 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+3 -1) ➕ `artifacts/beholder-1.3.14.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -0) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -0) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -0) 📝 `packages/beholder/CHANGELOG.md` (+4 -0) 📝 `packages/beholder/client.js` (+67 -7) 📝 `packages/beholder/manifest.json` (+3 -3) 📝 `packages/beholder/src/76-onboard.js` (+12 -2) 📝 `packages/beholder/src/80-dock.js` (+53 -3) 📝 `scripts/build-beholder-package.mjs` (+1 -1) ➕ `tests/beholder-host-release.regression.ts` (+366 -0) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1474 Follows Pasta-Devs/Marinara-Agents#1469 (Beholder 1.3.13), which fixed Pasta-Devs/Marinara-Engine#7800 for the first-open note and the build menu only. ## Why this change - Maintainer decision (2026-10-19): when Beholder is opened from its shortcut, a click elsewhere in the chat must not close it. Once the panel is open, it stays open until the user closes it. - Today any press outside the Engine's shortcut window minimizes that window. A minimized window unmounts its content, including the `marinara-capability-beholder` host element, and `BH.dock.releaseHost()` then closed Beholder. Pasta-Devs/Marinara-Agents#1469 only exempted the note and the build menu, so a click on a message, the composer or the chat background still closed Beholder. - A second gap: `registerHost()` only counted host elements inside `.rpg-chat-area`. Since Engine 2.5.0 the shortcut window and the Tracker Panel launcher are both outside it, so no host was ever counted. Releasing either one closed Beholder even while the other was still mounted. - The fix is package-side. The Engine is right to unmount a minimized window's content, and keeping the panel alive in the package reaches Engine 2.5.0 users with a package update. No Engine change is needed. ## What changed - `packages/beholder/src/80-dock.js` - `registerHost()` counts every host element, wherever it sits. Only an element inside the chat area still decides where the panel lives. - `releaseHost()` no longer closes an open panel when the last host goes. It closes only a panel that is already closed, or one whose chat is gone. - While no host is mounted, nothing tells the dock that the chat changed. `showsOwnChat()` reads the chat id that the composer in the panel's own chat area carries (`[data-chat-composer][data-chat-id]`, Engine 2.5.0 and later). A `MutationObserver` (`watchHostless()`) closes the panel once that chat changes or the chat view goes away, so a stale panel never shows the old chat or writes notes, edits or builds to it. A returning host or `close()` disconnects the observer. - On an Engine that does not name the chat there (before 2.5.0, where the toolbar host did not unmount on outside clicks), `showsOwnChat()` is false and the panel closes with its host as before. - `close()` disconnects that observer and calls `BH.onboard.hide()` instead of removing the note node directly. - `packages/beholder/src/76-onboard.js`: new `hide()`. Closing Beholder while the first-open note is up now also removes the note's window `resize` listener. Before, only the node was removed and the listener stayed. The note is still not marked as read. - Behaviour of the shortcut: pressing it again while the panel is open shows the eye as pressed, and pressing the eye toggles the same panel shut. That is the existing toggle behaviour. There is never a second panel. - Opening from the Tracker Panel works as before. By the same rule, closing the Tracker Panel while Beholder is open now leaves Beholder open (it used to close it). - `tests/beholder-host-release.regression.ts` (new): loads the real `76-onboard.js` and `80-dock.js` against a small fake page. It covers: the host is released while the panel is open, so the panel stays open; unrelated page changes keep it open; the shortcut again toggles the same single panel; closing later leaves no observer, note, `resize` listener or pending frame; a hostless chat switch closes the panel; leaving the chat view closes it; with the Tracker Panel host still mounted, nothing is watched; an Engine without the composer chat id closes as before; a closed panel stays closed. It fails on the 1.3.13 source at "losing the host after a click elsewhere must not close the panel". - `.github/workflows/pull-request-checks.yml`: the Beholder contract step also runs the new regression. - Version 1.3.14, above every published Beholder version (the highest is 1.3.13). Added a `packages/beholder/CHANGELOG.md` entry. - Rebuilt with `node scripts/build-beholder-package.mjs`: `packages/beholder/client.js`, `manifest.json`, `artifacts/beholder-1.3.14.zip`, and the `catalog/` lanes and notes. ## Package and security impact - Affected package IDs: `beholder` - Engine compatibility impact: none. The range is unchanged (`>=2.4.4 <4.0.0`). The new behaviour uses the composer's `data-chat-id`, which Engine 2.5.0 and later render. Older Engines fall back to the previous behaviour. - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none; a normal package update ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` Commands run by the agent: - `npm run check`: Prettier clean; ESLint 0 errors (811 existing repo-wide warnings, none in the touched files) - `node scripts/validate-catalog.mjs`: passed (v2=39, v3=39) - `node scripts/test-catalog-lanes.mjs`: passed - `node scripts/validate-package-locales.mjs`: passed - `node scripts/tests/catalog-release-notes.regression.mjs`: OK - `npx tsx tests/beholder-client-contract.regression.ts`: passed - `npx tsx tests/beholder-host-release.regression.ts`: passed. The same file run against the 1.3.13 source fails at the "panel stays open" assertion. - `npx tsx tests/beholder-parity.regression.ts`: 239/239 - `node scripts/build-beholder-package.mjs` run twice: byte-identical output; the artifact's `client.js` matches `packages/beholder/client.js` - `git diff --check`: clean - One-off local browser check (not committed): the built `client.js` in headless Chromium, on a page shaped like Engine 2.5.0's Roleplay chat (a chat area with a named composer, the shortcut window outside it). 1.3.14 passed all 11 steps: open; host removed and panel still open; unrelated changes keep it open; shortcut again shows it pressed and toggles the single panel shut; the x closes it and removes the note and note box; a hostless chat switch closes it; leaving the chat view closes it; no page errors. 1.3.13 fails at "panel stays open". This was not a real Engine; see the manual list below. ### Manual verification notes - Manually verify in a Roleplay chat on a computer: open Beholder from its shortcut bubble, then click a message, the composer and the chat background. The shortcut window minimizes; Beholder stays open each time. - Manually verify the same on a phone (sheet layout): open Beholder from the shortcut, tap elsewhere in the chat. Beholder stays open. - Manually verify that reopening the shortcut window while Beholder is open shows the eye as pressed, and pressing it closes Beholder. There is no second panel. - Manually verify that Beholder's own x still closes it, and that the message badges and the note box go with it. - Manually verify that with Beholder open and the shortcut window minimized, switching to another chat closes Beholder. It must not show or edit the previous chat's state. - Manually verify that leaving the Roleplay chat (to Home or another mode) while Beholder is open and its shortcut window is minimized closes it, and coming back shows it closed. - Manually verify that opening Beholder from the Tracker Panel launcher works as before, and that with the Tracker Panel open a chat switch moves Beholder to the new chat. - Manually verify with a cleared `marinara.beholder.onboarded`: open from the shortcut, close Beholder with the first-open note still up. The note goes away and shows again on the next open. - Manually verify the docked case: put the Beholder control into Chat Settings, open Beholder there, then close Chat Settings. Beholder stays open. Known behaviour, not changed here: switching the Beholder agent off in Chat Settings while its panel is open leaves the panel open until the user closes it. With no host mounted, the package cannot tell "switched off" apart from "shortcut window minimized". If that should close Beholder, the Engine would need to signal it, for example by keeping the minimized control window's content mounted. That would be a separate Engine change. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation The agent found no documentation that describes Beholder closing with its shortcut window. ## UI evidence (if applicable) None from the agent. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Beholder now stays open when you click elsewhere in chat after opening it from its shortcut. It closes when you close it or leave the chat. * **Release** * Beholder updated to version 1.3.14. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:11:56 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1479
No description provided.