feat(social): per-game friend request to disguised robots + lobby/stats/tile cosmetics
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 54s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m25s
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 54s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m25s
Functional: the in-game add-friend handshake aimed at an auto-match opponent who is secretly a pooled robot now records the request per (game, seat) in a new robot_friend_requests table -- never against the shared robot account -- mirroring the robot_blocks pattern. The shared account stays out of friendships, the "requested" state is pinned to the seat (not leaked across the player's other games), the robot ignores it, and a background reaper drops the row 7 days after its game finishes. The outgoing-requests list carries these per-game rows so the seat control stays disabled across reloads. No withdraw UI, per owner decision. Cosmetics: - Lobby: an in-progress game tints the viewer's own score number green when leading or tied, red when trailing (reusing --ok/--danger); scores now render in seat-number order, matching the over-the-board scoreboard. - Stats: the per-variant best move is laid out on two lines -- the variant label, then the score (right-aligned in its column) and the word tiles (left-aligned) below it. - Dark theme: the played-tile background is a touch darker so a player-placed tile reads with more contrast (light theme unchanged). Docs (ARCHITECTURE, FUNCTIONAL + _ru mirror, backend README, UI_DESIGN) updated in the same change.
This commit is contained in:
@@ -256,7 +256,7 @@ describe('codec', () => {
|
||||
expect(gl.atGameLimit).toBe(true);
|
||||
});
|
||||
|
||||
it('decodes an OutgoingRequestList of account refs', () => {
|
||||
it('decodes an OutgoingRequestList of account refs plus per-game robot requests', () => {
|
||||
const b = new Builder(128);
|
||||
const id = b.createString('o-1');
|
||||
const dn = b.createString('Pat');
|
||||
@@ -264,11 +264,20 @@ describe('codec', () => {
|
||||
fb.AccountRef.addAccountId(b, id);
|
||||
fb.AccountRef.addDisplayName(b, dn);
|
||||
const ref = fb.AccountRef.endAccountRef(b);
|
||||
const vec = fb.OutgoingRequestList.createRequestsVector(b, [ref]);
|
||||
const reqVec = fb.OutgoingRequestList.createRequestsVector(b, [ref]);
|
||||
const rid = b.createString('r-1');
|
||||
const rdn = b.createString('Robbie');
|
||||
const rgid = b.createString('g-1');
|
||||
const robot = fb.RobotFriendRef.createRobotFriendRef(b, rid, rdn, rgid, 1);
|
||||
const robVec = fb.OutgoingRequestList.createRobotsVector(b, [robot]);
|
||||
fb.OutgoingRequestList.startOutgoingRequestList(b);
|
||||
fb.OutgoingRequestList.addRequests(b, vec);
|
||||
fb.OutgoingRequestList.addRequests(b, reqVec);
|
||||
fb.OutgoingRequestList.addRobots(b, robVec);
|
||||
b.finish(fb.OutgoingRequestList.endOutgoingRequestList(b));
|
||||
expect(decodeOutgoingList(b.asUint8Array())).toEqual([{ accountId: 'o-1', displayName: 'Pat' }]);
|
||||
expect(decodeOutgoingList(b.asUint8Array())).toEqual({
|
||||
requests: [{ accountId: 'o-1', displayName: 'Pat' }],
|
||||
robots: [{ id: 'r-1', displayName: 'Robbie', gameId: 'g-1', seat: 1 }],
|
||||
});
|
||||
});
|
||||
|
||||
it('encodes a TargetRequest', () => {
|
||||
|
||||
Reference in New Issue
Block a user