* Use shared BGS viewer and chat protocol
* Use shared chat panel with Container styling
* Update shared chat visibility and show date separators
* Keep typing after completing a chat mention
The shim's bare require expects the vue-3 parse shape but declares no
dependency, so it resolved through pnpm's hidden hoist — which could pick
vue 2.7's legacy-shaped 2.7.16 (CI) or 3.5.41 (local) depending on layout.
packageExtensions makes it deterministic.
The per-directory v5.3 lockfiles were stale against the 2.0.0 package.jsons and
unreadable by the workflows' pnpm 5 anyway; the root v9 workspace lockfile is
authoritative. Reformat sources for prettier-plugin-organize-imports v3 and
ignore build artifacts.
The modal kept its own light backgrounds (#fefefe content, #ccc/#fff log
rows) but let the text color inherit from the page, so the platform's dark
mode rendered it white-on-gray. Pin an explicit dark text color on
.modal-content — the viewer styles everything else with fixed colors too —
so the log (and the other modals) are readable in both themes.
After a drag-drop the viewer paints a local preview of the move synchronously,
then the server's tentative echo of the same turn buffer arrived a few hundred
ms later and went through replaceState again. Rebuilding every piece while the
drop animation was still in flight made the piece show at its destination
instantly while also tweening there from the drop point. Matching echoes now
short-circuit like stale ones already did — they only trigger the move sound,
which used to be the echo replace's job (local previews are silent).
Also delay the self-contained harness's tentative echo by 300ms so it lands
mid-animation like on the real platform instead of masking such races.
The preferences object handed to Game as a prop was a plain object owned by
launch(), and Vue 2 does not deep-observe prop values coming from a
non-reactive parent. Toggling sound or the drag/drop help indicators mutated
an unobserved object, so the UI only caught up on the next unrelated
re-render (in practice: after a refresh). Make the object a Vue.observable
and merge platform preference pushes into it instead of replacing it, so both
the in-game toggles and platform updates paint immediately.
Production deploys upload only dist/container-viewer.umd.min.js and
dist/container-viewer.css to S3; the lib build emitted the toolbar icons to
dist/img/*.svg and the sounds to dist/media/* and referenced them by relative
URL, so they all 404'd on the platform (v2 worked only because jsdelivr served
the whole npm package). Swap the svg rule's file-loader for url-loader and
raise the images/media inline limits so every asset becomes a data URI inside
the two uploaded files.
A move response's tentative state replaced the local preview
unconditionally. If the user had undone down to an empty buffer (which
re-emits nothing) or already made another move, a late echo transiently
showed a phantom or regressed move (and a wrong sidebar log) until the
next response landed.
Only accept a tentative state whose visible log extends the committed log
by exactly the buffered moves, in order — validated against the engine:
every tentative echo satisfies this (all tentative moves are visible-log
moves; bids and bid-phase loans go to the hidden log but commit
immediately and never take this path). Stale echoes are dropped; the echo
for the current buffer, if one is in flight, follows anyway.
Its only consumer was the wrapper's Undo handling, deleted when the
tentative-turn model replaced destructive undo; nothing in the engine or
the viewer sources references it anymore (full replays go through
wrapper.replay). Removing a public API is fine for the 2.0.0 major.
Upkeep seizures picked containers with a bare Math.random, breaking the
platform guarantee that the same seed yields the same game and making
wrapper.replay diverge from the original whenever a seizure occurred
(seizures are log *events*, not moves, so nothing recorded the choice).
Seed a per-upkeep seedrandom stream from the persisted game seed plus the
visible log length — which uniquely identifies the upkeep within the game,
since each upkeep immediately follows its own Pass/Accept/Decline log
entry — so both live play and full replays reproduce the same seizures.
Typing removeRandom along the way exposed that warehouse/factory-store
seizure messages read .color on a ContainerOnStore (always undefined);
they now correctly read .piece.color.
dropPlayer unconditionally called nextPlayer, which resets currentPlayers
to a single player. During an auction (currentPlayers = all pending
bidders) dropping one bidder handed the turn to the auctioneer — who has
no available moves yet — wedging the game and discarding the other
bidders' pending turns. It also advanced the turn even when the dropped
player was not up at all, and skipped the next player's upkeep
(actions/available moves) in the move phase.
Now the drop auto-plays only the dropped player's own pending decision
through the regular engine path — Bid bash in the bid phase (including the
additional-bid round), Accept the highest bid as auctioneer, Pass in the
move phase — and touches nothing if the player is not up. The engine's
existing isDropped filters take care of skipping them afterwards.
Also make the highest-bid computation ignore dropped players' bids: a
dropped bidder's stale high bid used to poison Math.max, leaving
highestBidders empty and crashing the accept/decline phase.
A state saved mid-bid-phase keeps its newest moves (bids, bid-phase loans)
in G.hiddenLog — they are only flushed to G.log when the accept/decline
phase starts. replay() only walked G.log, so an admin full-replay of such
a save silently lost the bids and diverged.
Whenever hiddenLog is non-empty it holds exactly the moves made after the
last visible log entry, in order (the visible log freezes during the bid
phase), so replaying [...log, ...hiddenLog] reconstructs the state
faithfully. logSlice's truncated-log replay now explicitly drops the
hidden log, since it reconstructs a historical state predating it.
Scripted 3-player game into a simultaneous-bidders auction; asserts every
bid is a single-move committed turn, the tie opens an additional-bid round
among the tied bidders, bids stay in the hidden log until the tie resolves,
and the accept settles the right amounts.