Skip to content

lobby: phased UI work now that the hub owns geometry and deja's tape #344

Description

@aaylward

Ordered successor to #326, which is the brainstorm. The hub half landed in muchq/MoonBase#1563: rooms now carry a geometry on the wire, one of them is the glasshouse, and the hub polls deja and fans each scored request out as a splat on the glass. This issue tracks what the site still owes, in the order it makes sense to build.

Where the client already is

More is done than #326 assumed:

  • roomGeometry.ts already has three rooms, grid, glasshouse and sphere, each a palette, a world mapping, a GLSL block for the ray tracer's ground and walls, attractors, and a sound profile. The glasshouse already draws glass walls. Its own comment says "the hub will one day name one per room" — that day has arrived.
  • worldSync.ts dispatches on the LobbyUpdate member and silently drops members it does not know, so the hub's new events are already harmless rather than breaking.
  • The geometry today is a local choice cycled by a hotkey. Nobody else in the room sees it.

The wire, as merged

WorldState and the new GeometryChanged both carry a geometry union of plane, sphere or glasshouse, and both carry up to 32 TapeSplats, absent off a glasshouse. A live event arrives as a tape LobbyUpdate.

One TapeSplat is seq, wall (0 is -z, 1 is +x, 2 is +z, 3 is -x), u along the wall and v up it, both fractions in [0, 1), ts in epoch seconds, the context chips oldest first, the actual token, a verdict string, and each predictor's top guess, absent when it had none. No wall height rides the wire: v is a fraction of however tall the client draws the glass. The placement is the hub's, computed from seq, so every client in a room draws an event on the same square inch, and the client draws what it is handed rather than recomputing it.

Phase 1: splat the tape on the glass

The first visible thing, and the one that needs no other phase.

  • hubStream.ts learns the tape member and the splat shape.
  • worldSync.ts keeps a bounded ring of splats in GameState, seeded from worldState.tape and geometryChanged.tape, deduped by seq, and cleared when the world is left.
  • The glasshouse renders them on its walls at wall, u, v: the actual token, the predictors' guesses, and verdict colour, matching /deja (green for the top guess, amber for top-5, red for an anomaly, violet for novel).
  • Splats age out using ts, so a joiner handed a minutes-old ring sees a faded wall rather than a wall that looks live.

Open question worth settling while building it: whether a splat animates in, given a joiner receives 32 at once and should not watch a stampede.

Phase 2: the room's geometry comes from the hub

Today the hotkey is local and private; after this, a room looks the same to everyone in it.

  • worldSync.ts reads worldState.geometry and handles geometryChanged, switching the rendered room to match.
  • The hotkey becomes a setGeometry command rather than a local toggle, so cycling rooms changes them for everybody standing there.
  • The movement model and the boundary clamp follow the hub's rules per geometry. The glasshouse floor is exactly the plane's, so that case is free; the sphere is not.

Phase 3: the gap between prediction and reality

The part #1150 is actually about, and the reason the walls are worth looking at.

  • Show the actual token beside what each predictor guessed, so the gap reads at a glance.
  • Render the context chips, high up and large as the brainstorm asks.
  • Consider a sound when a request splats, which is the natural half of the soundscape item.

Phase 4: polish, unordered

Not in scope

The browser never subscribes to deja. The hub is deja's only reader, by the decision on muchq/MoonBase#1150, and the tape reaches the client purely as world state.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions