Commit graph

2,677 commits

Author SHA1 Message Date
85a516040f
Keep auto-charge and planning in Gaia’s action bar (#334)
* Improve premoves and fix random auctions and Ivits exploration

* Fix blocked legacy random-faction sealed auctions

* Allow premoves for initial building and booster choices

* Compact setup actions and show ship explorers

* Restore auto-charge controls in Gaia game UI

* Use published player-settings protocol 0.3.4

* Allow verified protocol 0.3.4 during release-age quarantine

* Keep planning and auto-charge in the action bar outside your turn

* Bump viewer to 5.20.6 for action bar release
2026-09-19 12:02:37 +02:00
cfed58ed68
Teach range boosts and passing through native tutorial controls (#333) 2026-09-17 16:49:47 +02:00
8c50089ccd
Use native game controls throughout tutorials (#332) 2026-09-17 16:14:06 +02:00
28ff1fb405 Add playable Gaia Project tutorial course 2026-09-16 19:17:53 +02:00
2fb542b2fb Hide chat shortcut until there are unread messages 2026-09-15 11:51:31 +02:00
e3a8e0a664
Use shared BGS viewer and chat protocol (#331)
* Use shared BGS viewer and chat protocol

* Use shared chat panel with faction portraits and mobile viewport

* Update shared chat visibility and show date separators

* Keep typing after completing a chat mention
2026-09-13 22:54:32 +02:00
8967afe112 Fix chat history unread state and remove decorative tray handle 2026-09-11 20:43:58 +02:00
e299b0fd3e fix(viewer): keep mobile chat accessible beside turn controls 2026-09-11 16:42:16 +02:00
3644919458 feat(viewer): restore old UI with Lost Fleet support 2026-09-11 15:33:28 +02:00
a01f3a793c fix(viewer): mark engine options as a type-only import 2026-09-10 23:39:23 +02:00
de42325cc6
feat(viewer): add faction portraits, chat and action sounds (#330) 2026-09-10 23:37:58 +02:00
2e21d6d2d3 fix(viewer): top-align scoring tiles with tight spacing (undo fill-the-height spread)
Base (ScoringBoard) and Lost Fleet (ResearchBoard 7th column) both restyled the scoring column to
spread tiles evenly down the full board height (base) / pin finals to the action-row bottom (LF),
which read as 'spaced out'. Back to a tight top-aligned stack: base gap 4 units; Lost Fleet keeps
R6 anchored at the top, round tiles step a uniform tile+2, and the finals now sit directly below
R1's bottom edge (they previously overlapped R1 - positioned from its top, hiding it). Icons
unchanged. utils.ts researchBoardHeight/BOTTOM_SCORING_TILE_Y kept in sync (448 for LF).

viewer 5.16.2
2026-09-08 23:43:17 +02:00
7b144b807a chore(viewer): 5.16.1 - rebuild against engine 4.12.2 (federation fromData fix)
The viewer bundle embeds its own copy of the engine, so the browser-side fromData also crashed on
the object-shaped federation hexes (blank board). Rebuild picks up the fixed engine.
2026-09-08 18:31:24 +02:00
439f05baff chore(engine): 4.12.2 2026-09-08 18:00:18 +02:00
ff3bd8fd71 fix(engine): fromData accepts federation hexes saved as raw objects, not just strings
Player.toJSON serializes federationCache.federations[].hexes as coordinate strings, but a state
can be persisted with the raw hex objects (the engine's Object.assign({}, this) serialization
copies the cache by reference, bypassing the player's own toJSON). fromData then called
map.getS(object) -> 'coords.includes is not a function' during load, the viewer swallowed it, and
the board rendered blank with no console error (game Electric-plaza-5793, a Nevlas player with 4
federations). Accept both forms: string parses via getS, object is looked up by {q, r}.
2026-09-08 18:00:10 +02:00
65745dfe9e chore(engine): 4.12.1 2026-09-08 10:44:12 +02:00
1277b8ee12 fix(engine): rehydrate state in wrapper.currentPlayer before calling instance members
The game-server holds game state as plain JSON (Mongo + worker boundary both JSON-round-trip),
so currentPlayer() receives a plain object, not an Engine. sealedBidPendingSeats() is a METHOD -
it does not survive serialization - so calling it on the plain object threw
'engine.sealedBidPendingSeats is not a function' on every move in a sealed-bid game (incl. the
setup ban/pick moves, since currentPlayer runs after each). Restore via Engine.fromData like
move()/replay() already do. playerToMove survives as data (toJSON exports getters) but the method
does not, which is why this only broke once sealed bidding added a method call to currentPlayer.
2026-09-08 10:43:51 +02:00
49fc40dc40 feat(engine): simultaneous sealed bidding - any order, hidden until all in (BGS contract)
- engine.sealedBidPendingSeats(): seats still owing a bid (undefined outside bid phases)
- move()/loadTurnMoves: accept silentBid/preferenceBid from ANY pending seat regardless of
  playerToMove (was: strict turn-order assert -> 'not your turn to play' for off-turn bidders)
- bid phases resolve on the LAST pending bid, not on the sequential turn walk
- move() attributes the log line to the actual bidder, not playerToMove
- wrapper.currentPlayer() returns number[] of pending seats during bid phases (the platform's
  /move route authorizes any seat in game.currentPlayers, which it fills from currentPlayer())
- deterministic auction tiebreaks (last faction-nominator wins) replace the seeded PRNG, so the
  resolution no longer needs map.rng - which crashed hosted simultaneous bidding on a reloaded
  engine ('map.rng is not a function'); bids + nominations alone now reproduce the result
- viewer: SealedBidPanel drops the waiting-for-turn gate (every pending seat bids at once) and
  seat-prefixes the emitted move so the engine can parse the bidder

engine 4.12.0, viewer 5.16.0
2026-09-08 10:03:24 +02:00
ad99d3d633 feat(viewer): hide premove bar ('Plan your next turn') - BGS has its own planning UI (v5.15.6) 2026-09-06 08:19:56 +00:00
77a0d8b422 feat(viewer): remove auto-leech control (platform sidebar owns it); flat gaia planet on gaia track; automa final-score black text (v5.15.5) 2026-09-06 08:13:23 +00:00
d3754c5f3d feat(viewer): flat planets always - remove sphere gradient for planets (v5.15.4) 2026-09-06 07:58:58 +00:00
0f7bac0b6b fix(viewer): spectators no longer see/press the current player's action buttons (canPlay) (v5.15.3) 2026-09-05 20:00:37 +00:00
58af97b85a fix(viewer): Planet.classes default to [] - guard spread against undefined (v5.15.2) 2026-09-05 19:50:47 +00:00
70ef774ea0 fix(viewer): Itars visibility on final scoring, stale layout tests, AGENTS.md publish steps (v5.15.1) 2026-09-05 12:52:35 +00:00
b21245dcff Improve visual styling of planets, scoring tiles, and research board 2026-09-05 12:34:43 +00:00
88b3f0446b feat(engine): export hashSeed = false - keep raw seeds on BGS (4.11.1)
The game-server now reads `engine.hashSeed ?? !!engine.stripSecret` to
decide whether the seed is sha256-hashed before init. Gaia's only hidden
information is the sealed-bid auction - player CHOICE, not seed-derived -
so the stripSecret-based default hashed our seeds pointlessly (sidebar log
showed base64 instead of the game name since the LF engine). Force the
raw seed.
2026-09-01 10:34:55 +00:00
14347432f0 feat: remove Frontiers expansion; fix import cycles + base-game scoring clip; Vite dev app (engine 4.11.0, viewer 5.15.0)
FRONTIERS REMOVAL (engine + viewer). Old BGS games pin old engine
versions so replay compatibility is unaffected; no current-version
games used Frontiers.

Engine (745 tests passing, 0 lint errors):
- deleted available/ships.ts (+spec), move/ships.ts
- enums: Frontiers bitflag, ResearchField.Diplomacy, Resource Trade*/
  ShipRange/UpgradeDiplomacy, Building ships/Colony/CustomsPost block
  (+ships()/isShip()/isAvailableShip()/Ship), Command.MoveShip,
  Phase.RoundShip, Condition.Trade, TechFrontiers1, Diplomacy tech pos
  members; Expansion.All now = LostFleet
- research-tracks: Diplomacy track, frontiersEco, ship-range rewards
  stripped from base Navigation track; all other Frontiers-only fields,
  handlers, cases and AI dimensions removed
- wrapper.ts: frontiers expansion flag

Viewer (863 tests passing, lint clean):
- deleted logic/trade-rewards.ts, logic/buttons/ships.ts,
  charts/testdata/frontiers/; zero 'frontiers' references remain

IMPORT-CYCLE + CJS FIXES surfaced by the Vite dev server (ESM strict
order), all pre-existing bugs webpack/CJS masked:
- engine/src/buildings.ts imported from ".." (package root -> compiled
  dist) - now "./enums"
- engine/index.ts re-exported ~15 type-only names as values
  (BrainstoneDest, MaxLeech, EventSource, EngineOptions, the
  Available* block, ResourceConversion, FederationInfo, GaiaHexData,
  AvailableSetupOption, PreferenceSplit*/SilentAuction* types) -
  split into 'export type' (load-bearing for rolldown too)
- viewer: Rules.vue registers FactionInfoCard async, breaking the
  Rules -> FactionInfoCard -> PlayerInfo -> Rules cycle
- viewer: buttonStringLabel moved from logic/buttons/utils.ts to
  shortcuts.ts (re-exported), breaking utils <-> shortcuts

DEV APP ON VITE (npm run serve = vite --port 8080):
- vite.config.ts mode-aware: dev = SPA (index.html + public/ +
  engine-source aliases + optimizeDeps exclusion), build = the
  published IIFE lib (unchanged single-file contract, verified)
- package.json: pruned webpack-era files/unpkg entries (.map dropped
  - no map uploads per owner decision); deleted
  scripts/fix-package-imports.ts (referenced the vite build's
  nonexistent dist/package/css)
- dev boot verified in Chromium: self-contained picker renders,
  zero page errors

BASE-GAME SCORING CLIP (follow-up on 5.14.2, which shipped without
the intended fix due to a no-op string replace): ScoringBoard's
y=-25 offset removed for real; spec pins y===null; verified in the
built bundle (first final tile fully inside the canvas top).

AGENTS.md: no sourcemap upload to BGS (owner decision); bodyparser
exemption noted as deployed.
2026-09-01 10:33:08 +00:00
ac75ca9ab4 feat(viewer): drop the rounded board cards, fix base-game scoring board clip (v5.14.2)
Two follow-up layout fixes from owner feedback:

1. The rounded card chrome is gone in BOTH base and Lost Fleet games:
   the space map no longer paints a table-surface background, rounded
   corners and inset border ring (theme.scss's .space-map rule), and
   the research/actions canvas no longer draws its rounded
   research-actions-panel rect behind the tracks (Game.vue). The boards
   render on the page background like the pre-Lost-Fleet viewer; the
   analysis-mode hazard overlay still paints on the map element. The
   now-unused --ui-map-*/--ui-board-* theme vars are removed.

2. The base-game side ScoringBoard no longer clips at the top: the
   pre-LF y=-25 offset pushed its first final-scoring tile 25 units
   above the canvas viewBox top (the clip the owner saw); y=0 now
   aligns the board with the canvas top.

Also verified programmatically in Chromium: map background
transparent/radius 0/shadow none, no .research-actions-panel node,
scoring board top not clipped. 873 tests pass; Game.spec.ts pins the
panel rect's absence for Lost Fleet now.
2026-09-01 09:55:30 +00:00
fd3cc31662 feat(viewer): restore compact turn order, drop notes, fix base-game board layout (v5.14.1)
Three UI fixes from owner feedback on the Lost-Fleet-era layout:

1. Turn order: the Gaia-9/10 full-width rounded top banner is gone -
   back to the pre-expansion compact indicator (h5 + player circles,
   presence dots kept) sitting in the commands row (col-md-4, mobile
   order-flip restored). The banner was designed to be replaced by a
   platform-side HostedBar that never existed, so it rendered
   everywhere including hosted BGS games.

2. Notes: LostFleetNotes.vue removed entirely (component, spec, and
   the store's notesBackend/NotesBackend/setNotesBackend plumbing -
   never called from viewer code; per-game notes are the hosting
   platform's job now).

3. Base-game (non-Lost-Fleet) board layout: the LF merge had changed
   shared values for all games. Restored the pre-expansion framing for
   the base game, LF-conditional: viewBox min-x 0 (was -50), canvas
   width tracks+120 (was +170), canvas height 505 (was 550 - the extra
   45 was the empty strip at the bottom), ResearchBoard height 450,
   ScoringBoard y=-25 restored, action row back to translate(45i+6,455),
   and the 65/35 map/side-column split scoped to .lost-fleet only.

Verified in Chromium: base-game round-1 layout matches the old framing
(tracks left-anchored, scoring board right, no bottom gap, compact turn
order) and a Lost Fleet round-1 game keeps its ship/scoring/pool
layout. 873 viewer tests pass (LostFleetNotes.spec deleted, Game.spec
updated to pin the restored layout).
2026-09-01 09:33:03 +00:00
662e64891a feat(viewer): migrate build to Vite 8 + rolldown, tests to vitest 4 (v5.14.0)
The vue-cli/webpack 4 toolchain was the root cause of three shipped
production crashes this week (iterator-spread __spreadArrays RangeError,
stale cache-loader emitting raw vue_1.default for the vue external, and
the TDZ circular-import). Replace it:

- vite.config.ts: lib build of src/wrapper.ts -> dist/package/
  viewer.umd.js (IIFE, esnext, minified) + viewer.css + map. vue and
  bootstrap-vue stay external (window.Vue / window.BootstrapVue) via
  plain global reads - no .default interop possible. process.env is
  baked to ({}) via define, matching vue-cli's old defaults.
- vitest.config.ts: jsdom env, single fork, chai-compatible specs run
  unchanged. 879 tests pass (was 809 - the json-driven chart/resource
  suites now register their dynamic tests properly under vitest).
- import type correctness across the codebase: rolldown rejects
  value-imports of type-only exports, so type-only imports are now
  written as import type (and mixed imports split). Also fixes
  self-contained-state.ts's reassignment of a destructured const.
- Commands.spec.ts: split a two-render test into two its - two
  @testing-library renders of Commands in one test interfere under
  vitest.
- scripts: package/build -> vite build, test -> vitest run.
- devDeps: +vite +@vitejs/plugin-vue2 +vitest +jsdom +esbuild +events
  (browser polyfill for the engine's node 'events' import).

Verified in Chromium against the built bundle: loads with CDN Vue 2 +
BootstrapVue, Rotate sectors completes with and without rotations, zero
pageerrors; the bundle contains no __spreadArrays helpers.
2026-09-01 09:00:07 +00:00
1288a8978c docs(AGENTS.md): correct BGS upload API usage (raw body, query params, octet-stream for maps)
The admin endpoints take the file as the raw request body with query
parameters - not multipart. The map upload must use
application/octet-stream because koa-bodyparser's 1MB jsonLimit
intercepts application/json bodies before the route's raw reader and
413s anything larger. Also note the GET-before-PUT rule (the engine
upload mutates the doc; a PUT from a stale GET reverts it).
2026-09-01 08:14:53 +00:00
bb39d47586 fix: RangeError on Rotate sectors + bundle load crash (viewer 5.13.1, engine 4.10.3)
- Replace all iterator spreads ([...map.values()] etc) with Array.from() across
  engine and viewer: under the TS->babel downlevel chain they compiled to
  __spreadArrays, which reads .length on an iterator and produced
  'RangeError: invalid array length' on 'Sector rotations finished' (the
  reported boardgamers.space crash), plus several latent same-class sites.
- Break the research-tracks.ts -> ../index barrel import cycle (imports
  Event/Expansion from leaf modules now): the cycle left Engine in TDZ and
  the whole bundle failed with 'Cannot access engine_Engine before
  initialization' at module eval under the rebuilt module order.
- Fix stale cache-loader output producing raw vue_1.default accesses for the
  vue webpack external (window.Vue has no .default): 'Cannot read properties
  of undefined (reading extend)' at load. Clean rebuild emits babel interop
  wrappers correctly. vue-global-shim.js added as belt-and-braces doc for the
  external's shape.
- Add autoprefixer as an explicit viewer devDependency (pnpm 11 no longer
  hoists it; the lib build failed on postCSS plugin load).
- Update stale spec type signatures surfaced by the import change (tile
  position as EventSource, loadFaction arity, ChargeRequest literal cast,
  AvailableCommand data narrowing, FederationInfo new fields).

Verified: engine 750 passing / 4 pending; viewer 809 passing; lint + prettier
clean; rebuilt UMD has zero iterator-spread call sites and loads + completes
sector rotation (with and without rotations) in Chromium against the real
bundle with CDN-provided Vue 2.
2026-09-01 08:09:31 +00:00
bfed8f506e
Merge gaia-lost-fleet: Lost Fleet expansion, sandbox mode, sealed-bid auctions (#328)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Kim <kim.pham.nguyen2@gmail.com>
Co-authored-by: kimphamnguyen <82032729+kimphamnguyen@users.noreply.github.com>
2026-08-25 00:07:03 +02:00
github-actions
45951431e6 🔖 (viewer) v5.12.0
Some checks are pending
All / prettier (push) Waiting to run
v5.12.0
2026-08-19 20:30:57 +00:00
67259ddff7 Add dark mode support and theme toggle button 2026-08-19 20:29:10 +00:00
1b241820cc Use choice dropdown for version bump type in workflows 2026-08-19 10:28:00 +00:00
github-actions
3471317603 🔖 (engine) v4.9.0
Some checks are pending
Engine - Test / lint_and_test (push) Waiting to run
All / prettier (push) Waiting to run
v4.9.0
2026-08-19 10:20:12 +00:00
2e6e4ce4d1
perf(engine): 10x federation enumeration — fixes >10s move timeouts in prod games (#325) 2026-08-19 12:19:05 +02:00
github-actions
bcdcd3256f 🔖 (engine) v4.8.52
Some checks are pending
Engine - Test / lint_and_test (push) Waiting to run
All / prettier (push) Waiting to run
v4.8.52
2026-08-12 21:29:13 +00:00
64cad793d6
fix: upgrade engine TypeScript to fix tsc publish build (#324) 2026-08-12 22:56:33 +02:00
f440b30c09
feat: add moveAI for bot players (#323) 2026-08-12 22:38:54 +02:00
a1835c39d7 🔧 Ignore .playwright-mcp artifacts 2026-08-12 20:20:35 +02:00
github-actions
9c8bca7e0c 🔖 (viewer) v5.11.53
Some checks are pending
All / prettier (push) Waiting to run
v5.11.53
2026-08-11 20:57:15 +00:00
155e032569
💄 Fix charts icon clipped on the right edge of the map (#322) 2026-08-11 22:56:33 +02:00
github-actions
dc77d8ca49 🔖 (viewer) v5.11.52
Some checks are pending
All / prettier (push) Waiting to run
v5.11.52
2026-08-07 22:40:00 +00:00
e3ab7c60f1 Fix text contrast in scoring and tech tiles for dark mode 2026-08-07 22:38:38 +00:00
github-actions
1b92dd06e9 🔖 (viewer) v5.11.51
Some checks are pending
All / prettier (push) Waiting to run
v5.11.51
2026-08-07 22:26:29 +00:00
e66c98a444 Update repository URL in package.json files 2026-08-07 22:25:38 +00:00
06c934d5c8 Update pnpm config and enable transpile-only for viewer build 2026-08-07 22:21:19 +00:00
1d56c2ea9a Update publish workflows to Node 24 and OIDC publishing 2026-08-07 22:03:19 +00:00