feat: client shell, sign-in and protocol client (#67)

New `client/` package (Vite + TypeScript + PixiJS v8, plain DOM overlay):
the pure reducer seam (no Pixi import), an append-only slice registry
build-time glob, the `proto` 2 WS client with envelope/ack/closing mapping,
the sign-in door (`POST /join`, one "Key not recognised." for wrong and
unknown), the DOM shell/HUD and a minimal Pixi stage created only after a
live `hello`. `hello` resets every slice so a reconnect cannot show stale
state; `proto-mismatch` shows reload; `revoked` returns to the sign-in page
and stops.

The browser e2e moves into the client package (`client/e2e/`, owning
playwright-core) and runs the real Vite build through the TLS/HTTP2 test
nginx: join -> canvas -> hello/roster for GM and player, no data before
join, identical wrong/unknown key refusal, proto mismatch, revoked.
`devbox run client-test` adds the Vitest seam; `devbox run e2e` builds the
client first. The #66 stub dist stays local to `tools/vhost.test.mjs`, so
`devbox run test` still needs no npm install.

Refs #67
This commit is contained in:
2026-11-20 23:57:16 +01:00
parent 97f618c5ad
commit 3c0258ea31
37 changed files with 3439 additions and 178 deletions
+104
View File
@@ -0,0 +1,104 @@
html,
body {
margin: 0;
height: 100%;
overflow: hidden;
background: #000;
color: #eee;
font: 14px/1.4 system-ui, sans-serif;
}
#app {
position: fixed;
inset: 0;
}
[hidden] {
display: none !important;
}
#stage {
position: absolute;
inset: 0;
}
#stage canvas {
display: block;
}
#boot,
#signin,
#fatal {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
padding: 24px;
text-align: center;
}
#signin form {
display: flex;
flex-direction: column;
gap: 8px;
width: min(360px, 90vw);
}
#key {
font: inherit;
padding: 10px 12px;
border-radius: 6px;
border: 1px solid #555;
background: #111;
color: inherit;
letter-spacing: 0.08em;
text-transform: uppercase;
}
#signin button,
#fatal button {
font: inherit;
padding: 10px 12px;
border-radius: 6px;
border: 1px solid #777;
background: #222;
color: inherit;
}
#signin-error {
color: #ff8a8a;
}
#hud {
position: absolute;
top: 0;
left: 0;
right: 0;
display: flex;
gap: 16px;
align-items: baseline;
padding: 6px 12px;
background: rgb(0 0 0 / 65%);
pointer-events: none;
font: 12px/1.4 ui-monospace, monospace;
}
#roster {
display: flex;
gap: 12px;
margin: 0;
padding: 0;
list-style: none;
}
#roster li {
display: flex;
gap: 4px;
}
#roster-state {
opacity: 0.6;
}