fix(viewer): Itars visibility on final scoring, stale layout tests, AGENTS.md publish steps (v5.15.1)
This commit is contained in:
parent
b21245dcff
commit
70ef774ea0
6 changed files with 38 additions and 19 deletions
11
AGENTS.md
11
AGENTS.md
|
|
@ -44,10 +44,15 @@ All calls take `Authorization: Bearer <token>`.
|
|||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary @gaia-project-engine-<version>.tgz
|
||||
```
|
||||
2. **Viewer files** — upload the freshly built bundle. These endpoints take the file as the
|
||||
**raw request body** (no multipart!), with parameters in the query string; js+css share a
|
||||
`bundle` id so they belong together:
|
||||
2. **Viewer files** — upload the freshly built bundle. `npm run package` emits
|
||||
`dist/package/viewer.umd.js` (already minified) + `viewer.css`; the platform's doc expects the
|
||||
js under the name `viewer.umd.min.js`, so copy/rename it first. These endpoints take the file
|
||||
as the **raw request body** (no multipart!), with parameters in the query string; js+css share
|
||||
a `bundle` id so they belong together:
|
||||
```bash
|
||||
cp dist/package/viewer.umd.js dist/package/viewer.umd.min.js
|
||||
# (optional) strip the trailing sourceMappingURL - the map isn't uploaded anyway:
|
||||
# sed -i 's|//# sourceMappingURL=viewer.umd.js.map||' dist/package/viewer.umd.min.js
|
||||
curl -X POST "$BASE/viewer/file?filename=viewer.umd.min.js&bundle=<new-bundle-id>" \
|
||||
-H "Authorization: Bearer $TOKEN" -H "Content-Type: text/javascript" \
|
||||
--data-binary @dist/package/viewer.umd.min.js
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@gaia-project/viewer",
|
||||
"version": "5.15.0",
|
||||
"version": "5.15.1",
|
||||
"description": "Functions to visualize the map and boards for gaia project inside html canvas",
|
||||
"contributors": [
|
||||
"coyotte508",
|
||||
|
|
|
|||
|
|
@ -84,13 +84,14 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Faction, finalScorings, FinalTile, Phase, Player } from "@gaia-project/engine";
|
||||
import { Faction, finalScorings, FinalTile, Phase, Planet, Player } from "@gaia-project/engine";
|
||||
import Vue from "vue";
|
||||
import { Component, Prop } from "vue-property-decorator";
|
||||
import type { MapMode } from "../data/actions";
|
||||
import { MapModeType } from "../data/actions";
|
||||
import { factionName } from "../data/factions";
|
||||
import { factionColor, factionLogTextColors } from "../graphics/utils";
|
||||
import planets from "../data/planets";
|
||||
import { factionColor, factionLogTextColors, factionPiecePlanet } from "../graphics/utils";
|
||||
import { tooltipTriggerConfig } from "../logic/tooltip";
|
||||
import Building from "./Building.vue";
|
||||
import Condition from "./Condition.vue";
|
||||
|
|
@ -132,18 +133,27 @@ export default class FinalScoringTile extends Vue {
|
|||
: player.progress(this.tile);
|
||||
}
|
||||
|
||||
/** The indent square's fill: the player's faction color (the automa neutral player reads as
|
||||
* the generic grey). */
|
||||
/** The indent square's fill: the player's faction color. Ice (Itars) is near-white (#F8FFF5), so
|
||||
* on the white card it gets its teal border color instead to stay visible. Automa reads grey. */
|
||||
indentColor(player: Player): string {
|
||||
return (player.faction as Faction | "automa") === "automa" ? factionColor("gen") : factionColor(player.faction);
|
||||
if ((player.faction as Faction | "automa") === "automa") {
|
||||
return factionColor("gen");
|
||||
}
|
||||
return factionPiecePlanet(player.faction) === Planet.Ice
|
||||
? planets[Planet.Ice].borderColor
|
||||
: factionColor(player.faction);
|
||||
}
|
||||
|
||||
/** Score text color: black on the light faction colors (Gleens' yellow etc.) for legibility,
|
||||
* white on the dark ones - the same per-faction split the log uses. Automa (grey) reads white. */
|
||||
/** Score text color: black on the light faction colors (Gleens' yellow, and Itars' teal chip)
|
||||
* for legibility, white on the dark ones - the same per-faction split the log uses. Automa
|
||||
* (grey) reads white. */
|
||||
scoreTextColor(player: Player): string {
|
||||
if ((player.faction as Faction | "automa") === "automa") {
|
||||
return "#fff";
|
||||
}
|
||||
if (factionPiecePlanet(player.faction) === Planet.Ice) {
|
||||
return "#fff"; // white text on the teal chip
|
||||
}
|
||||
return factionLogTextColors[player.faction];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -259,17 +259,16 @@ describe("Game", () => {
|
|||
const scoringBoard = researchBoard.nextElementSibling;
|
||||
expect(scoringBoard.tagName).to.equal("svg");
|
||||
// Base game framing: the research board at the viewBox origin, and the side ScoringBoard
|
||||
// with NO y offset. The pre-LF y="-25" pushed the final scoring tiles 25 units above the
|
||||
// canvas' minY=0 and clipped them at the top (owner report, 2026-09) - y is absent now.
|
||||
// anchored at y=0 so its top aligns with the research tracks' top (owner report, 2026-09).
|
||||
expect(researchBoard.getAttribute("y")).to.equal(null);
|
||||
expect(scoringBoard.getAttribute("y")).to.equal(null);
|
||||
expect(scoringBoard.getAttribute("y")).to.equal("0");
|
||||
|
||||
const [, minY, , height] = svg.getAttribute("viewBox").split(" ").map(Number);
|
||||
expect(minY).to.equal(0);
|
||||
// ScoringBoard renders at width=90 against its own `viewBox="0 0 80 480"` with no explicit
|
||||
// height, so its rendered height auto-scales to preserve aspect ratio: 90 * (480/80) = 540,
|
||||
// starting exactly at the viewBox top - a 505-tall viewBox shows it down to y=505 of its
|
||||
// own 540; its content (final scoring + round tiles) ends at y=480, the rest is padding.
|
||||
// The scoring column is 446 tall (the research board's 440 + the ~6 units the general tech
|
||||
// tiles extend past it), so its bottom aligns with the tech tiles' bottom edge.
|
||||
expect(scoringBoard.getAttribute("viewBox")).to.contain("446");
|
||||
// The canvas still reserves room for the power/QIC action row below the tracks.
|
||||
expect(height).to.equal(505);
|
||||
|
||||
vm.$el.remove();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
import { Expansion, Faction, factionPlanet, Planet } from "@gaia-project/engine";
|
||||
import planets from "../data/planets";
|
||||
// Re-exported so UI that shades a faction-colored chip (final-scoring indents, ...) can tell a
|
||||
// light faction color from a dark one without re-deriving the planet.
|
||||
export { factionPlanet };
|
||||
|
||||
export function factionPiecePlanet(faction: Faction): Planet {
|
||||
switch (faction) {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,9 @@ describe("Utils", () => {
|
|||
const engine = new Engine(["init 2 my-cool-seed"], { lostFleet: true });
|
||||
|
||||
expect(engine.tiles.scorings.final).to.have.length(2);
|
||||
expect(researchBoardHeight(engine)).to.equal(455);
|
||||
// The Lost Fleet scoring column now stretches so the bottom final tile meets the power/QIC
|
||||
// action row's bottom edge (y=492), so the board height grew from 455 to 481.
|
||||
expect(researchBoardHeight(engine)).to.equal(481);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue