The inline renderer script was building attachment separators with unescaped \n strings inside the TypeScript template literal, which produced real newlines in the generated HTML and broke parsing in the packaged build.
Re-applies the 41920b0 prompt-window improvements (attachments, auto-growing textarea, smaller sizes) on top of the known-working sandboxed data-URL/preload loading strategy. No other files touched.
This reverts the prompt-window renderer and window setup to the last
commit where the prompt window was reported to work flawlessly, while
leaving all other v3.1.0 enhancements (pet context menu, scale presets,
settings nudge buttons, etc.) intact.
- Revert the prompt window to the previously working load strategy:
sandbox: true, preload resolved via app.getAppPath(), and loadURL with
a data: URL generated from the inline HTML.
- Keep current UI enhancements (attachments, auto-growing textarea,
Enter-to-send, toolbar buttons, resize grip, etc.).
- Remove the temporary-file load path and app.asar.unpacked preload
resolution that broke IPC in the packaged build.
- Fix preload resolution for packaged builds: use app.asar.unpacked path
when app.isPackaged, so sandboxed preloads load correctly in signed
installers. This was the root cause of the broken prompt box and
non-functional pet interactions.
- Remove the visible scale-handle circle from the pet window.
- Keep keyboard arrow nudges for pet scale (focus pet window, then
arrow keys).
- Add left/right arrow nudge buttons next to the pet-scale slider in
Settings > General.
- Update styles for the new scale-nudge buttons.
- Rename the context-menu submenu from 'Virtual Pet' to 'Pet Status'.
- Apply Title Casing to all virtual-pet menu labels ('Check On Pet',
'Play Game', 'Feed Snack', 'Let Rest', 'Pet Status').
- Move care actions (Pet, Play Game, Feed Snack, Let Rest) to the top
level, ordered by priority.
- Place the 'Pet Status' submenu directly under 'Check On Pet'.
- Reorder stat rows to Level, Bond, Mood, Play, Food, Energy.
- Update the golden plugin test to match the new row grouping.
- Switch prompt window preload path to dirname(import.meta.url) so the
unpacked preload resolves correctly in packaged (app.asar) builds.
- Load prompt window from a temp file instead of a data: URL; sandboxed
preload + file:// origin works more reliably with Electron's security
model than an inline data: document.
- Add renderer error logging through the preload bridge and guard against
a missing API object.
- Render a visible scale handle inside the pet shell; add CSS so it is
grabbable, pointer-events-enabled, and not clipped.
- Add keyboard arrow nudges (up/down/left/right) to adjust pet scale when
the pet window is focused, with a debounced commit.
Refs: v3.1.0-integrated follow-up
- Stop pet window from skipping on click/drag release by anchoring resizes to the pet's current foot position and removing the post-drag resize.
- Use screen coordinates and remove throttle for smooth scale-handle dragging.
- Reintroduce abbreviated scale preset dropdown (XXXS-XXXL) alongside the slider.
- Fix prompt-window attachment busy-lock, use visually-hidden file input, and support binary files as data URLs.
- Tie prompt textarea height to the resized window; Enter sends, Ctrl+Enter inserts newline.
- Harden prompt window: new chat opens message view, preload files unpacked from asar.
Merged origin/main (release v3.0.0) into main and preserved fork features:
- Minimal compact prompt window (140px) that expands with editor/history.
- Larger pet speech bubbles that scale with pet/window size.
- Improved chat command memory extraction (/remember, /memorize, /note, don't forget).
- Continuous pet scale slider from 0.16x to 10x (screen-filling).
Version bumped to 3.1.0.
- Prompt window opens at 140px compact height and expands to 456px when editor/history shown.
- Pet speech bubbles scale with larger pets and window sizes; removed text overflow clipping.
- Extracted prompt memory extraction into testable module; added /remember, /memorize, /note, don't forget patterns.
- Replaced pet scale dropdown with continuous slider from 0.16x to 10x.
- Added prompt-memory-extraction.test.ts and updated packaging/onboarding tests.
- packages/sdk: new types-only @open-pets/plugin-sdk — OpenPetsContext + the
ambient OpenPetsPlugin global, plus a mock-ctx contract test. Zero runtime
deps; published for editor autocomplete (npm i -D @open-pets/plugin-sdk).
- cli: `openpets plugin new <name>` scaffolds a plugin folder (manifest +
entry + README) so step zero is npx, not copy-paste.
- desktop: compile-time conformance guard tying the runtime plugin SDK
(namespaces + JS permission set) to the published @open-pets/plugin-sdk
contract, so the two can't drift.
- release-npm: include packages/sdk in the publish order.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Multi-monitor fix: pet stays on its current display instead of being
clamped back to the primary screen.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The pet window position was always clamped to the primary display's
work area via clampToPrimaryWorkArea. On a multi-monitor setup, a pet
dragged onto an external monitor was yanked back to the built-in screen
whenever its position was read, saved, or restored — most visibly when
display-metrics-changed fires (display sleep/wake, scale changes, Space
switches), which macOS emits frequently.
Clamp to the display nearest the window's centre instead, so the pet
stays on whatever monitor it lives on. If that display is disconnected,
getDisplayNearestPoint falls back to a connected one, preserving the
keep-on-screen safety net.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>