Repository navigation
Game Table
English · Español
The «Play» tab is a virtual kitchen table to play a deck from the library: in solitaire, with up to ten players on one computer or online. The screen only paints and sends actions: the game lives in Rust, in a session that wraps the pure engine of the table_engine crate (Game Engine), and the screen receives the view and its patches through an ordered channel. This page covers the app side: preparing the images, the session, saving and resuming, the mat, the board geometry, dragging, menus, shortcuts, dialogs, settings and performance.
Source: src/features/table/ (screen, with lists/ for game lists), src/stores/table-store.ts (the view), src-tauri/src/table/ (session.rs, setup.rs, images.rs, saved_game.rs, history.rs, replay.rs, matches.rs, playmat.rs, dice.rs, originals.rs, sample.rs) and src-tauri/src/commands/table.rs (commands).
- No rules engine. As in the engine, nothing checks mana, phases or legality. The player moves cards, taps, counts life and counters, rolls dice; the table records it and lets the player undo. Helpers (draw and untap at the start of the turn, commander tax, counters on entering, life warnings) can be turned off.
-
Solitaire, local or online. Online games (host, guests, spectators, the waiting room) are in Online Play; the screen is the same, and with several players the player chips switch which board is shown (
table-store.watching,boardOf; a rival's hand shows as backs).table_actionalso takesasPlayer: PlayerId | null(act as another player of a local session); the screen sendsasPlayer: null, because in a local game whoever is shown is whoever plays (see «Several players» below). -
The screen decides nothing. Positions on the battlefield are the engine's
Pos(0–10,000 per axis);board-layout.tsonly converts them to pixels. What a card is, whether it is seen, where it goes after an action: all from Rust.
sequenceDiagram
participant UI as Board / menus / shortcuts
participant OP as operations.ts + actions.ts
participant CMD as commands/table.rs
participant S as Session (table/session.rs)
participant M as table_engine crate
participant ST as table-store
UI->>OP: e.g. op.tap(ids)
OP->>CMD: call("table_action", { action, asPlayer: null })
CMD->>S: with_session(|s| s.action(action, as_player))
S->>M: Log::process(...)
M-->>S: Done { event, touched } or Rejection
S->>M: patch(&Game, &touched, Viewer)
S-->>ST: Channel TableMessage::Patch { patch, event }
ST->>ST: withPatch (version + 1?) else table_view
CMD->>CMD: save_if_due(state, false)
CMD-->>OP: Ok(()) or AppError Rejected { reason }
OP-->>UI: toast with the reason (errorMessage)
-
perform(action)(actions.ts) is the only sender. It resolves totrue/false; a rejection becomes a toast. The result of the action does not come back in the command's return value: it arrives through the channel. That keeps one path for every change (own actions, undo, restart and, later, other players' actions). -
operations.tsgathers what can be done to cards (tap, face down, transform, counters, move to a zone, attach, arrows, piles, library actions, undo/redo). Menus, shortcuts and drag all call it, so a behaviour is written once. Every operation acts on the selection when the card is in it (actionTargetsinactions.ts), otherwise on that card alone. - The channel is a
tauri::ipc::Channel<TableMessage>opened bytable_subscribe(connection.ts::subscribe). It delivers in order, which a patch stream needs. Messages:View { view, log, isNew }(the whole view: on subscribing, after undo and after restart, with the log that still counts),Patch { patch, event }(what changed and the event, for the log),Closedand, online,Rejection { reason }(the host did not carry out an intention of this screen; it arrives later, not as the answer totable_action). -
Session::actionsends a fullViewwhen the event is aChange::Restore(undo and restart replace the whole game) and aPatchotherwise. -
table-store.ts::withPatchonly accepts a patch whoseversionis the current one plus one; otherwise it returnsnullandconnection.tsasks for the whole view (table_view). It copies only what changed: an untouched card stays the same object, so its memoisedTableCardViewdoes not repaint. - A rejection (
table_engine::Rejection) converts toAppErrorRejectedwithparams.reason= the variant name (impl From<Rejection> for AppError).src/lib/errors.tshas a text per known reason (NotFound,NotPermitted,EmptyZone,OutOfTurn,Limit,NotAllowed, plus the session's own such asspectator,not_hostorreplay) and the genericRejectedtext for an unknown one, so a newer engine reason never shows a raw code.
TableEntry (entry.tsx) is the tab when no game is open:
- The deck picker is the Library's own: the same toolbar (search, filters, sort, grouping, grid/list and size), tag sidebar and views, with its own remembered preferences and filters (
PLAY_ORGANIZER; see Deck Library). Decks come fromuseLibrary.load(). Clicking picks a deck (no checkboxes, no multi-select); the most recently opened deck is preselected, and one that disappears from the library is replaced the same way. Double click on the picked deck starts a solo game. The deck menu offers Open (in the Deck tab), Properties, favourite, tags and language, but not rename, duplicate, export or delete. Ctrl+F focuses the search. The «History» button sits in the toolbar. - The format is deduced by
deckFormat(factory-options.ts) fromdeck_details(...).kind(commander,limited, otherwiseconstructed; «Free» can be chosen by hand), except that the format chosen by hand in the library (kindOverride) wins over everything, and otherwise a deck with a play list that has a commander is always Commander: the list says so without doubt even when the cards alone don't and the options reset tofactoryOptions(format, 1), a copy of Rust'sOptions::factory_defaultfor one player (keep both in step). The player can change life, mulligan mode (london,londonFirstFree,friendly,free), draw/untap at the start of the turn, «the first player does not draw», commander tax and counters on entering. - The player name is remembered in
localStorage(proxybuilder.mesa.nombre); the colour is the first ofPLAYER_COLORS. Variants are off. «Sparring (ghost opponent)» chooses the intensity the game starts with (remembered assparringin the table preferences ofui-store, also in Settings). - «Game list» picks which cards of the deck go to the game (see Game lists below).
- «This deck's playmat…» opens the mat dialog for the chosen deck.
- With a saved game, a «Unfinished game» card shows its decks and turn with «Resume the game» and «Discard». Starting another game first asks («Start another game?»), because the new game overwrites the saved file; that includes the «Start» of «Local game…» (
local-game.tsx, «The unfinished game will be lost.»). «Discard» asks too («Discard the game?»). - Switching to another deck of the same format keeps the options already touched (life, mulligan…); only a change of format resets them to the factory ones (
currentFormatinentry.tsx). - The options column scrolls on its own (
ScrollArea) while the start buttons stay fixed below it. A disabled «Start»/«Solo» says why in its tooltip («Choose a deck», «This deck has more cards than are played: choose a list.»), as does the local game dialog («At least 2 players are needed.», «A player is missing a deck or a name.», «A player still has to choose a list.», «Check the teams.»). - «With friends…» opens «Friends» (Friends and Messages), where friends write to each other and a host can invite them to its game. While this app is in an online game, «Online…» becomes «Back to the online game».
table_start(config: TableConfig) is a long job (state.jobs.register(), the AppState::start_job() guard) that returns the job id at once and emits table://progress (TableProgressEvent { jobId, deck, decks, doneCount, total }) and table://done (TableDoneEvent { jobId, error }). On the screen, connection.ts::withProgress uses runJob with the job-store kind "table", folds several decks into one 0–1000 scale, and subscribes when it ends. Inside, open calls prepare_deck for each player, which opens the deck (store::decks::open), checks its list (playable_list, below), prepares it (table_deck with that list) and adds its mat; then open builds Session::create, saves it once and stores it in AppState::table.
A deck can hold more cards than are played: design variants of the same card, alternatives to try other synergies. A game list chooses which copies go to the game; in Commander, the commander (one concrete copy, so the design variant one wants) and 99 more. The deck itself never changes.
-
Data (
table_engine::list, pure, see Game Engine):GameList { id, name, commanders, cards }holds ids of the deck's copies (DeckCard.id).check(cards, list, format)returnsListWarningwarnings; only the size, a missing commander, more than two commanders and extra copies stop the game from starting (ListWarning::prevents). Colour identity, a card that cannot be a commander, a pair without partner or background and copies no longer in the deck only warn: the data can be missing (an unlinked custom card) and at home people play as they like. -
Storage (
store/game_lists.rs, tabledeck_game_lists, migration 0005;deck_listasbefore migration 0013): apart from the deck, like tags, so the deck's autosave (which rewrites the deck) never overwrites them and they do not change itsupdated_at; deleted with the deck byON DELETE CASCADE. Names are trimmed, single-spaced and capped at 60 characters; an empty one isInvalidInput/unnamed_list. They travel in the.pbdeck(Deck Package Format). -
Card data (
table/setup.rs::list_cards): the eligible copies (list_candidates: all but blank slots, tokens, planes and schemes, marked or not) with name, type, colour identity, whether they can be a commander or go in a pair (commander_by_text), whether any number is allowed (basic lands andunlimited_by_text), the front blob for the thumbnail and the mark. From Scryfall (cache or network, as for the game) or, failing that, from the card's design. -
Starting (
commands/table.rs::playable_list): with no list, the whole deck is played unless more cards count than the format allows (DeckRules::requires_list; only Commander has a maximum), and thenInvalidInputwithreason: missing_list; a list that does not exist or has a blocking warning isreason: list. With a list,table_sections(deck, Some(list))takes only the chosen copies plus tokens, planes, schemes and the copies marked sideboard.table_resumere-reads the list only to know which images to prepare again (a list deleted since is ignored). -
Commands:
table_lists(deck)→DeckGameLists { lists, counted }(counted: cards that count without a list),table_list_cards,table_list_check,table_list_save,table_list_delete;TablePlayer.list(optional id) inTableConfig. -
Entrance (
entry.tsx): «Game list» lists «Whole deck ({n})» (not offered when the deck needs a list) and the saved lists; the first saved list comes selected. «New list…» and «Edit…» open the editor (they open «New game list» / «Edit game list»). In Commander with more than 100 counted cards and no list, a warning explains it and «Solo» is disabled. -
Editor (
lists/game-list-dialog.tsx): commander candidates on the left, the deck's copies on the right (filter by name or type, «Chosen only»). Every copy is a cell of the same width (auto-fillgrid, the card with its name under it), so variants and duplicates line up in rows instead of making ragged groups; the basics (no limit) are one cell with its n/total counter, an n/100 counter in Commander. Rust checks the list 250 ms after each change and the warnings are listed below in words; a list can be saved incomplete, but blocking warnings keep the game from starting. A new list starts with the unmarked copies (defaultChoice). On a phone the cards come first: «Commander» and «Cards» are tabs at full height, with larger thumbnails; name, search, «Chosen only» and a "..." with «As in the deck» and «None» stay in compact rows (on its side, in a column on the left), the warnings go to a sheet and the footer is one row. -
Choosing without rules (
lists/choice.ts, tested): in singleton, choosing a design variant removes the other copies of the same card; choosing a commander takes it (and its variants) out of the other cards, and with two already the new one replaces the second; basic lands are chosen by number (withCopies).blocksStartmirrorsListWarning::prevents. The rules themselves are Rust's. - The reasons
missing_list,listandunnamed_listhave their texts insrc/lib/errors.ts(REASONS.InvalidInput).
setup.rs::table_deck turns a library Deck into the engine's TableDeck:
-
table_engine::setup::table_sections(deck, list)decides where each card starts (deck, commander, sideboard, tokens…; with a list, only what it chose; see Game Engine). -
data_forcollects the Scryfall cards of the deck from the cache; ids not cached, or cached withoutkeywords, are asked through/cards/collectionin batches of 75. A network failure is logged and the game is played with what there is. - Each face gets a
ImageRef, tried in this order:- a designed card: painted by the designer engine (
design::paint) atTABLE_WIDTHwithRenderTarget::Print, keyedd-<design fingerprint>; - an untouched Scryfall print (
CardSource::Scryfall, no design, identity edits,ScryfallPng/ScryfallLargeorigin, ahttps://cards.scryfall.io/URL):ImageRef::Scryfall { id, face, url }plus a local copy; - anything else:
render_rgbaof the blob with the deck's print settings (edge darkening, card size, corners) and no bleed, keyedr-<RenderSpec::key()>. Edits apply to the front only, as on the sheet. The back is the DFC back face, a custom back (blob) or the deck back (default_back; without one, the app's generic back fromBlobs::generic_back, the same one the sheets print, prepared like any other image).ImageRef::Generic, a back drawn by the screen (GenericCardBack), is only the fallback if that image cannot be read.
- a designed card: painted by the designer engine (
-
info_offills the engine'sCardInfofrom the Scryfall card: type, cmc in tenths, cost, colours, land/creature/legendary (from the front face of the type line), power, toughness, loyalty, keywords, the functions ofproxy_core::stats::rolesandflat_bonus. Without Scryfall data a designed card uses its ownCardData(design_info, English type and rules); otherwise only the type line ofCardMeta. - Cards are prepared in parallel (
rayon) andprogress(done, total)is called per card.
flat_bonus is a regular expression for «equipped/enchanted creature gets +N/+N» that refuses the match when the same sentence says «for each». It is only an offer (see «Attaching» below): many auras condition their bonus, and the player decides.
Why the final image: the table shows exactly what would be printed (crop, edges, the designed frame), and the session never touches the blob store. Why Scryfall prints are kept apart: in online games the other players can download them from cards.scryfall.io instead of receiving the bytes; a Custom image is named by the SHA-256 of its JPEG bytes for the same reason.
| What | Path (under app_cache_dir) |
|---|---|
Prepared face (Custom { sha256 }), JPEG 85 at 745 px |
mesa/<2 hex>/<sha256>.jpg |
Scryfall print (Scryfall { id, face }) |
mesa/s/<id>-<face>.jpg |
Index key → ImageRef
|
mesa/i/<key>.json |
| Reduced copies served to the screen | renders/m/<sha256 or s-id-face>-<width>.jpg |
The index is what makes the second game with the same deck paint nothing: a face whose key is already indexed and whose JPEG exists is reused (from_index). PAINTED counts real paints for the test three_cards_three_images_then_nothing. Everything is cache: if it is deleted, the next start (or resume) prepares it again.
The screen asks for them through pbimg:// (src/lib/image-url.ts::tableUrl): /m/<sha256>/<width> and /m/s/<scryfall id>/<face>/<width>, widths in protocol.rs::TABLE_WIDTHS (146, 244, 488, 672, 745, 1000, 1920). A width of 745 or more serves the stored file; smaller widths are reduced once and cached under renders/m/. protocol.rs::parse_route only accepts a 64-hex SHA-256, a 36-character hex-and-dash Scryfall id and face 0 or 1 (table_routes_parse), so a path cannot escape the folders. ImageRef::Generic has no URL: card-image.tsx paints GenericCardBack.
Widths used: battlefield cards at the «quality» setting (146/244/488), raised to 244 above 120 px and to 488 above 200 px on screen; hand and zones 244; large view 488; mat 1920. The board widths 146, 244 and 488 (images::PREPARED_WIDTHS) are made while the deck is prepared (shrink_in_advance, for every face and the back; a failure stops nothing, the screen asks for it later), so opening the table never shows cards appearing one by one while the reductions are computed. A battlefield card and its dragged copy use the same width (table-card.tsx::cardImageWidth): another width is another URL, another load and a flicker on drop.
Session holds the TableConfig, the prepared decks (decks, to restart with the same list), the engine Log (with UndoMode::Unlimited; OwnLast online), its own Rng, the channel, me (who looks at this screen: PlayerId(0) on start, changed by switch_me in a local game and set to the guest's seat online), unsaved, saved_ms, net (the online role, None in solitaire or local), current_match (the best-of score) and replay (while a replay is watched). It lives in AppState::table: Mutex<Option<Session>>.
- Seeds come from the system entropy (
getrandom; the clock if that fails): one for dealing the game, another for the session'sRng. -
Action::Restart(«Another game») is done by the session: a newGamewith the same config and decks and a fresh seed, thenLog::replace. -
AppState::is_busy()is true while a game is open (has_game()), even if the user is on another tab. Then blob garbage collection andupdate_installreturnBusy: an update restarts the app in the middle of a game (testapp_is_busy_with_a_game).update_installchecks the game first and addsreason: game_open, shown as «A game is open: finish it or leave the table to update.» (errors.ts::REASONS.Busy). Rust is the safety net: with the table open the screen does not ask, it queues the install (useUpdate.onLeaveTable) and runs it when the player leaves the table (Releases and Auto-Updates). -
table_card_info(card)(«Inspect») first checks withtable_engine::visibility::seesthat the viewer may see the card (Rejected/NotPermittedotherwise), then returnsCardRulesfrom the Scryfall cache (oneFaceRulesper face) or, without it, from the card'sCardInfo(no rules text). - After every event of the player, the sparring (see «Sparring on screen» below).
- Online, acting as another seat is refused (
reason: as_other), and a spectator'stable_actionis refused withreason: spectator. -
table_scryfall_origin(scryfallId)builds anCardOriginfor a token or a real card that is not in the deck: the card from the cache or the network, its images downloaded tomesa/s/, andinfo_of.
The game in progress is one file: app_data_dir/games/current.json.gz, a gzip (flate2 with zlib-rs) of SavedGame { catalogVersion, config, decks, initial, events, savedMs, currentMatch }, written atomically (store::blobs::write_atomic). It is the engine log, not a snapshot: resuming replays it with Log::rebuild, so the undo history survives and the fingerprint is the same (save_and_resume_keeps_fingerprint).
When it is written:
- at the start of every game;
- after an action, when 50 events are unsaved (
EVERY) or when something is unsaved and 20 s passed since the last save (EVERY_MS). The 20 s check runs when an action arrives (there is no timer), so idle time adds nothing to lose; - forced (
table_save) when the tab unmounts, before «Edit this deck», and when the window closes (confirm-close.tsxcallsconnection.ts::saveboth when checking and when closing); - forced when the next game of a match opens (
table_next_game); -
table_leave(true)(«Save it for later»).
Only a session that has the whole game is written (Session::savable): a guest's game is the host's to keep, and nothing is written while a replay is open.
A failed save is logged and never blocks play. table_leave(false) («End it», «Discard», «Exit» after the end) closes the session and deletes the file, except when leaving a replay opened from the history, which never touches the saved game. Online, leaving the table also leaves the game and its room.
table_state returns TableState { open, deckIds, savedGame } (open is also true while watching as a spectator); savedGame (SavedGameSummary: deck names, deck ids, turn, round, save time) only when no game is open. An unreadable file is logged and ignored, so it never prevents starting another game. A file written by a newer catalogue (catalogVersion > CATALOG_VERSION) is refused with Unsupported (reason: version). Files written by 4.1, with Spanish names, are still read through serde aliases. 4.1 kept the file in partidas/actual.json.gz (and the history images in partidas/imagenes/): at start-up src-tauri/src/data_folders.rs renames them to games/current.json.gz and games/images/, and keeps using the old name if the move fails.
table_resume is a job too: if any image of the saved decks is missing from the cache (missing_images), it prepares those decks again (same keys, same images; decks deleted since are skipped), then rebuilds the session.
Lifetime of a game on the screen:
- Switching tab keeps the session open in Rust.
TableScreencallstable_stateon mount and, if a game is open and the screen is not subscribed, subscribes again; the new channel starts with a full view. - «Leave the table» asks: «End it» or «Save it for later».
Session::closesendsClosedand the store empties. - Restarting the app opens no game: the saved one is offered at the entrance.
- Closing the window with a game open asks (reason «There's a game on the table: it will be saved and you can resume it when you come back.»,
PendingWork.gameinsrc/lib/close-guard.ts), and saves it either way.
A background image per deck, or a general one for decks without their own. Sources (PlaymatSource): a file (imported to the blob store), the art_crop of a Scryfall card (downloaded into the blob store as ImageOrigin::Upload) or a blob already stored. Playmat { blob, veil (0–90 %), blur (0–20 px) } is stored as JSON in app_settings (table.playmat.<deck id> or table.playmat) and its blob is protected from garbage collection in blob_refs with owner_kind = 'table' and owner_id = the deck id or general. Why not owner_kind = 'deck': store/decks.rs rewrites a deck's deck references on every save and would drop it. Deleting a deck deletes its mat references and setting (store::decks::delete).
At the start of a game, playmat::of_deck picks the deck's mat or the general one and for_table reduces it to 1920 px wide as a prepared image (Custom, index key t-<blob>), which travels in TableDeck.playmat and reaches the screen as PlayerView.playmat. The dialog previews veil and blur. On the board, board.tsx::PlaymatLayer (given the deck id) reads the stored mat itself with table_playmat_get (the deck's, or else the general one), draws its blob through artUrl(blob, 2000) and applies its veil (opacity of the black layer) and blur (filter: blur). It reads it again whenever useScreen.playmatChanged goes up: playmat-dialog.tsx calls notifyPlaymat() after setting, removing or adjusting a mat, so a change made during a game shows at once. It keeps the last mat read for each deck (mirrored in the module-level LOADED_PLAYMATS so it survives the board being unmounted and mounted again during the app session), so going back to a board shows its own mat at once instead of the previous board's until the read finishes; a deck never read yet shows no image (not the wrong one). A new mat fades in over the previous one once loaded; one already painted in this session (PAINTED_PLAYMATS) shows without fading. Only without a stored mat does it fall back to the image in the view (PlayerView.playmat) under a 35 % veil. Why both: the view's mat is the one fixed at the start of the game, which is what other players would see; the stored one is the player's current choice with its screen settings. Which deck's mat a board reads is privacy.ts::boardDeck: the deck of its seat if it is known. Online only your own is known (Rust leaves the others' deckIds empty), for the host and for each guest alike; before, only the host's own board read it. The mat dialog of a game (table-screen.tsx) edits the deck of your own seat.
Changing the mat during a game, for everyone. The view's mat is part of the Game (Player.playmat), so changing it mid-game is an engine action, Action::ChangePlaymat { playmat } (catalogue v8, see Game Engine): it reaches every player as a normal event and the log says «{who} changes their playmat» (category other). The in-game PlaymatDialog is rendered with inGame (dialogs/index.tsx), so setting or removing a mat also calls table_playmat_in_game(deck): if a game is open, Rust computes the deck's mat again (its own or the general one, playmat::of_deck), prepares it (playmat::for_table) and, only if it differs from my current one in the game (Session::my_playmat), sends ChangePlaymat (a guest sends it to the host like any other action). The image travels like any own image over /img/1: net/images::in_game looks at Player.playmat, so the host fetches it from its owner on demand (Online Play). The session also writes the new mat into its decks[i].playmat, so «Another game» and the next game of a match keep it. Veil and blur stay per screen and do not travel: the others see it under the default veil. It is not part of the game: undo does not take it back (see Game Engine).
flowchart TB
subgraph Board["Board (one player)"]
F["Battlefield: free positions 0–10,000"]
subgraph Strip["Bottom strip: 22 % of height, 90–220 px"]
H["Hand in a fan"]
Z["Command · (Sideboard) · Library · Graveyard · Exile"]
end
end
T["Mat + veil"] -.-> Board
B["Bar (top centre)"] -.-> Board
L["Life, turn helpers (bottom right)"] -.-> Board
P["Stack (left), phantom (top right)"] -.-> Board
-
layoutBoard(w, h, size, hasSideboard)splits the board: the bottom strip is 22 % of the height clamped to 90–220 px; small cards (hand, zones) are the strip minus 26 px high; the zones sit on the right, the hand takes the rest; the sideboard slot only appears when it has cards. A battlefield card ismin(24 % of the field height, 240 px)× the size setting (25–200 %). -
posToPx/pxToPosconvert between the engine's 0–10,000 and pixels of the field, clamped. Because positions are relative, a game looks the same after resizing the window. -
fanlays the hand out in a fan: overlapping when it does not fit, up to 8° of rotation. - The stack is a column on the left (top card first); arrows (
arrows.tsx) are an SVG overlay coloured by player (solid for attack, dashed for target). Each end is placed byArrows: a card on the big board, at the card; me (table.me; in a replay seen as «Everything visible» there is nome, so it is the owner of the board being watched,arrows.tsx::controlsOwner), at the top edge of my life counter (measured in the DOM through itsdata-life-ofattribute, because it grows with counters and the pass-turn button) when it is on screen; the owner of the big board when it is someone else's, at the top edge of their life counter (BoardControlsshows theirs instead of mine on their board), or at the top centre if it is not there; me while I look at someone else's board, at the edge that faces my mini board; anything on another board (a card controlled by someone else or another player), at the edge of the big board that faces that player's mini board (arrow-logic.ts::entryFrom, with the mini boards' centres given byboards.tsxthrough theSurroundingBoardscontext; with a single board, the top centre). An arrow with neither end on the big board, or of almost zero length, is not drawn there (it is counted on the mini boards); before, an arrow from a rival's card to me had both ends at the top centre and showed as a stray arrowhead, with the arrowhead of the same colour (one<marker>per colour,arrowheadId:context-strokeis not understood by every WebKit and the head came out black) and, with several players, a label near the head with who it goes to, painted in that player's colour (arrow-logic.ts::endpointOwner: the player pointed at or the controller of the target card); the mini board of a player shows how many attacks point at them (attackersOf); coloured «bolitas» are drawn on the field and removed with a double click. - The phantom (
general.ghost,ghost-life.tsx::GhostLifePanel, top right) is the imagined opponent's life of solitaire, treated like one more player: −/+ or the wheel (clicks within 700 ms merged into one event, as for players), and a context menu with damage, gain life, poison ± (GhostPoison) and commander damage per commander on the table. With an arrow being chosen, clicking it makes the phantom the target (targeting.ts::chooseGhost, an arrow toEndpoint::Ghost; arrows to it end at its widget, found throughGHOST_ATTRIBUTE). It gets a red ring when it would be out (life 0, the poison limit or a commander's damage limit); the person still decides who wins. Before catalogue v4 the screen had no way to target it and an arrow to the phantom became an arrow to player 0, that is, to oneself. -
More phantoms (
general.extraGhosts) simulate a multiplayer table in solitaire: «Ghost opponents» at the entrance (remembered asui-store.table.ghostOpponents) starts with up to 9, and the marker's menu has «Add another ghost» and, on all but the first, «Remove this ghost». Each has its own life, poison and commander damage and can be an arrow target (data-ghost-lifecarries its place, andarrows.tsxmeasures one point per marker). They are only counters: sparring does not read them, so there are no more reactions than with one. Markers stack down the top right and continue in another column to the left when they would reach your own life. On a phone with several, each marker is a small chip (number and life): full ones would cover the battlefield; tapping it opens the life screen and holding it, its menu.
Engine changes made for this screen (apply.rs): a card entering the battlefield without a position takes the first free slot of its row (11 slots 900 apart starting at x = 600, so a card about 8 % wide on a wide screen is never cut at the edge), and drawn cards go to the end of the hand.
TableCardView is memoised and reads only its own card from the store. It is positioned by its centre with a transform (rotated 90° when tapped, plus the fan angle in the hand). Badges: labels, counters, keyword counters, power/toughness (amber when changed), pile size (×N), and the text of an ability on the stack. Top left, stacked, go a rose «Stolen»/«Lent» chip when the controller is not the owner and a violet «Copy» chip (copy icon) on a token that copies another card (isToken with copyOf, from «Create token copy»). They are not at the bottom because on a small card they would hide the power/toughness and the rules text. On a small card (96 px wide or less, measured with a container query on a layer the size of the card, so it holds on any board and at any zoom) these chips, and the top-right borrowed-control chip with the player's name, keep only their symbol; the name stays in aria-label. Both corners live on that layer and share its width (cqw, 50 % left and 45 % right, with long names truncated), so the two sides never touch, and stolen and copy stack without overlapping. On a tapped card the badges are drawn in a box rotated back by −90°, so they stay upright and readable. A face-down card the viewer knows shows an eye icon; phased-out cards are faded; top right, below the borrowed-control chip, small round markers show what lasts on the card: «Doesn't untap» (padlock), «Phase out» (portal) and its pinned notes (an amber badge with the count when more than one; its tooltip lists every note with a dot in its author's colour), each with a tooltip; highlighted cards glow in one of 16 colours (colors.ts).
pt.ts::ptOf computes the shown power/toughness: the printed values (non-numeric such as * count as 0) plus the power/toughness counters (counterBonus: every +X/+Y or -X/-Y type, such as +1/+1, +2/+2 or -0/-1, times its amount; other types add nothing) plus the «other» and «until end of turn» rows; a fixed value overrides everything.
The «Add counter» dialog (CounterDialog in dialogs/small-dialogs.tsx) offers a catalogue in four sections (plus the player's favourites and own types, below), and its text field is both the counter type and the filter over the catalogue (any other text is accepted as a type of its own; the engine stores the type as free text): «Common» (CARD_COUNTERS, the ten common ones), «Mana» (MANA_COUNTERS: one per colour and colourless, to count the mana a creature has produced), power/toughness (PT_COUNTERS, the +X/+Y and -X/-Y counters that exist on real cards) and other counters (OTHER_COUNTERS, about 200 types taken from the Oracle text of real cards in Scryfall; player counters such as poison, energy, experience or rad are left out). The type is what the game stores (the English rules name, so two players with different languages talk about the same counter); the name shown is translated: colors.ts has the official Spanish name as the source string and every language translates it with the one printed on its cards (counterName in counters.ts). Those names were taken from the printed text of real cards in Scryfall's bulk data in the nine languages with printed cards; where a type was never printed in a language the English name is used, and the same goes for ro, pl, nl and uk, which have no printed cards. A «Temporary» switch turns what is added into a temporary counter (the type gets a ~ prefix, counters.ts: withTemporary, isTemporary); the engine removes those when the turn passes (see «Game Engine»). It also applies to keyword counters (KEYWORDS, a «Until end of turn» submenu next to the permanent ones in the card menu: «gains lifelink this turn»). Power/toughness counters count even when temporary (counterBonus). On the card badge a temporary counter carries a clock and an amber ring, mana counters are a coloured dot with their amount, power/toughness types show whole and the others are shortened to five letters.
Above the catalogue go two lists of the player's own, kept on this device in the table preferences (TablePreferences.customCounters and favoriteCounters, under the proxybuilder.preferencias key of localStorage; they do not travel with the game nor to other devices). «Your counters»: every type typed by hand that is not in the card counter catalogue is remembered when it is added, temporary or not, the most recent first and up to MAX_CUSTOM (40) (rememberCustom; it is stored without the ~ prefix, since temporary is a separate switch, and without repeats ignoring case). «Favourites»: the star next to the text field marks or unmarks the selected type, from the catalogue or one's own (toggleFavorite); favourites come first. The bin button, shown only for one's own types, forgets it from both lists. What is typed is first matched against the catalogue (typedKind: the type or its translated name, ignoring case), so typing the translated name (in Spanish, «escudo») adds the shield counter, which every language shows translated, and not a separate own counter with the same look; keyword counters are not part of that match. The pure logic is tested in __tests__/counters.test.ts.
«Edit counters…» in the card menu opens EditCountersDialog: the counters and keyword counters of the card in two groups (permanent and temporary), each with − / + buttons, a number field (setCounter), a clock button to turn it temporary or permanent (the new one is added first and then the old one removed, so nothing is lost if one fails) and a trash button. «Add temporary counter…» opens the add dialog with the switch on.
LargeView (large-view.tsx, hidden while dragging) shows the hovered card large on the right (on the left when the pointer was in the right half of the screen as it started pointing at that card, so it never covers it; the side is decided once per card from the last pointer position; width from Settings, both faces for a double-faced card) with a status panel: ability text, counters, power/toughness and where each bonus comes from, keywords, labels and «controlled by X; owned by Y».
The table uses its own pointer events instead of a drag-and-drop library: the battlefield is free positioning with animation between zones, not ordered lists.
- A drag starts after 5 px (
thresholdForingestures.ts). While dragging,useScreen.draggingdrivesDraggedCards, a copy that follows the pointer without waiting for Rust; the originals fade. - What is attached to a dragged card (equipment, auras, stacked cards:
attachedToandgroupedUnder) travels with it in real time. The geometry of the field is one function,field-spots.ts::battlefieldSpots, used byBattlefieldLayerand byDraggedCards; at the start of the dragfollowerslists what goes along and it is stored inDrag.others.DraggedCardsdraws those cards behind, with their own offsets plus the pointer displacement; the real ones are hidden (and land without sliding, aslands) until the main card arrives. What other players see of the drag (their live ghost,useLive) still carries only the dragged cards. - On release,
dropDestinationpicks the destination: the library on top (the bottom only with Shift held on release: dropping a card drawn by mistake on the lower half used to hide it at the bottom), graveyard/exile/command/sideboard on top, hand at the end, battlefield at that position. Cards dragged on the battlefield keep their distances:board.tsx::dropcomputes each card's new position (its old one plus the pointer displacement) and sends oneMovefor a single card or onePlace(actions.ts::place) for several, so they land together and one undo returns them all. While a card is dragged its old place is not drawn (neither the faded copy it used to leave,opacity-0now), and after the drop the card stays where it was dropped: the move goes to Rust and comes back, so for that moment the drag keeps being painted at the drop point (Drag.dropped,DraggedCards) while the real card, hidden at its old place (useLive.drop, at most 5 s,DROP_MS: online, with a slow host, the event can take a while, and with less the card came back to its old place for a moment and then jumped; a refusal clears it at once withforgetDropped, fromactions.tsand from aRejectioninconnection.ts), takes over in the same frame it arrives at its new one. A card that has just landed has no CSS transition on its position (TableCardView,lands) and is not animated by FLIP either (flip.ts::markDragged), so it never slides from its old place. Turning (tapping) is a separate element inside it with its ownrotatetransition, so it always animates, even right after a drop. The drag is also sent live to the others in an online game, group included (see Online Play). Dropping on the zone the cards came from does nothing (except the library and the battlefield). -
flip.tsanimates a card from its last on-screen position to the new one (FLIP), also for moves done by the engine (draw, mill, organise); a position older than 5 s does not count. - Click selects; Ctrl/Cmd/Shift-click toggles; dragging on the empty battlefield draws a selection box (cards whose centre is inside; with a modifier it adds); Ctrl+A selects the battlefield, Esc clears.
- «Attach to…» and «Attack / target» enter a target mode (
useScreen.mode): the next click on a card (or on the phantom, for arrows) completes it; Esc or a click on the empty field cancels. In a local game the other board is drawn read-only (EnlargedCard) or as a thumbnail, and while an arrow is being chosen clicking it does not switch boards: a card of that board is the target (targeting.ts::chooseCard, shared with the main board) and anywhere else on it targets the player (choosePlayer, an arrow toEndpoint::Player). Without thumbnails, the list of players plays that role:BoardSelector(net/net-status.tsx) in the «A single board» layout and the seat bar on a phone (see «Seat bar»). Clicking a player targets them, and the eye next to them (See {name}'s board) shows their board without ending the mode, so one of their cards can be the target. Each player also shows how many attacks point at them. Attaching only accepts cards. An arrow towards another player's board is drawn to the top centre of the board you are looking at. With several cards selected, «Attack / target» in the card menu is a submenu: «Only this one» (the clicked card) or «Together (all selected)», which keeps the rest of the selection inmode.othersand, once the target is chosen, puts one arrow from each card to that same target (targeting.ts::addArrows; the engine only knows single arrows, so they are sent one after another and stop at the first rejection; a selected card that is itself the target is skipped). To remove just one arrow, «My arrows…» in the empty-field menu (menus/zone-menus.tsx) opensdialogs/my-arrows.tsx: one row per arrow of mine («Dodomeki → Ghost 1», attack or target) with a bin button (removeArrow) and «Remove all» below. Pointing at a row (mouse over, focus or a tap) setsuseScreen.highlightedArrowto its index ingeneral.arrows;arrows.tsxdraws that one thicker and fades the rest. A third mode,{ kind: "note", note }, pins a note: the next click on a battlefield card pins it (attachNote); a card elsewhere gives the warning «Notes can only be pinned to battlefield cards.». - Double click: on the battlefield taps, in the hand plays the card. A click on the library draws; with the pointer over it, keys 1–9 draw that many.
- With «Long press opens the card menu», holding the left button 500 ms dispatches a
contextmenuevent and swallows the followingpointerupandclick, so releasing does not pick the item under the pointer.
Off by default (TablePreferences.effect3d, the «3D effect: dragged cards lift off and your hand has depth» switch of Settings › «Game table», in the board group). Screen only: Rust and the engine know nothing about it.
-
The dragged card lifts off the mat and tilts with the drag speed, like a card being held: the leading edge goes down and the trailing one up (
tiltFor(vx, vy, preset), capped at the preset'stilt), it grows by the preset'sscaleand its shadow gets longer, softer and moves away from the tilt (LIFTED_STYLE, light from above). On release it settles back.useTiltruns a small spring per animation frame (approach) and writes--rx,--ryand--liftstraight onto the drag layer ofDraggedCards;Liftedwraps each dragged card with the style that reads them. Why CSS variables and not state: the drag already re-renders on every pointer move, and the spring must not add one render per frame. While the effect is on, the dragged copy is fully opaque and drops the usualopacity-90 shadow-2xl: the lift is told by the shadow, and a see-through card looked like a ghost rather than a card in the hand. It is off when «Reduce animations» or the system's reduced motion is (useNoAnimations). -
The hand has depth. Hand cards on the board are tilted back on their bottom edge (
HAND_3Dintable-card.tsx: perspective androtateXread from the CSS variables--hand-persp,--hand-tiltand--hand-shadowthathandVars(preset)puts on each card, origin at the bottom) with a shadow cast on the mat; pointing at one straightens it and raises it towards the viewer (translateZ, scale 1.12) instead of the flat lift.TableCardViewtakes it with thedepthprop, whichHandLayerpasses. The face-down hand cards of other players get the same tilt. The full-screen hand layer of the phone is not affected. -
How strong (
TablePreferences.intensity3d, «3D effect depth», shown only with the effect on;mediumby default): four presets inPRESETS_3D—soft,medium,strong,extreme— each with a shorter perspective distance, a bigger maximum tilt and tilt per speed, more lift, longer shadows (shadowmultiplies them) and a hand leaning further back.mediumkeeps the original values. Presets instead of a free slider: every value moves together and each step stays coherent (a short perspective with a tiny tilt or a huge shadow with no lift looks broken). The drag layer receives the preset as--p3d-persp,--p3d-scaleand--p3d-shadow.__tests__/depth.test.tschecks every step is stronger than the previous one. - «Performance mode (everything at minimum)» turns it off (
PERFORMANCE_MODE.effect3d), andFpsWatchercounts it when deciding whether everything is already at the minimum.
The same screen and the same engine play from 1 to 10 players. Online they are other computers (Online Play); on one computer it is a local game. What the screen adds for several boards is geometry, thumbnails and a few dialogs; who is the opponent of whom, the team life, the turn order and who is out are decided by the engine (Game Engine).
«Local game…» on the entrance opens LocalGameDialog: from 2 to 10 seats, and for each one a name, a colour and a deck of the library (with its game list if it needs one); the format and the options are those of a normal game. local-config.ts only builds the TableConfig (buildConfig) from what the dialog fills in: seats, format, how teams are played (LocalTeamMode: none, teams, twoHeaded, archenemy), seat order (first) and «best of». teamsProblem says why a team split cannot start (with teams, no team has two players, noTeammates; Two-Headed Giant needs an even number of four or more seats, twoHeadedPairs); the rest is Rust's (setup::initialize validates that every team exists).
In a local game whoever is shown is whoever plays: Session::switch_me(player) (command table_view_as) changes me and sends the whole view again, so the player now shown sees their own hand and acts with their own permissions, without touching asPlayer. It is refused with Rejected { reason: "online" } in a networked session, and Session::action refuses an as_player other than me there (reason: "as_other"). The player chips (BoardSelector) call viewPlayer (viewing.ts), which chooses between table_view_as (local game of several: isLocalMultiplayer()) and the plain look of table-store (online: only which board is shown, a rival's hand stays as backs). «Follow the player whose turn it is» makes useFollowTurn move the view to the active player whenever the turn changes (table_view_as(active) in a local game of several, the plain look online), with two or more seats. It is one setting per format, because the phone shows a single board: followTurnLocal on the phone (labelled «Follow the active player», on by default) and followTurnDesktop on desktop and tablet (off by default). useFollowSetting returns the one that applies to the current screen; the desktop bar's crosshair button, the phone's seat bar and Settings > Table all toggle it. A spectator in the «focus» layout always has the active player's board as the large one.
distribute(n, rect, config, large, teams) returns one non-overlapping rectangle inside rect per board (the viewer's first); layoutBoard still splits the zones inside one board. Modes (BoardLayoutMode, offered by modesFor(n, withTeams)):
| Mode | What it does |
|---|---|
single |
One board, the usual one; the others are reached through the chips. |
split |
Only with 2: side by side or one above the other, with a draggable divider (ratio 0.2–0.8, 0.7 by default). |
focus |
One large board and the others as thumbnails in a strip (strip: top, right or bottom); clicking a thumbnail makes it the large one. |
grid |
All equal, rows and columns chosen from the aspect ratio and n. |
teams |
Only with three or more players and teams: a grid with teammates together. |


BoardLayoutConfig is remembered per number of players (ui-store.table.boardLayouts[n]; a spectator's under -n, boardLayoutKey, so it does not overwrite the player's); with one player there is no selector. Without a remembered one, defaultBoardLayout gives split with two players, focus with more, and grid for a spectator. Boards (boards.tsx) paints the viewer's board as the interactive one and the others as MiniBoard. boardOrder puts the viewer first online; in a local game it keeps the seat order, so the boards do not jump when switching player. The tests (board-layout.test.ts) check for n = 1…10 in every mode that no rectangle leaves the container or overlaps another, that in «focus» the viewer's is the largest and that each has at least 40 × 28 px.
A thumbnail shows the player's colour and team ring, name, life, their markers (PlayerMarks in its small size, see below), the number of cards in hand and library, and the battlefield with cards at 146 px (ThumbnailWidth), with the same animations as the big board: a card turns with a transition and slides to its new place (FLIP at the thumbnail's scale, also in the reading scale EnlargedCard), and during a replay the slide lasts as long as the step, see «Replay». useSlowTable samples the store at most every 100 ms (MINIATURE_MS) and only repaints when the chosen data really changed (sameMiniData), so nine small boards do not slow down the large one. Below MIN_HEIGHT_WITH_BATTLEFIELD (64 px) a thumbnail only draws the numbers, and the hand and library counts only show from 120 px wide. Hovering a card shows the large view. A click switches to that player (viewPlayer; online, Alt+click puts a signal ring on them instead), and its context menu has damage, gain life and poison for that player (LifeOptions, not for a spectator or in a replay) and «Original cards in my language». The other players' pointers over this board are drawn on it as on the big board, a dot with their name (MiniLiveGhosts); before it was an 8 px dot with no name that could not be seen.

The hand is always visible in a thumbnail, as in the large board when you look at another player: a strip along the bottom edge (MiniHand, up to MAX_MINI_HAND = 20) in the same subtle fan as the large hand (fan, with the arc and the turn scaled down to the card size), drawn with the back of that player's deck (the chosen one or the generic one) even for double-faced cards, so nobody can tell what is in it. Only the cards the engine says this viewer may see (a teammate's hand, see «Teams») are drawn face up (MiniData.handView). The thumbnail's own layers (isolate) stay below dialogs and side panels, and below the opening-hand screen.
The other zones are always visible too, as on your own board (MiniZones): the command zone (if it has cards), the library with that deck's back, and the graveyard and exile with their top card (the last in the list) face up when the viewer may see it, each with how many cards it holds. In a thumbnail at least ZONES_ROW = 400 px wide they go in a row at the bottom right with their names; in a narrower one, in a column on the right. Hovering the top card shows the large view.
Teammates see each other's hand without asking (visibility::sees_a_teammates_hand): the option «Teammates see each other's hand» of the local game (LocalSettings.teammateHand, on by default) writes Variants.private_hands_in_team (inverted: on means hands stay private). It applies to teams, Two-Headed Giant and the archenemy's opponents. Rivals and spectators only ever see backs.
Teams are the engine's: TeamMode::Teams { friendly_fire } and TwoHeadedGiant (30 shared life per pair). With friendly fire off, Drain, Extort and LifeToAll go through Game::opponents, which leaves teammates out; with shared life (Team.shared_life) damage to one lowers the team's life and both players read the same number. The screen only warns when an arrow or a target points at a teammate (attacksTeammate), paints the team's colour around the player and groups teammates in the «Teams» layout. A team wins together (Outcome.winners). Archenemy is the same machinery: the archenemy (archenemySeat, 40 life) against everyone else as one team without friendly fire.
-
Commander damage (
dialogs/commander-damage.tsx,commander-damage.ts): a table with a row per player and a column per commander on the table, and under each commander its casts and its tax (taxOf). It is only a record (the cells of a commander with its own owner are disabled: it cannot deal commander damage to them; only what was already recorded can be removed):Action::CommanderDamagelowers life point by point andCastCountcounts the casts. Removing more than is recorded leaves the count at 0 and gives back only the life that was actually taken (the engine moves life by what the counter really changed, for the player and for the sparring ghost);safeDeltakeeps the screen from asking for it anyway. The warning at 21 is the helperwarnZeroLife. -
Planechase (
active-plane.tsx,planar.ts): the active plane in the middle, «Planeswalk» and the planar die with what the next roll costs (planar_rolls, one more each time and back to zero with the turn). The plane deck is common (Common { Planes }). -
Archenemy (
schemes.tsx): the scheme deck is the archenemy's; «Set in motion» and «Abandon» are only theirs, and at the start of their turn a notice reminds them.
Turns follow the seat order (Game.players). In the local dialog the seats are dragged by their handle (orderAfterMove) or shuffled (randomOrder); the «Goes first» row picks who starts (TableConfig.first; without it the engine draws it from the game seed). Engine rule (apply.rs): eliminated seats are skipped and the round goes up when play passes the first player's seat (alive or not), not seat 0; if only one is left every turn is a round (tests/turns.rs).
The engine always decides who goes first (turn.first, drawn in table_engine::setup::initialize). The wheel only shows that result, like the dice: nothing on screen can change it, and in a network game every screen lands on the same player because the value comes with the game.
-
While the table is being prepared.
connection.ts::withRoulettestarts the wheel as soon astable_startornet_startis launched, with the seats ofTableConfigand the job's progress below it, so the wait has something to look at. A failure removes it. -
Landing. The first view stops it.
onMessageholds that view until both the image preload and the wheel have finished (Promise.all), so the table opens right after the result. Braking starts at the speed the wheel was turning (roulette/math.ts::braking), lasts 1.8 to 3.6 s and always gives one or two more turns.randomonly moves the needle inside the winner's sector. -
Guests prepare nothing when the game starts, so their wheel starts with the view: the
Startednotice callsawaitStartingPick()to tell that first view apart from one that resumes a saved game. Over a slow relay a guest stays in the lobby until the game has arrived. -
Another game. «Another game» and the next game of a match load nothing, so the wheel appears over the table. They arrive as
TableMessage::View { is_new: true }, set bySession::publishfor aChange::Restorewith nothing undone. It cannot be deduced from the log:Log::in_effectdrops the new-game event, and undoing back to the start leaves the same empty log. A spectator does not get this flag, so they see no wheel on a restart. -
When there is no wheel. With «Wheel when drawing who goes first» off in Settings (
startingRoulette, on by default; only this screen is affected, the draw is the same); solo games, since ghosts are not players and there is one seat; resuming or rejoining a game already under way (isGameNotStarted); and whenever nothing was drawn, meaning the first player was chosen by hand or lost the previous game (MatchView.starter). So that a guest knows this in a single game too, the host sendsFromHost::Matchwhenever a first player was chosen, not only with a match. -
The layer.
roulette/roulette.tsxgoes by portal tobody, because games start from dialogs and the table is its own stacking context. It takes no pointer events, since a click outside would close the dialog below. Timers live inroulette/state.ts, not in the component, so the table still opens if the Play tab is not on screen. With «reduce motion» the wheel does not spin and only shows the result.
Then, on the table (turn.tsx, all driven by the pure whoPlays):
-
TurnChip, in the bar: «{who}'s turn» with the player's colour, and «{who} goes first» during the mulligan. «Your turn» and «You go first» exist only online: in a local game the "me" is whoever is being looked at, so it would always say «Your turn». On a phone it takes two lines with the turn number, so the bar does not grow. -
TurnNotice: the same sentence large for 1.8 s when the turn advances, not when opening the table or undoing. It takes no pointer events. -
TurnRing: a ring in the app colour on the board of the player whose turn it is, without blur, because it sits over moving cards and a large blur would be repainted each time. Thumbnails show the same with a stronger header and a play icon. -
player-marks.tsxkeeps a flag on the first player for the whole game, since rounds count from that seat.
An encounter lives in the session, not in the Game (so Action and Change do not change). table_engine::matches::Match { best_of, closed } is pure: 1, 3 or 5 are offered (DURATIONS), the scoreboard is computed from the closed results plus the current game if it already ended (so undoing «Finish» never leaves an extra point), a team wins together and the loser of the previous game starts the next (next_first). matches::swap(deck, leaves, enters) validates that as many cards leave as enter, that those leaving are in the deck and those entering in the sideboard, and that none is repeated, before touching anything. The session (table/matches.rs) joins that to the decks and opens the next game with the same replacement as «Another game» but with the new decks and the scoreboard up to date. Commands: table_match (MatchView: scoreboard, who starts and why), table_sideboard(player), table_sideboard_swap and table_next_game. SideboardDialog groups the copies by name (matches.ts::group), lets each player choose how many to swap and does not let it be sent unless as many leave as enter. In a local game the dialog changes everyone's. Online each player changes only their own deck (Session::require_mine, otherwise not_yours) and the host opens the next game. The host holds every deck, so a guest asks it: ToHost::AskSideboard and ToHost::SwapSideboard { leaves, enters }, answered with FromHost::Sideboard (the deck and sideboard as they are now) or SideboardRefused { reason }. For that, table_sideboard and table_sideboard_swap are async and wait up to 10 s for the answer (Guest.sideboard, a oneshot). Guests keep the scoreboard too: the host sends FromHost::Match { current_match, first } with the welcome and before each new game of the match, and each guest computes the scoreboard from that plus its own game result. So GameOver shows a guest «Sideboard» (not «Next game») and «The host starts the next game.»; the dialog has «Save» instead of starting the game. After a host handover the new host does not have anyone else's deck, so it cannot open the next game of the match (no_decks).
-
Who is out.
table_engine::out_of_game(&Game, j) -> Option<Cause>(death.rs, pure) says whether someone is at 0 life or less (the team's shared life if there is one), at the poison limit (10) or at 21 from a single commander (Cause::{Life, Poison, Commander { from, card }}; life wins, then poison, then commander) and is not already eliminated. It travels inPlayerView.out_of_game. The table never eliminates anyone by itself:Eliminationsasks that player «Are you out of the game?» (the others see «Is {who} out of the game?» when it is their screen) with the reason and who caused it, and sendsEliminate { player, by }; for everyone else it is a notice that does not block, and after 15 s (LOG_WAIT_MS) any of them may mark the death. «I'm still in» closes the question for that cause (causeKey); it asks again only if the cause changes or the player recovers and falls again.
-
Whose damage.
DamageSourcePrompt: when someone loses 5 or more life (MIN_DAMAGE) on another player's turn, the active player gets a one-click question «Who dealt it?» (12 s,PROMPT_MS); the answer is remembered only on this screen (useDamageSource.last) and is what fillsbywhen that player dies. It is forgotten when the table closes and whenever a game starts in the mulligan (restart, or the next game of a match in the same table), so game 2 never preselects game 1's damager. Without an answer it is recorded as before.shouldAskDamageanddefaultEliminator(death-logic.ts) are the counts, with tests. -
Absentees. The host tells everyone who has lost the connection (
NetNotice::AbsentPlayers, see Online Play).Absenteespaints a notice per absent player who is not eliminated; if the active player has been away for 30 s (SKIP_WAIT_MS) the next player still in the game and connected (nextAliveover the seats that are neither eliminated nor absent: if the next one is also away, nobody could otherwise skip) gets «Skip {who}'s turn» (Action::SkipTurn) and the rest see who can. The hand stays on the table. In the mulligan, once a minute has passed, the host keeps the hand for the absent player (table_engine::absence::default_keep). -
Expelling. The host of an online game has «Remove from the game» in a player chip's menu (
net-status.tsx, confirmed with «Remove {name}?»; commandnet_kick): the expelled player is eliminated and cannot come back into that game.
-
«Table settings» (
lucide:settings-2, in the desktop table bar and in the phone's «⋯» menu) opensdialogs/settings.tsx::TableSettingsDialog(dialog{ kind: "settings" }inscreen.ts) without leaving the game: a «Change playmat…» button (players only, not spectators; it opens the mat dialog) and the sameTableSettingssection as Settings › «Game table», applied at once. It is rendered withinGame, which leaves out the network identity block (NetIdentity): it cannot be changed with a game open. Only the mat reaches the other players; everything else is per screen. -
Menus (
menus/card-menu.tsx,menus/zone-menus.tsx, the life menu inplayer-life.tsx) useContextualContent(see Live Preview). The card menu changes by zone (battlefield, hand, stack, command, graveyard, exile) and shows each item's key. Library menu: draw, draw several, mill, exile from the top (face up, face down or hidden), look at top/bottom, scry, surveil, search a card or a land, reveal and cast, manifest, reveal the top, play with the top revealed, wheel, shuffle. On someone else's library (online, from their board) everything is done on their behalf (performFor,PerPlayer) except «Reveal and cast…» and «Cascade…», which are about what you cast and so are not offered there, and «Stop revealing the top card» / «Stop playing with the top card revealed», which belong to the owner (the engine refuses them; «Play with the top card revealed» is still offered). Likewise someone else's hand menu offers «Make them reveal their hand» only while it is hidden, and a card of someone else's hand that you can see only gets «Inspect» and «Move to…» (a chosen discard), never cast, show or cover. When a search closes with «Shuffle and close» it shuffles the library that was searched (theirs, on their behalf) and puts back on top of it what was placed there; before it shuffled your own and left theirs visible to you. Zone menu: view; in the graveyard and exile also a random one to the hand, battlefield or exile («One at random…»), shuffle all into the library, all to the bottom in random order and, in the graveyard, exile all. A spectator gets no zone menu. Empty battlefield: untap all, organise, create token, put a «bolita» here, select all, remove my arrows. -
Shortcuts (
shortcuts.ts): one tableSHORTCUTSwith three contexts,card(pointer over a card, or the selection),library(pointer over the library) andtable. The card wins over the library and the library over the table. Keys are ignored in inputs, with a dialog or a menu open. Examples: T tap, R transform, F face down, C counter, +/= and − for +1/+1, X power/toughness, G graveyard, H hand, E exile (Shift+E face down), S shuffle in, B bottom, I inspect, P highlight, A attach, D attack/target, O take one from a pile; on the library D draw, S scry, U surveil, M mill, E exile the top (Shift+E face down), O look at the top, V view, T tutor, L search a land, H shuffle (and 1–9 draw that many); they act on the library under the pointer, which is the one of the big board (boardOf): online, looking at someone else's board, it is theirs, as in its menu, which shows the same keys next to «{who}'s library»; on the table U untap all, Ctrl+Z/Ctrl+Y undo/redo, Shift+R respond / back to the turn (local game), Ctrl+Enter pass the turn, ? the list. A spectator's keys do nothing. A test checks no key repeats in a context. During a replay its bar has its own keys: Space play/pause, ←/→ one event, Home/End the start or the end. -
Dialogs (
dialogs/, one at a time throughuseScreen.dialog): number and text prompts; counter; power/toughness rows; label (16 colours,LABEL_COLORS; the first 7 keep their place because saved games name the colour by number, and Rust accepts0..16,apply::LABEL_COLORS);viewing.tsx(look, scry, surveil: spread the cards between top in order, bottom, graveyard and exile and confirm withReorder; closing without confirming leaves them);search.tsx(search the library with name/type/colour filters, offering to shuffle on close (shuffling does not undo what was put on top during the search: it shuffles first and then puts those cards back on top, in the order they were placed, as in a real game;topAfterTaking); view graveyard, exile, command or sideboard with the «Earlier» divider);reveal.tsx(reveal and cast: discover, cascade, reveal until, reveal N, Jodah, Sunbird's and a custom excavation; first everyone sees the reveal, then the player decides each card and where the rest goes);tokens.tsx(tokens of the deck, quick ones, helper ones such as dungeons, The Monarch or The Ring, any Scryfall search or a real card to copy throughtable_scryfall_origin, a free token; quantity and «as a pile»);random.tsx(coins with «Flip the coin», until losing, Krark's Thumbs, quick rolls, N dice of X, the planar die; Rust decides the result);finish.tsx(who is out, who won and how; final); the shortcut list;InspectDialog(table_card_info). -
Without connection a quick token is still created, generic and named (
createTokenwithTokenSourcefree). -
Attaching (
operations.ts::attach): after a successful attach, if «Offer the aura and equipment bonus when attaching them» is on and the aura or equipment has aflatBonusand the target is a creature, a toast offers «Add», which adds it to the creature's «other» row (PlusXPlusY). The engine never adds it on its own. The offer is a prominent card (bonus-notice.tsx,notifyBonus: atoast.customwith the bonus in large type, the equipment and the creature, «Add» and «Not now», 20 s on screen), not a plain toast. -
Protected battlefield (
Options.others_battlefield_protected, online):privacy.ts::othersBattlefieldsays whether a battlefield card is controlled by someone else; such a card is not dragged nor turned by a double click (board.tsx), and its menu only offers «Inspect» and «Take control». ANotPermittedrefusal (a shortcut on someone else's card) is silent, both fromactions.ts::performand from a host'sRejection(connection.ts): touching what is not yours just does nothing. -
Control (
menus/card-menu.tsx::ControlSubmenu): in the battlefield menu, on a card you control «Give control to…» (a submenu of the other players still in the game) and, on one controlled by another player, «Take control» and «Take control until end of turn»; they act on the selection (operations.ts::giveControl,takeControl). A temporary one shows a clock with the name of who gets it back (badges.tsx, and in the large view). What hangs from a card from another battlefield (my equipment on a creature now controlled by someone else, an aura of another player on mine) is drawn next to its card, which is where it is, and travels with it when dragged (field-spots.ts::withOthersCards); before, it was drawn nowhere. -
Another player's board (
board.tsx,menus/zone-menus.tsx): every zone menu acts on the board being looked at, for its owner when it is not yours (operations.ts::performFor→perPlayer): the library menu (draw, mill, exile, shuffle, look at or search their library), the graveyard and exile menus, «Untap all» and «Create token…» (the token dialog has a «For» selector: Beast Within, Forbidden Orchard). Their hand has its own menu (OtherHandMenu: look at it, make them reveal it, discard at random or the whole hand, draw); once looked at, the cards you know show face up in their place in the fan and can be moved. Clicking another player's library does not draw (use the menu). -
The token dialog's Scryfall search (
dialogs/tokens.tsx) turns what is typed into a query (token-query.ts::tokenQuery): a token's name does not carry its colour or its power, so «green beast» searchesBeast c:gand «3/3 beast» searchesbeast pow=3 tou=3; what already looks like Scryfall syntax (t:goblin, quotes, operators) is sent as it is. With «Tokens only» the query gets(t:token OR t:emblem OR t:dungeon)added, and when there is nothing the dialog says so. -
Seeing a whole zone (
dialogs/search.tsx::ZoneDialog): a modal with every card of a graveyard or exile, no need to take them out one by one. It has a tab for each (with its count), a selector with every player (and how many cards each has there, with several players) and the same grid as the library search; from each card it can go to the hand, the battlefield (always the mover's own, so taking from another's graveyard puts it on yours), graveyard, exile or the bottom of the library. It opens from the skull button of the top bar (for the board being looked at), from a zone's menu («Preview») and with a double click on the zone. It also has entries in the context menus: on any card of a graveyard, exile or sideboard («See all cards ({zone})», incard-menu.tsx::OtherZoneItems, because right-clicking the top card of a zone opens the card's menu, not the zone's), in the zone's own menu («Preview») and in the empty-field menu («Graveyards and exile»). -
Revealing the top card:
RevealTopleaves it seen by everybody (view_for = Everyone,CardView.revealed) andHideTop { n }undoes it (only what was seen by everybody; what someone looks at on their own is untouched; it is in the «can be done for another player» list, catalogue v2, butresolve::permissionsrefuses it withNotPermittedwhen done for someone else unless «everyone touches everything» is on: revealing another player's top card is fine, covering the card someone else is showing is not). The board draws the top card face up when playing with the top revealed or when it has just been revealed (library-top.ts::revealedTopCard, also in the mini boards), and hovering it shows the large view. Only on its owner's own library, a revealed card has a small «eye-off» button (with the mouse only: by touch it would cover the magnifier on such a small card, so it stays in the long-press menu) and the library menu has «Stop revealing the top card»; on someone else's library neither appears, and by touch the magnifier reads it large; it stays revealed until it is moved or the library is shuffled. -
Cascade several times (
dialogs/reveal.tsx::RevealDialog, library menu «Cascade, several times…» and «Reveal and cast… (Cascade, Discover)»): the presets Discover, Cascade and Jodah have a «Times» field (1–20) besides the mana value N. Each round isdig+ choose +resolveDig(the hit goes to the stack by default, the rest to the bottom at random), and when it is resolved the next one starts by itself with the same N, revealing from what is left of the library (the earlier ones are already at the bottom or on the stack); the dialog says «Reveal 2 of 4» and the button «Next reveal». No engine change. If a reveal fails (empty library) it stops. -
Showing a card (
menus/card-menu.tsx::ShowSubmenu,operations.ts::show): in the menu of a card in your hand, and of a face-down card of yours on the battlefield, «Show…» offers «To everyone» (ShowEveryone: seen by everybody, spectators included, and it shows face up in your hand on their screens), one entry per player (RevealTo) and «Stop showing» (StopShowing, catalogue v2). KeyMtoggles it on the card (SHORTCUTS). A card shown to all has a small amber eye on it in your hand; moving it hides it again. -
Play lists in the local game (
local-game.tsx): each seat picks its deck and its play list (SeatGameList: a selector with the deck's lists, or «The whole deck» if it does not exceed the format, and a pencil/plus to edit or create one withGameListDialog). A Commander deck over 100 cards starts with its first list but a seat without one cannot start (an amber warning names the players). Solo, «With friends…» and «Online…» use the deck and list chosen in the right-hand panel of the entrance. -
Jobs that prepare the table (
table_start,table_resume,net_deck,net_join,net_start) are launched withcommands/table.rs::spawn_job: a second task waits for the first and, if it ended badly (a panic), emitstable://donewith an error. Without it the screen stayed on «Setting up the table…» forever, because the end event is the only thing that clears it. -
Local game (several players on one screen): the hand of whoever does not have the turn is not shown, its backs come out instead (
privacy.ts::handHiddenByTurn; not during the mulligan, not in network games). Responding out of turn (an instant, a counterspell): «Respond as {name}» in the bar (a menu when there are more than two players),Shift+Ror just pressing the other player's mini board switches the view to that player (viewing.ts::respondAs, which only changes who is looked at; the engine already lets you act on your own things) and its hand stays behind a curtain («{name}'s hand: click to see it»,useScreen.shownHand, theshownargument ofhandHiddenByTurn) until that person uncovers it; changing player covers it again (viewPlayerclears it). While you respond the bar offers «Back to {name}» (returnToTurn) or, if more than one player can respond, a menu «Responding as {name}» to go back to the turn or jump to another responder;Shift+Rwalks through the responders in order and, after the last, returns to the player of the turn (privacy.ts::nextToRespond). With something on the stack, the mini boards of the other players pulse with «Something is on the stack: respond?».whoRespondslists who can respond (not the active player, not eliminated, in table order from the active one). Each board uses the tapete of its own player:boardDeckgives the deck of the seat in a local game (in network only the host's, when looking at their board); without a deck the prepared tapete of that player is used, never my settings. The mini boards draw that tapete too. -
The other board at full scale: when a board has a big cell (420×340 px or more, as in «Two boards»),
mini-board.tsx::EnlargedCarddraws it with the same geometry as your own (layoutBoard,battlefieldSpots): field cards the same size, counters and power/toughness (Badges), the hand fan (backs, or face up what the viewer may see) and the zones with their top card, read-only; clicking it still switches to that player. Smaller cells (three or more players) keep the small thumbnail. -
mulligan.tsxcovers the board until the player keeps: the hand large, the rule of the chosen mode, and how many cards go to the bottom (bottomCount, the same count as the engine'sKeepHand). With several players it shows who starts, drawn with the game seed. -
turn-assists.tsx: at the start of the player's turn, if the draw or untap helpers are off, their buttons appear for 10 s (with a rad-counter mill reminder); the monarch gets a permanent draw button; withwarnZeroLife, toasts at 0 life, at the poison limit and at the commander-damage limit. -
player-life.tsx: −/+ or the wheel; clicks within 700 ms are merged into oneLifeevent and shown as «40 + 2 = 42». Its menu: damage, gain, drain, life to everyone, poison, commander damage, trackers, monarch, initiative, the city's blessing, day/night, reveal the hand. «Pass turn» sits next to it. The big board shows only the life of that board's player (boards.tsx::BoardControls): online, looking at someone else's board keeps you as yourself (medoes not change, onlywatching), so the counter there is theirs, with their name in front (foreign,withName) and without what only you do (pass the turn, drain, life to everyone, reveal the hand, end the game). Before, it was always yours, and «damaging» the rival from their board took your own life. A mini board's context menu has the same damage, gain life and poison entries (LifeOptions), so damage always goes to the player you point at. «End the game…» is only offered to whoever runs the game (local or the host), as in the bar. Above the counter,player-marks.tsx::PlayerMarksshows what the player carries: poison, the damage of each commander (by name), monarch, initiative and the city's blessing, each with a game icon (game-icons:*) and a tooltip; red what already reaches its limit (poisonLimit,commanderDamageLimit); the engine only warns, who is out is confirmed by the person. -
respond.tsx: the bar button to respond out of turn (a button or a menu) and «Back to {name}». -
table-bar.tsx: «Watching» when the board shown is not yours, a sun or moon when the game has day/night (designations.dayNight, tooltip «It's day» / «It's night»), turn and round with a clock (turn.sinceMs, stopped while paused), pause, undo, redo, dice, commander damage (in Commander), tokens, who is watching (online), log, chat (online or with several players), mat, shortcuts, full screen (toggleFullscreen()oflib/app-window.ts, the same as F11, see Settings and Shell), the layout selector, «Follow the player whose turn it is» (crosshair, with several players; it shows whether it is on), the sparring button (not online), restart, end, «Edit this deck» (saves, opens the deck in the Deck tab, the game stays saved), leave and «Hide the bar». -
Hiding the bar (desktop and phone): «Hide the bar» (the last button on desktop, in the «⋯» menu on the phone) sets
barHiddenin the table preferences, so it is remembered between games. Instead of the bar,BarTabshows a small tab at the top (centred; on an upright phone, on the left like the bar) with «Show the bar». While hidden,MultipleBoards(boards.tsx) leaves onlyTAB_MARGIN(16 px) at the top instead ofBAR_MARGIN(52 px). The bar slides up and fades out while the tab drops in, and the other way round when shown (topAnimationintable-screen.tsx); the boards' top margin follows with atransition-[top]. A replay keeps its own bar, which is never hidden. -
Exit animations (
exit-transition.ts):useExitTransition(visible)keeps a piece mounted forEXIT_DURATION(200 ms) after it is hidden so it can play atw-animate-cssexit (animate-out … fill-mode-forwards), and only animates after a change (animate), never on opening the table. With «Reduce animations» it unmounts at once with no animation. The table bar and its tab use it, and so does the phone's seat bar. The tab carriesdata-tutorial="table-bar"so the tutorial still has an anchor. -
At the end (
general.end)game-over.tsxshows the summary of the game (see «End of the game, history and replay» below), with «View the table», «Watch replay», «Exit» and «Another game» (not for an online guest: starting another game is the host's, see Online Play).
Events reach the screen as data and eventText writes each one with t() in the interface language; Rust never writes prose. Hidden information is written from the viewer's side («draws 2 cards», never which). The store keeps the last 500 events (MAX_LOG). Patches append their event; a full View from the channel brings log, the last 500 (LOG_IN_VIEW) of Log::in_effect() (the events that still count: without what was undone, without what came before a restart and without the Restaurar events themselves), and receiveView(v, log) replaces the list with it. So after undo the undone lines disappear, after «Another game» the old game's log is gone, and resuming a saved game shows its log. table_view (asked after a skipped patch) brings no log and the current one stays.
The log lives in the side panel (log-panel.tsx, SidePanel): a panel on the right of the table with three tabs, «Log», «Notes» and «Chat», opened from the bar and closed with its own button (the large card view moves aside, PANEL_WIDTH in screen.ts; the dialogs are not covered). It is not a separate window.
- Each line has the icon and colour of its category (
event-categories.ts:ACTION_CATEGORIESis aRecord<Action["type"], …>, so a new action without a category fails to compile), its time, and the sentence. Card names are marked in the text with private-use markers (\u0001id\u0002name\u0003) thattextPartssplits again: hovering a name that is still on the table shows that card large (CardNameLinkinlog-panel.tsx). - Dropping several battlefield cards at once is one line, «{who} repositions {cards}» (
Place, categorymove). - «Pass turn» lines say how long the turn took («passes the turn after 2:13»,
turnDurationinlog-logic.ts: from the previous pass or the start of the game; none if the beginning is no longer in the list). - Arrow lines name both ends: «X attacks Y with Z» / «X targets Y with Z» for a player, the phantom («{who} attacks the ghost with {source}») or a card (
event-texts.ts, casearrow), instead of a generic «puts an arrow». - On the last 8 lines (
STACKABLE_RECENT) a card put straight onto the battlefield and still there has «To stack» (cardToStack, sendsstackAfter): for when it should have gone through the stack. In solitaire every line has «Undo to here» (Undo { until: seq }). - During a replay the panel shows the log of the point being watched and neither button appears.
Each player can jot things down to remember them, mainly the mana that comes from sacrificing a Treasure or similar, as a tab of the side panel («Notes», button with the number of notes in the bar). They are part of the engine (catalogue version 3): Action::AddNote { text, temporary, private }, EditNote { id, text, temporary, private } and RemoveNote { id }, stored in Game.notes (Note { id, author, text, temporary, private }; skip_serializing_if empty, so games and records without notes keep their fingerprint). Rules:
-
Whose: every note belongs to the player who wrote it and only that player edits or deletes it (
resolve::permissions; «everyone touches everything» opens it). At most 30 per player and 200 characters each (MAX_NOTES,MAX_NOTE_LENGTH; trimmed, not empty). -
Private:
GeneralView.notesis built per viewer (Note::sees_it), so a private note never reaches another player's screen, not even in the patches, and not even in the «Everything visible» replay. Like the hands, it is a rule of the view, not encryption: in an online game every copy of the game holds the full state (see Online Play). The log hides the lines of private notes and of deleting a note (log-logic.ts::visibleInLog); a spectator never receives the events of notes (host.rs::visible_event), only the patch with the public ones. -
Temporary: they are deleted when the turn passes (
apply::pass_turn), like the~counters. A note can be changed between temporary/permanent and private/public with one click, edited in place (Enter saves, Escape cancels) or deleted at any time. -
Not part of the game: notes are not undone and do not count as «the last action» (
Action::is_noteinlog.rs), and undoing keeps the notes that exist now. They are not accepted in a replay. -
Pinned to a card (catalogue v4,
table-notes.tsx): a note can hang from a battlefield card (Note.card). The card's context menu has a notes section (CardMenuNotes: «Add note…» pinned to it, editing your own notes on it and «Unpin my notes»), the empty field's context menu has «Add note…» (a free note), and both openNoteDialog(text, temporary, private). Free notes are drawn as sticky notes in their author's colour at the top left of the battlefield (LooseNotes; on a phone at the top right under «Pass turn», narrower and folding into a «Notes» pill, because the left belongs to the seats bar and the stack): click one of yours and then a card to pin it (target modenote, Esc cancels), or use its menu (edit, pin, temporary/permanent, private/public, delete). A pinned note shows as a badge on the card (see «Cards» above) and comes loose by itself when the card leaves the battlefield, so it is never lost. Only battlefield cards: pinning to a card in a hidden zone would reveal which card it is. The log hidesattachNotelines and privatenoteOnCardlines like the other private note lines.
Communication is part of the engine log, so it is online-safe, shows in the log and the replay, and is replayed after resuming: Action::Chat { text } (at most MAX_CHAT_LENGTH = 500 characters, trimmed, not empty), Action::QuickNotice { kind } (wait, responding, ok, pass, yourTurn, letMeThink and, since catalogue v5, 14 friendly phrases: helloEveryone, goodGame, nicePlay, greatPlay, awesome, thanks, goodLuck, cheerUp, niceDeck, badLuck, youGotMe, sorry, beRightBack, oneMore) and Action::Signal { signal } (noResponse, wait, thinking, absent, or null to clear). After the game has ended the engine accepts only Chat and QuickNotice (is_communication). Spectators have no seat, so they cannot write: the panel says so.
- The «Chat» tab lists messages and notices (
chatMessages), has one button per notice, a «Phrases» button that opens a popover with the friendly phrases (FRIENDLY_MESSAGES, no keyboard shortcut) and a text field (Enter sends, Esc leaves the field). The phrases are notices of the engine, not free text, on purpose: only the type travels and each screen writes it witht()in its own language, so a player who writes in Spanish is read in Japanese by a Japanese player. New phrase = newQuickMessagevariant at the end,CATALOG_VERSIONup,catalogo/v<N>.jsonandPROTOCOLup; its text goes intoFRIENDLY_MESSAGESand the 15 dictionaries. Unread messages show a counter on the tab. Muting someone (stores/chat-store.ts,muted) hides them only on this screen; the event still travels and is still in the log. -
Emoji button (
EmojiButton,src/components/emoji/), between the text field and «Send». It uses EmojiMart (emoji-mart5.6.0 and@emoji-mart/data1.2.1), with these choices:-
Where it opens. On desktop and tablet, a
Popoverabove the button that stays open so several emoji can be added in a row (onFocusOutsideis ignored because the chat puts the focus back in the field after each emoji; a click outside closes it) and does not steal the focus (onOpenAutoFocus/onCloseAutoFocusprevented, so the cursor stays where it was). On a phone, aMenuSheetwith the picker at full width (a 352 px popover does not fit sideways with the keyboard, and phone menus rise as sheets); it closes on pick and the focus is not given back to the field, because that would open the keyboard on top. -
Where the emoji goes.
insertAtCursor(insert.ts, pure and tested) puts it at the cursor or replaces the selection, and returns where the cursor ends; if the result would exceedMAX_CHAT_LENGTH(counted in UTF-16 units, likemaxLength) it inserts nothing, since an emoji cut in half would be garbage. Without a known selection (the field never had the focus) it goes at the end. -
Loaded only when used.
emoji-picker.tsxis its own chunk (lazy, downloaded the first time the button is pressed), and the emoji data (@emoji-mart/data/sets/15/native.json) is another one, loaded once and shared. -
No internet. Out of the box emoji-mart fetches its data, translations and images from jsdelivr, which the web view must never do (all network is Rust's, and the CSP blocks it). So the data and the translation are always passed from the package (English too), and the
nativeset is used: the emoji are drawn by the system font, the same one that draws the chat messages, so the picker shows exactly what the message will look like (the other sets download images). -
Language (
language.ts): the 13 languages emoji-mart ships; Romanian is not one, so it gets English, andzhs/zhtboth getzh(simplified). Each translation is its own chunk. -
Colours. The picker lives in its own shadow DOM, so the app's CSS does not reach it:
themeColorsreads the app tokens (--popover,--popover-foreground,--primary,--muted, plus--font-sansand--radius), turns them intor, g, bthrough a 1×1 canvas (the tokens may beoklch) and sets emoji-mart's variables; light or dark is chosen by the background's brightness, not by the mode, because themes decide. -
@emoji-mart/reactis not used: it requires React 18 or earlier and only wraps the same thing, so thePickerelement fromemoji-martis mounted directly.
-
Where it opens. On desktop and tablet, a
- Each new message or notice from another player also shows as a bubble for 6 s (
BUBBLE_MS) next to their thumbnail (mini-board.tsx) or, for the player whose board is the large one and for everyone in the single-board layout, in a stack at the top left (FloatingChatBubbles). A signal is a badge (PingBadge) next to the player's name or life. - Shortcuts (
SHORTCUTS, contexttable): Enter opens the chat and focuses the field; Alt+1…6 send a notice; Ctrl+Shift+1…4 set a signal (choosing the signal you already have clears it,pingAfterChoosing). They go by the physical key code (communicationKey) because Shift or Alt change a digit's symbol, and the board ignores keys with Alt so they do not collide with card keys. -
event-reactions.ts::reactToEventis the single place where a new event from the channel causes something on the screen other than the store: the bubble, the unread counter and the sounds.

table_engine::summarize(&Log) -> GameSummary { placings, rounds, turns, durationMs, startedMs, finishedMs } counts the game from the log: in which place each player ended (Placing { player, placing, round, by }; 1 = won, shared by a tie or a team; the rest by the order they fell), the round in which they fell and who took them out when known, rounds, turns and the time from the first to the last event that still counts. It is pure and has no clock. The dialog «Finish», the end screen and the history all read the same summary (table_summary), and the screen never recounts anything (game-end-logic.ts only formats).

The end screen (game-over.tsx) shows the winners and how, each player's place, round and who knocked them out, rounds and duration, and, in a match (best of 3 or 5), the state of the match with «Next game». Its buttons: «View the table», «Watch replay», «Exit» and «Another game». «View the table» (focused by default) and Escape hide it to look at the table, and a «See the result» button at the bottom brings it back, so «Another game» is never out of reach.
When Finish arrives the session builds a NewGame (history::from_session) and gives it to a hook (history::install, a OnceLock set once in lib.rs so the session does not know the database; without it, as in the engine tests, nothing happens). store::games::save writes it to the tables games (one row per game: format, mode, players as JSON, winners, how, rounds, duration, the catalogue version and the record, in log) and game_decks (which deck sat in each seat, for asking by deck), created by migration 0006 as partidas and partida_decks and renamed by 0013. They do not hang from the decks: deleting a deck keeps its games with the name it had, and playing never changes the deck's updated_at.
-
What is stored. A player who has the whole game (solitaire, local, or the host of an online game) stores its
SavedGamecompressed inlog(the same format as the saved game, so it can be replayed). A guest in an online game stores the whole replay too when its copy starts before turn 1 (it received the game during the mulligan,initial.turn.number == 0, so it has every event:history::from_session); a guest whose copy starts mid-game (it came back after a cut) stores only the summary, withlogempty. Spectators store nothing. A guest does not have the decks, so the app remembers the deck and play list it chose (net::remember_my_deckfromnet_joinandnet_deck;net::my_deck): its own seat gets thatdeck_id, list and deck name, and the game shows up under that deck in «Games». -
Commands.
deck_games(deck)returnsDeckHistory(games, wins, and each rowGameRow: place, whether it was a win, rivals, rounds, duration, date, whether it has a replay);game_delete(id)removes the game and its replay, and the copies of its images that no other game uses (below). In the deck's properties dialog the tab «Games» lists them; rivals are the other seats of that row, so a local game with the same deck in two seats does not show as «solo». -
General history (
general-history.tsx, button «History» on the Play screen).all_games(limit, from)returnsGeneralHistory { total, wins, rows }: every finished game of every deck, the newest first, in pages (the screen asks for 100; Rust caps a page atMAX_PAGE= 500). The place of a row is the best of the seats that have a library deck (0 for a guest online, who counts as neither a win nor a loss). Each seat shows who played it, with which deck and, if it did not play the whole deck, with which play list and how many cards it had (HistoryPlayer.listId,listName,listCards). The name and size are written when the game is saved (fill_game_lists, fromdeck_game_lists), so they stay if the list is renamed or deleted later (a list already gone when the game was saved shows as «List deleted»); old rows without those fields still read (#[serde(default)], no migration). The dialog filters what is loaded by text (deck, list, player, note; without accents or capitals, every word must appear), result (won/lost) and format (history-logic.ts), and has «Watch replay» and delete on each row. A row shows up to four seats (MAX_ROW_SEATS, then «and {n} more») and «Load more ({n})» asks for the next page. -
Replay images outside the cache (migration
0008_partida_imagenes.sql). A replay paints the own images of every player (uploaded or designed cards, tokens, backs, mats), and the other players' ones cannot be prepared again once the game is over; the table cache (app_cache_dir/mesa/) can be cleared at any time. SoNewGame.imageslists the hashes a replay needs (only when there is a record:history::from_sessiontakesnet::images::custom_images_ofof the initial game and of the final one, deduplicated; tokens that came and went are not painted with an own image),store::games::savewrites them togame_images(game_id, sha), and the history hook inlib.rsthen copies each file from the cache toapp_data_dir/games/images/(table::images::save_for_history, on its own thread so the table does not wait; what is not in the cache is skipped).table::images::serverestores a missing cache file from that copy before serving it.store::games::removereturns the hashes no other game uses any more, andgame_deletedeletes their copies (forget_from_history). Since a copy is per hash, playing the same deck against the same person again stores nothing new. What is still missing (a game saved before the host prefetched, an owner who disconnected early) falls back to the Scryfall original:replay_missing_images(empty with a room open, where the network brings it) lists the Scryfall printings of the cards with a linkedscryfall_idand an own face that is neither in the cache nor in the history copy (table::images::missing_images_of), and the screen (originals.ts::originalsWithoutImage, on opening a replay from the history or right after the game) puts them inoriginals-store.withoutImage, whichwithOriginalstreats like the «Original cards in my language» mode for those cards only, whoever owns them. Cards without a link keep the app's back with their name. -
On screen, both lists (
general-history.tsx,deck-games.tsx) show a spinner while the first page loads and, if it fails, the error with «Retry» in place (src/components/load-state.tsx,LoadState, which keeps the height so the dialog does not jump); a later page that fails is only a toast. In the general history, with a filter and pages still unloaded, the count says «more not loaded yet» and an empty result says «None of the loaded games match the filter.»; an empty filtered result has «Clear filters». - It does not stop a game from ending: a failed save is logged and the game goes on.


A replay is the same table in «look only» mode: the same session, channel and images with another game in front, the one Log::within computes for the point being watched, seen as one player or as everyone (as_player, since the game is over). There are two ways in: from the end screen (enter_replay, in place) and from the history (replay_open(id) → Session::from_saved, a session that exists only to watch and closes on leaving).
- Commands:
replay_open,replay_current,replay_seek { pos, asPlayer }andreplay_leave(back to the ended game or, from the history, closing the table).ReplayView { total, pos, asPlayer, milestones, tMs, fromHistory }carries what the bar needs:milestones(Milestone { pos, turn, round, active, tMs }) mark where each turn starts. - The bar at the bottom: timeline slider, to the start, previous turn, play/pause, next turn, to the end (
previousMilestone/nextMilestone), speed 0.5×…8× (SPEEDS), «View as» (a player or «Everything visible») and «Leave replay». Playing waits the real gap between two events, limited to 400 ms–1.5 s and divided by the speed (pauseBetween). Keys: Space plays/pauses, Left/Right step one event, Home/End jump to the ends; they are ignored in text fields and when a button or the slider has the focus (those already answer Space and the arrows, and the step would happen twice). - While replaying, the table accepts no action from this screen (
Rejected,reason: replay; the session lets chat and quick notices through,is_communication, but the chat box does not write during a replay), and no hover shows «To stack». Each jump arrives as a fullView, never as a patch, so a replay gets no patch to react to; the screen supplies both the effects and the movement. Effects:connection.tscompares the log of the new view with the previous one (replay-logic.ts::newEvents) and, if it is a short step forward (up to 3 events, with a movement duration, not a jump, not backwards, not a change of «View as»),event-reactions.ts::reactInReplayplays the sound of each new event (eventSound, still subject to the per-group switches) and queues its dice or coin roll; chat bubbles and unread counts do not appear (the messages are in the log). The switch «Sounds and dice in replays» (replayEffects, on by default) turns it off. Movement: a step of up toANIMATABLE_JUMP(3) points slides the cards to their new place overmoveDuration(90 % of the minimum wait at the current speed, so it ends before the next step) throughuseReplay.animateMs, read byTableCardView(CSS transition on the battlefield, FLIP between zones,ease-in-out) and by every mini board (mini-board.tsx::Sliding, FLIP at the mini board's scale, inThumbnailWidthand in the reading scaleEnlargedCard; during a replay they sample the store every 30 ms instead of 100, hand backs re-fan with a CSS transition and the zone frames stop clipping while a card slides in) so every player's table moves the same as one's own. Slide positions are kept per scale (useFlipoptionscope) and without expiry in a replay, andforgetPositions()forgets them on a jump or when changing board; a bigger jump on the timeline, or a change of «View as», is shown at once. The turn helps are not shown, and the life counter follows the board being watched. -
The live game and the replayed moment are two things (
Session::game()andSession::on_screen()).game()is always the real game, the one that goes to the network, is saved and decides;on_screen()is the replayed point and only feeds the view (view,replay_leave). Before, a single accessor returned the replayed point, so a guest who reconnected while the host was watching the replay in place received the past. The host watching a replay in place keeps applying what the others ask for (performno longer refuses remote intentions: a guest can still undo aFinishby mistake, or chat); only the host's own screen stays in the past. What arrives meanwhile does not move the view, but the timeline grows with it (refresh_replayrebuildsseqsandmilestones, keeping the point watched). A guest that receives the whole game again (receive_game) rebuilds an open replay on the new log, at its last point. - A chat line or notice kept after an undo (see Game Engine) belongs to a moment that no longer exists: the replay shows it with the table of the last earlier event that still stands (
Log::in_undone). - Scryfall images a replay needs and the cache no longer has (a replay from the history, a deleted cache, a token no longer on the table) are downloaded straight from their URL even without an online room (
net/images.rs::ensure), and an image is looked up in both the live game and the replayed point. - Rejection reasons added:
game_is_open(a replay from the history cannot be opened while a game is open),no_log(a game saved without a record),unfinished(replaying a game that has not ended),replay,not_a_replay(moving through a replay that is not open) andmissing(viewing as a player who is not in the game). A record from a newer catalogue is refused withUnsupportedandversion.

In solitaire, the phantom opponent of Game Engine (the «Sparring» section there has the model). The session asks it after every event of the player (Session::perform, behind Session::action: it keeps a copy of the game before the action, only when the intensity is not off, calls table_engine::sparring::react and, if there is an answer, puts it right behind as an event of the table with Log::from_table), so the screen receives two patches in a row.
-
button.tsx(SparringButton, in the bar, only with one seat): «Sparring» and the intensity; it opens a popover with the intensity («Off», «Light», «Realistic», «Cutthroat», sent asAction::SparringIntensity, valid from the next occasion), «Reactions this game» (card,R<round>, what it did and what was decided) and «How it works». The first time an intensity other than off is chosen,how-it-works.tsxopens with «Start sparring» (sparringSeenin the table preferences). -
reaction.tsx(PendingReaction): while a reaction has no decision, a card in the middle of the table (role="dialog", so the table shortcuts stop) with what it does («Exiles your Metallic Mimic»), the phantom's card and its cost, «Why now?», «Show why» (thebaselines) and «Resolve it» (Enter), «I have an answer» (A) and «Doesn't apply» (Esc), caught in the capture phase. In an edict, «Resolve it» first lists the player's creatures to choose the one sacrificed. -
ghost-card.tsx: the phantom's cards go by name;table_sparring_card(name)(Rust) checks the name is in the pool, looks it up once in Scryfall with/cards/collectionby name, remembers its id inapp_settings(table.sparring.<name>) and returns aCardOriginwith the image prepared like any other Scryfall card on the table (scryfall_origin, shared withtable_scryfall_origin). Offline, the name over the generic back. -
ghost-preview.tsx(GhostPreview,useGhostCardHover): the phantom's cards are not on the table (noCardId), so they cannot go throughLargeView; they are pointed at by name (useScreen.ghost). Hovering the card in the reaction prompt, its name in the log (event-texts.tswraps it in its own pair of markers andtextPartsreturns{ ghost }) or the card name in the Sparring button's list shows it large, at the width of Settings' large view, on the same side asLargeView(dodging the side panel) and above the prompt. Both large views are drawn throughtop-layer.tsx(TopLayer): the table is its own stacking context (isolate), so nothing inside it can rise above a modal (a Radix dialog is portalled tobodyatz-50);TopLayerportals them tobodyin a fixed, pointer-transparent layer (z-60) measured to cover exactly the table's box, so their children keep positioning themselves withabsoluteand a card can be read with a modal open. If what is pointed at disappears while hovered (the reaction is resolved), the view clears itself. -
texts.tswrites the keys ofExplanationwitht()and the log lines («The ghost counters Rhystic Study with Counterspell»; the decision as «{who} resolves the ghost's reaction» and the like). The intensity names are those oftexts.ts::INTENSITIES; «Light» is written asLight##weight, a key with a##context, so that it does not collide with the «Light» of the settings area, which has another meaning.
Rust decides every result (Change::Dice, Coins, PlanarDie, each with a animation_seed drawn from the event's seed); the screen only shows it. connection.ts hands every patch event to useDice.enqueue (queue.ts), and rollFrom turns the change into pieces: one die per die rolled (a d100 is two d10, tens and units, diceForRoll), the last batch of coins (with «until losing», the one that lost) or the planar die; at most MAX_PIECES = 20 are drawn, the full result is shown anyway. The queue keeps the roll on screen and at most two waiting: rolling very fast drops the ones in between. Each roll only gives way to the next when its animation says it has finished, so one that never finishes would leave the table without dice for the rest of the game: after ROLL_CAP_MS = 8 s (the physics lasts at most 4 s, plus loading three and Rapier the first time) DiceLayer shows the result anyway and, if it was the 3D, the next rolls use the light CSS 3D. The impact sounds the 3D loop plays are inside a try (scene3d.ts) and audio.ts creates the AudioContext inside one too (without an audio output the constructor can throw): a sound that fails never stops a roll. random.tsx closes on rolling, so the roll is seen on the table.
layer.tsx (DiceLayer, in table-screen.tsx) sits between the top bar and the hand (top-[11%] bottom-[26%]), does not take the pointer, and after each roll shows RandomResult (dice/result.tsx: the rolled pieces standing still, the same 2D dice and coins of the player's look, StillPiece, plus the sum or the planar face). The level rule (effectiveLevel, in dice/level.ts) is shared with LiveRoll (dice/live.tsx), which plays any DiceRoll in a box with the table's own scene (3D physics and shadows, or CSS 3D/2D) and leaves the pieces where they fell; it builds the scene with Framing "pieces", so the camera frames where the pieces come to rest (known before painting, since the physics is simulated whole first: piecesArea, with PIECES_MARGIN around them and at least MIN_PIECES_EXTENT) instead of the whole physics table the table layer frames ("table"), so the dice look big in a small box: the Settings sample and the «Dice and coins» dialog, which replays the last roll (the physics goes by the seed, so it falls the same way) with the sum or planar face below for RESULT_MS = 2.2 s; a click dismisses it. Three levels, chosen in settings (the dice preference):
| Level | Files | How |
|---|---|---|
3D with physics (3d) |
scene3d.ts, physics.ts
|
three.js (bare, no React wrapper) with a tilted orthographic camera (Framing: table frames the whole physics table; pieces, used by the dice sample in Settings and by the dice dialog, frames only the box where the pieces come to rest, with a margin and a minimum size, so they look big), ambient + directional light with shadows on a ShadowMaterial floor. physics.ts::simulate runs the whole roll with Rapier (@dimforge/rapier3d-deterministic-compat) before showing it, records every frame, and the scene replays the recording. |
Light 3D (css) |
css3d.tsx |
Low poly, no WebGL or physics, and without the browser's 3D: every frame the solid is rotated in code (quaternions, slerp between three random turns and the final pose), only the faces facing the viewer are kept (on a convex solid they never overlap, so nothing needs sorting) and each one is drawn in SVG with the affine transform that takes it to the screen (orthographic projection): its polygon, its piece of the face background clipped to it, a shade from the rotated normal recomputed each frame, and its number or symbol. The final pose shows the result face to the viewer, tilted back by TILT_ANGLE so the volume reads. The coin is two discs and a rim scaled by the cosine of its flip. The position, the bounce and the blurred shadow animate in 2D in a requestAnimationFrame loop. Why not CSS 3D (matrix3d and transform-style: preserve-3d, as it used to be): WebKitGTK without hardware acceleration (HardwareAccelerationPolicy NEVER, common on Linux machines whose GPU it does not like) does not composite in 3D and flattens each face on its own: the d6 vanished and the other dice came out squashed. Plain SVG looks the same in every web view. |
2D (2d) |
flat.tsx |
SVG silhouettes; the numbers flicker every 70 ms and settle in 900 ms. |
auto (default) uses 3D when there is WebGL2 and falls back to CSS 3D; if the 3D scene fails (no WebGL, no WebAssembly) it switches to CSS 3D for the rest of the session. With reduced animations (the setting or prefers-reduced-motion) only the result is shown.
How the shown face matches the engine:
-
geometry.tsbuilds the five solids: d4, d6, d8 from vertices; d12 and d20 as duals (dual()tries the six axis permutations so the faces point outwards); the d10 as a pentagonal trapezohedron. Opposite faces add up to n + 1 (on the d10, 0–9 adding up to 9).facePlanegives each face its centre, normal and in-plane axes withw = cross(u, n), so faces are never mirrored (a test checks the signed area). - The physics only says which face ended up on top (
readFace, the face whose normal is closest to up; the d4 is read by the face underneath and its numbers sit in the corners,d4Corners; the 3D scene puts each number at the angle of its real vertex,cornerAngles, because the corners of a face run counter-clockwise: with the opposite turn two numbers of every face were swapped and the top vertex did not show the same number on its three faces). ThenwithResultswaps labels so that face carries the engine's value. The CSS level does the opposite: it computes the final pose that puts the result's face towards the viewer (finalRotation, which uses the puregeometry.faceRotation: the face looks at the viewer with its «up» up and no mirroring, and the d4 is turned round so the viewer sees the vertex opposite the result face, with the result repeated on the three faces around it; the tests check it for every die). The 6 and 9 carry a dot from the d8 up, and also the 60 and 90 of the d10 of tens. - The physics table is fixed (
TRAY_WIDTH14 ×TRAY_DEPTH9, gravity −40,HZ60, at most 4 s) and not the board's size, so the same seed gives the same animation on every machine; the scene scales it to the board. A piece is stopped after 12 still frames; one left on an edge (flat< 0.94) gets a small push, up to three times. 300 random rolls stop in 1.7 s on average (2.2 s at most; 20 dice, 3.4 s). -
random.ts:generator(mulberry32) andrandomRotation(a uniform random rotation without trigonometry), so CSS and 2D are deterministic too. - Coins: a cylinder (3D) or two discs with
rotateX(CSS); heads is a crown and tails a cross (symbols.ts, SVG paths in a 100 × 100 box, used both on the canvas throughPath2Dand in<svg>). The planar die is a d6 with planeswalk on 1, chaos on 6 and blank faces (pieces.ts::PLANAR_VALUE).
Loading: three (about 526 KB) and Rapier (about 4.3 MB, WebAssembly) are loaded with import() the first time someone rolls in 3D, in their own chunks. Rapier needs 'wasm-unsafe-eval' in the CSP's script-src (it compiles WebAssembly; it does not allow eval of JavaScript). In development vite.config.ts lists both in optimizeDeps.include, otherwise Vite discovers them on the first roll, optimises them and reloads the page; optimizeDeps.entries is index.html so the dependency scan does not read stray .html files.
Each player chooses how their dice and coin look (Settings > «Game table» > «Dice and coins»): their own colour or the player's, the colour of the numbers, a finish (DiceFinish: plain, pearl, marble, glitter, translucent), an image of their own and the coin's metal (Metal: gold, silver, copper). It is paint only; the engine still decides every result.
- Rust keeps it (
src-tauri/src/table/dice.rs):DiceLookas JSON inapp_settings(table.dice). Colours are checked (#rrggbb, elseInvalidInputwithreason: color). The image is prepared on import (import_image: the centre square atIMAGE_SIDE= 256 px, JPEG) and stored in the blob store, protected inblob_refswithowner_kind = 'table'andowner_id = 'dice', like the mat. Commands:table_dice_get,table_dice_set { look }andtable_dice_image { path }(nullremoves it); the three returnDiceLookView { look, image }, with the image as adata:URL. Why adata:URL and notpbimg://: a WebGL texture from another origin taints the canvas and cannot be uploaded;pbimg:sends no CORS headers. - The screen loads it once (
useDiceAppearanceinappearance.ts) and turns it into aDiceStyleper roll (styleFor, withuseRollerdeciding colour and owner): your look on your own rolls, the default look with the roller's seat colour on anyone else's (online, each player will send theirs). «Player's colour» on your own rolls is the app colour (useAppColor: the theme's--primaryread as#rrggbbthrough a canvas, re-read when<html>changes theme), the same one the Settings sample shows, so solo and online games look like the sample whatever your seat. In a local game with several players (more than one seat and no network) nobody's roll is "yours": everyone shares the screen, so each player rolls with the default look and their seat colour.outline(the outline around the numbers) is dark or light depending on the number colour. -
textures.ts::backgroundCanvaspaints the face background once per style (cached): the colour plus the finish, drawn with a fixed seed so the same colour always gives the same die (marble veins in three strokes from wide and faint to thin and sharp, because WebKitGTK has no canvasfilter), or the own image, centred and cropped to a square likeobject-fit: cover(stretched, a landscape photo came out squashed on every face). With a finish each face gets a different piece of it (faceSlice); the own image goes whole on every face. The 3D draws it into its atlas; the CSS 3D and 2D use it as adata:URL (backgroundUrl). The CSS 3D (SVG) places each face's piece exactly like the 3D does: a square centred on the face, the same scale on both axes, the face radius being 46 % of its side (stretched to the polygon's box, the image was squashed on the triangles of the d4, d8 and d20). Materials per finish inscene3d.ts::material(translucent = 78 % opacity in 3D, a little transparency in CSS and 2D). - Sound (
sounds.ts): the die hit (dieHit) and the shaking of the dice in the hand (shakeDice) are real samples from Kenney's CC0 «Casino Audio» pack (samples.ts, see «Table sounds»), played with a random variant, a slightly different pitch and a volume that follows the strength of the hit; until a sample is loaded (and if it fails) the synthesised one plays, made with the Web Audio API: band-passed noise with a short «tock» of the body and a low thump of the table. The coin is always synthesised: four metallic partials that fade.physics.tsrecords every hit during the simulation (Recording.hits: frame, piece and strength, from the change of velocity minus gravity; at most one per piece every 4 frames) and the 3D plays each one when its frame is shown, so the dice sound when and as hard as they hit. The CSS 3D sounds at the two touchdowns of its animation (timeForinverts the easing curve to know when), the 2D shakes the dice and then each one lands. At most 14 hits per 100 ms, nothing with the window hidden, and the audio context resumes on the first click or key (the WebView does not play before a gesture). Sound randomness usesMath.random: it decides nothing. The sounds of the cards and the table are in «Table sounds» below.
The card sounds (shuffle, draw, turn a card, put a card into play, move it) are samples from the CC0 «Casino Audio» pack by Kenney (23 of its 50 files, converted to 16-bit stereo WAV with silences trimmed and levels matched; src/features/table/samples/, with the licence and how they were converted). samples.ts lists which files belong to each sound (SAMPLES; a test checks that every one exists), loads them lazily and decodes them with decodeAudioData: each is a separate module imported with ?inline (a data: URL), because the CSP has no connect-src 'self' and fetch cannot read the app's own files. preloadSamples (on opening the Play tab) loads those of the switches that are on; playSample plays one of the loaded variants at random, with a small pitch change, and returns false if none is ready, in which case the old synthesised sound plays. The rest are synthesised with Web Audio (no files): pass the turn, «it's your turn», a chat message or notice, and the sparring phantom's reaction. audio.ts holds the shared context (it resumes on the first click or key, nothing sounds with the window hidden, at most 14 sounds per 100 ms shared with the dice) and the helpers (envelope, random). eventSound(ev, me, active) is pure and tested: it says what sounds for a new event, and reactToEvent plays it, so the same event sounds the same online. Each sound belongs to a group (SOUND_GROUP: cards, turn, chat) with its own switch in Settings. A muted player makes no sound either. Only events that arrive as patches sound in a game; a replay, which moves by full views, plays the new events itself (see «Replay»). Sound randomness uses Math.random: it decides nothing.
The same screen and the same engine; only the way it is operated changes, and nothing in Rust or in the protocol (Action, Change, PROTOCOL are untouched). What «phone» means is decided by useFormFactor() (Mobile): below 640 px wide, or, with a finger, a short side under 600 dp, so a phone on its side (914 × 411) is a phone. The table asks useMobileTable() (table-format.ts).
One gesture per element, because holding to drag and holding for the menu cannot share a card:
| Gesture | Effect |
|---|---|
Move more than 8 px (TOUCH_DRAG_THRESHOLD; 5 px with a mouse or pen) |
Drags the card (the same pointer events as the mouse). |
| Hold still 500 ms | Opens the card's menu (the same as the right click). |
| Tap | Reads the card large. |
Double tap (300 ms, 30 px: createDoubleTap) |
What the double click does: taps on the battlefield, plays from the hand. |
| One finger on an empty spot of the field | Draws the selection box. |
| Two fingers | Move and zoom the field (below). |
«Finger» here is only pointerType === "touch". A pen goes like the mouse (hasHover in enlarge.ts treats "mouse" and "pen" as having an «over», and thresholdFor gives the 8 px only to "touch"), because a pen has hover and a native double click (table-card.tsx). Desktop with a mouse is as before: what was added for the finger only applies with touch. The zone labels («Graveyard», «Exile»…) become buttons that open the zone only with touch (a finger has no double click; with the mouse the double click on the zone opens it, as always); the large view is still entering and leaving with the mouse; and the drag threshold, the menus and the clicks of the mouse did not change.
Holding a thing that also does something when tapped (the library draws, a thumbnail switches board, a − subtracts) opens its menu and, on release, a click would follow that nobody wants: createClickAfterMenuFilter drops the first click that arrives after a menu was opened with no other touch in between.
With a mouse, reading is entering and leaving a card; a finger has no «over», so it is a tap: the tapped card stays large until another is tapped, a tap lands outside, its close button is pressed or the large card itself is tapped. The tap that closes it does nothing else: tapping the large card stops there (it is pointer-events-auto with data-closes-enlarged by touch), and after a tap outside swallowClick swallows the click that follows, because under the large card sit «Pass turn», the life buttons and the library. With the mouse the large card still catches nothing. All 11 places of the table that show the large view go through useEnlarge / enlargeHandlers (never a loose onPointerEnter), so pointing and tapping behave the same everywhere. hoverAfter is the pure rule (tested). The top card of the library has a magnifier button for the same. On a phone the large card is MobileEnlargedCard (mobile-enlarged-card.tsx, used by large-view.tsx and the ghost's ghost-preview.tsx): the whole card inside the screen, at its 63 × 88 proportion and uncropped (object-contain; GhostCardView takes contain), as large as fits, with the close button outside the card so that it never covers the title. The size is the pure function mobileEnlargedSize(width, height, horizontal, faces, withPanel) of enlarge.ts (8 px margin, 48 px kept for the X, a 176 px state panel beside the card on its side or 120 px under it upright; a double-faced card shows both faces side by side). On its side the card runs top to bottom on the opposite side to where it was tapped (towards the left or the right) and the X and the state panel (abilities, counters, power/toughness, keywords) sit next to it towards the centre; upright the card spans the width and the X and the panel go below. The hole is measured with a ResizeObserver so it follows a rotation. Why a separate component: the desktop view sizes the card by the width setting and clips it in a frame, which on a phone cut the title off and put the X on top of it. Not yet: reading large from inside the reveal, token, commander damage and end dialogs, and from the game lists (their cards are not in the store).
Two fingers move and zoom the field between 1× and 3× (MIN_ZOOM, MAX_ZOOM; the field never leaves a gap at the edge). While the fingers move only a CSS transform of the cards' layer changes (transformBetween), and on release everything is placed again with the new zoom, so a hundred cards are not repainted per frame. withView(layout, view) returns the geometry already zoomed (battlefield becomes the enlarged field, visible is the part really seen), so everything that converts engine positions to pixels and back keeps working without knowing about the zoom: never convert with the unzoomed layout's battlefield by hand. touch-action: none is set only on the board. With zoom (or while the fingers move), the cards' layer and what is painted over the field (counters, arrows, the other players' ghosts and pointers) are clipped to the visible field (Clipped in board.tsx, a clip-path from polygonOf(visible) on a layer that does not take touches), so nothing enlarged covers the zones or the hand. This zoom exists only on touch: there is no wheel, middle-button or space-bar zoom on a computer.
-
Whose turn it is, in the bar.
TurnChipgoes in two lines with the turn number and, upright,RespondButton compactshows only its icon (the name, by holding it): the whole sentence did not fit and covered the turn. -
One board at a time.
BoardLayoutModehas a sixth mode,mobile(distributeMobile): the seat being looked at gets the whole rectangle and the others get an empty one (no thumbnails are painted). It is not chosen and not remembered per number of players; a phone forces it. -
Seat bar (
mobile/seat-bar.tsx): the colour and life of each player (and the phantoms in solitaire, with only their number when there are several: «Ghost 2» does not fit that bar); tapping one shows their board. While an arrow is being chosen, it is where the target player is picked, because the phone has no thumbnails: tapping a row targets that player (choosePlayer, orchooseGhoston the phantom's row) and the eye next to it (See {name}'s board) shows their board without ending the mode, so one of their cards can be the target. The bar opens by itself during that mode even if folded, and folds back afterwards. Attaching and pinning a note only accept cards, so a tap keeps switching boards. Each row shows how many attacks point at that player or their cards (attackersOf). It folds into a single button, remembered while the app lives (folding shrinks the bar towards its top-left corner and slides it out to the left while the button grows in the same spot, and unfolding does the reverse;useExitTransition), and has «Follow the active player», which moves the view to whoever has the turn on every turn (followTurnLocal, on by default). It is screen-only: which board is shown does not change the game. When open it covers about 120 px of the field. -
«Hand» (
mobile/full-hand.tsx): the whole hand full screen, grouped by type or by cost (mobile/hand-logic.ts, 7 or more in one group); tapping a card selects it and reads it large, holding it (or its «⋯») opens its menu, and below are the most common actions (play it, discard it). It is another way of seeing the hand: what is done with it goes to Rust as always. -
Life screen (
mobile/life-screen.tsx): life, poison and commander damage full screen; − and + move by 1 on a tap and by 10 while held (TAP_STEP,LONG_STEP); several players (and the solitaire phantom) can be selected and the change goes to all. Taps are merged into one event per streak asPlayerLifedoes, and every change is the sameActionas the board's counters (mobile/life-logic.ts). With shared life (Two-Headed Giant,sharedTeam) the team is one target for life:countedTargetmaps either partner to the one in the lowest seat andcountedTargetsdrops repeats, so selecting both does not change the life twice, and both show the team's life (lifeOf). Poison and commander damage stay per player. Who is out is still the engine's call, confirmed by the person. - «Pass turn» is a round button at the top right (44 px, the height of the bar beside it: larger it ate the field), only on my turn (not during the mulligan, nor watching, nor in a replay).
-
The bar is compact on purpose (
MobileBarintable-bar.tsx). A phone on its side is only about 390 dp tall, and the board is what matters, so the bar's buttons areMOBILE_BUTTON(size-9 !min-h-9 !min-w-9, about 36 px) instead of the 2.5 rem touch minimum ofindex.css(the!is needed because that rule outweighs a plain class), with 18 px icons. On its side it is centred and may wrap, with hand, life, log and chat as buttons. Upright (about 390 dp wide) it is a single row stuck to the left, up to «Pass turn» (max-w-[calc(100%-3.5rem)], no wrap), and the hand, life, log and chat move into its «⋯» menu. The sparring button is compact (SparringButton compact: only the ghost, coloured when on, with anaria-labelthat carries the intensity). The turn text truncates before it pushes anything out. -
The life markers are smaller on a phone: the − and + are
PLUS_MINUS_MOBILE(36 px) instead of 44 px (PLUS_MINUS_TOUCH), the number istext-xland the pill has no vertical padding (player-life.tsx,ghost-life.tsx). Two 44 px markers ate the field of a phone on its side. The ghost's life sits at 52 px from the top, below the bar. -
The board's lower strip adapts (
layoutBoard(w, h, size, hasSideboard, mobile)): on an upright phone the zones at the strip's height would be wider than the screen and leave the hand no room, so the zones (and their small cards) shrink until the hand keeps half the width and the strip goes down with them (never below 90 px); the rest is field. A zone name that does not fit drops to 9 px and truncates (Zonesinboard.tsx): that applies whenever the zone is narrower than 64 px, which also happens on a small board of a 4-player grid, so neighbouring labels never overlap. -
The seats bar (
seat-bar.tsx) starts at 3 rem and ends above the hand strip (it uses the samemin(220px, max(90px, 22%))aslayoutBoard), so it does not cover the hand; folded it is a 40 px button. - Landscape. The table is played sideways: in portrait an overlay says «Rotate your phone» with «Continue in portrait» (it does not lock the orientation; the rest of the app is portrait). It is not shown during the mulligan: the opening hand reads well upright.
-
The mulligan on its side is one row (
mulligan.tsx,cardInRowofmobile/hand-logic.ts). The hand is measured in the free space left by the title and the buttons (aResizeObserver), andcardInRow(width, height, n)gives the largest card at 63 × 88 that makes allnfit side by side, never above the desktop 172 px. The title and rule take less room, the buttons are always visible, and the chosen card drops 8 px (accounted for in the height). Upright it keeps the wrapping fixed-size cards. -
«Who won?» (
dialogs/finish.tsx) on a phone on its side puts the «how» selector and the note on one row, and the footer buttons on one row too (!flex-row, becauseAdaptiveDialogstacks the footer with a rule that outweighs a plain class), so «Finish» shows without scrolling. -
The ghost's reaction is compact (
sparring/reaction.tsx,PendingReactionwithuseMobileTable()): the card small (w-14, 244 px image; tapping it opensMobileEnlargedCardlarge), the title and card name, the «why now?» reasoning folded behind a toggle («Hide why» / «Why now?») and the three answers («Resolve it», «I have an answer», «Doesn't apply») in one row. On its side it sits at the top between the seats bar (7.5 rem) and the ghost's life (13.5 rem); upright, across the width under that life. Choosing which creature to sacrifice is the same piece in both layouts (choice), with a shorter list on a phone. The desktop card is untouched. Still arole="dialog"of our own (not a Radix layer) so «back» never decides for the player. -
Dialogs and panels go full screen (
AdaptiveDialog), the log, chat and notes included. - Seat order in the local game and in the waiting room has up/down buttons for whoever cannot drag (see Online Play).
-
«Play» (the entrance) on a phone is another arrangement of the same pieces (
mobile-entry.tsx,MobileStartPanel): the decks keep the screen (the library's bar in one row,inOneRow, with «History» in its "..."; the same grid and tags sheet), and a start panel is fixed below (upright) or on the right, 20 rem wide with its own scroll (on its side). The panel keeps in view only what is needed to start: the saved game to resume, the format and the list to play (one dropdown; creating and editing lists are its last entries; on its side the list has its own row), the options button, and the four start buttons in one row, icon over text («Solo», «With friends…», «Local game…», «Online…»; the reason why «Solo» is disabled is written as text because a finger has no tooltip). Everything else (the name, life, mulligan, start-of-turn helps, the commander tax, sparring, the deck's play mat) goes to the «Game options» sheet (MenuSheet): the same fields as on the desktop, defined once (extraOptions) and drawn in either place. The choices still live inEntry(entry.tsx), so nothing is duplicated.
With a game open on a phone, the shell hides the top bar and the tab bar (shell/table-fullscreen.ts::useTableFullscreen) and the table shows its own exit button; leaveTable() goes back to the previous screen and the game stays open and saved, as with changing tabs (the bar's exit button is what closes it). On Android there is no full-screen button: the whole app is always full screen (the activity hides the system bars, see Mobile), so the bar's button and its menu entry exist only off Android (useIsMobile()); the earlier toggle that called app_fullscreen from the bar is gone (the command stays registered). The screen stays on while a table is open (table_subscribe on, table_leave off; a failure is only logged; not checked: that it is restored if the session closes without table_leave).
Back (lib/back.ts, registered by table-screen.tsx): first the open Radix layers (dialogs, menus, the hand, the life screen, the log; only those with data-state="open", so the sparring reaction, where Escape decides, is never answered by «back»; the Escape goes to the focused element so the table's shortcuts do not also drop the selection); then what is being read, a phantom being chosen or a target mode; and finally the «Leave the game?» question (the game is kept), as the bar's button does, or leaving the replay.
defaultTablePrefs(touch) starts a touch device with shadows off and dice in light CSS 3D (dice: "css"), which hold up on modest hardware better than physics 3D, and the preview thumbnail at 244 (defaultPreviewQuality); whatever the person saved wins. The global CSS also raises inputs, selects and menu rows to 2.5 rem on touch (the table's bar and life markers go below it on purpose, above).
The touch minimum of index.css (2.5 rem) applies to every Button and to every button inside WithTooltip. On the table that rule breaks small pieces, so:
- Nothing with a tooltip goes over a card. The library's «eye-off» used to grow to 43 px over a 48 px card, covering it and the magnifier. It is now mouse-only and only on the owner's library; by touch that action is in the long-press menu.
-
A small button that must stay small says so (
!min-h-* !min-w-*): the large card's X on a tablet (large-view.tsx,ghost-preview.tsx), «Respond» in the phone bar (RespondButtontakes aclassName), the bar tab. -
Badges go inside a
relativebutton and arepointer-events-none: the unread count of the bar used to sit at the bar's corner, on top of «⋯», and opened the chat. - A sticking-out button must not be covered by a neighbour: the only selected card rises by 1000 by touch (still under the hand curtain, 5000), so its «⋯» is not under the next card of the hand fan.
-
Every floating panel on a phone folds: free notes, the planar and Archenemy panels (
PanelHeader) and each disconnected-player notice (it reopens by itself when it is your turn to skip theirs). -
Nothing is double-click only: mana markers are removed with a double tap (
createDoubleTap) as well. -
Every card in a dialog can be read large: the revealed cards of «Reveal» use
enlargeHandlers.
There: everything the table does, with the gestures above. Not there or not measured: the zoom with the wheel/middle button/space on a computer (not implemented), a dedicated full-screen game-settings dialog, a measurement of performance on a real phone, and the touch gestures have been tried in a headless browser with touch emulation (914 × 411) and a simulated Tauri, not on Android or WebKitGTK, nor with real images. Inferred: the animation load of ten boards is not a problem because only one is painted.
src/features/settings/table.tsx edits useUi().table (TablePreferences), saved in localStorage with the other preferences (proxybuilder.preferencias, key table) and merged over DEFAULT_TABLE_PREFS on read, so a new setting gets its default. Preferences saved by 4.1, with Spanish names (key mesa), are read by lib/stored-prefs.ts and written back with the English ones.
| Setting | Field | Default |
|---|---|---|
| Offer the bonus of auras and equipment when attaching | offerBonus |
on |
| Sparring when starting a solitaire game | sparring |
off |
| The sparring explanation was already shown | sparringSeen |
off |
| Show the phantom's life in solitaire | ghost |
on |
| Holding the button opens the card menu | holdToOpenMenu |
off |
| Size of battlefield cards | cardSize |
100 % (25–200) |
| Size of the large view | largeView |
320 px (200–500) |
| Status panel next to the large view | statusPanel |
on |
| Quality of battlefield images | quality |
244 (146 low, 488 high) |
| Dice and coins (Automatic, 3D with physics, Light 3D, 2D) | dice |
auto (light 3D, css, on a touch device) |
Look of the dice and coin (dice-look.tsx, with a sample rolled by «Try it» as on the table: LiveRoll) |
table.dice in Rust (app_settings) |
player's colour, white numbers, plain, gold |
| Dice and coin sound | diceSounds |
on |
| Card sounds (shuffle, draw, turn, play) | cardSounds |
on |
| Turn sounds (pass, your turn) | turnSounds |
on |
| Chat sounds (messages, notices, phantom) | chatSounds |
on |
| Volume | volume |
60 % |
| Reduce animations | reduceMotion |
off |
| Shadows | shadows |
on (off on a touch device) |
| 3D effect: dragged cards lift off and your hand has depth | effect3d |
off |
| 3D effect depth (Soft, Medium, Strong, Extreme) | intensity3d |
medium |
| Frame counter | fps |
off |
| Player counters shown next to life | trackers |
none (chosen from the life menu) |
| Online: see how the others move and show them my cursor | liveMovement |
on |
| Follow the player whose turn it is, on the phone («Follow the active player») |
followTurnLocal (4.1 called it seguirTurnoLocal, renamed from seguirTurno then so everyone got the new default) |
on |
| Follow the player whose turn it is, on desktop and tablet | followTurnDesktop |
off |
| Table bar hidden | barHidden |
off |
| Wheel when drawing who goes first (only with several players) | startingRoulette |
on |
How the boards are laid out (per number of players: single, split, focus, grid, teams) |
boardLayouts |
none stored: split with 2, focus with more |
«Performance mode (everything at minimum)» sets PERFORMANCE_MODE: quality 146, no shadows, no 3D effect, reduced animations, no status panel.
- Patches, not views: Rust sends only touched cards and zones, and the store keeps the identity of everything else;
TableCardViewismemoand subscribes to its own id. - Selectors never return a fresh empty array (
NONE) or a fresh list withoutuseShallow, because zustand would see a change on every read and repaint (or loop). The same goes for lists made withObject.entries(...)or.map(...):useShallowcompares elements by identity, so a list of fresh[key, value]tuples is never equal and React stops with «Maximum update depth exceeded» (#185). Select the store record (same reference while it does not change) and derive the list withuseMemo, aslive/ghosts.tsxdoes for other players' cursors and dragged cards. - Images are prepared once at their final size (and the board widths reduced in advance, see «Where the images live») and requested at the width they are drawn at, with
decoding="async"and withoutloading="lazy": in WebKitGTK lazy loading delays images inside boxes that move, and cards showed up late.card-image.tsxgives the<img>a dark background (bg-slate-900) that keeps the card's shape while it loads; if a URL fails it paints the generic back with the card's name instead (GenericCardBack, never a hole) and tries again after 4 s (RETRY_MS; online the host may not have had the image yet). -
Opening the table without cards popping in. The first full view (the table not active yet) is held until its images are decoded (
preload.ts::preload, at most 1.5 s,PRELOAD_WAIT_MS):urlsToPreloadlists the visible faces (battlefield, hand, top of each zone), the backs and the mats at the widths the board asks for; whatever is late keeps loading and comes in afterwards. Meanwhileconnection.tsqueues every later message (queued) and applies it in order once the view is shown, so a patch never overtakes its view. -
No slide from the corner.
board.tsxmeasures the board in auseLayoutEffect, before the first paint, and draws nothing while its size is 0 × 0; before, the first frame laid the cards out on an empty board and they all slid in from the top-left corner. -
No slide while resizing. While the board changes size (window, the divider between boards, a side panel)
useScreen.resizingis on (until 200 ms after the last change, from the board'sResizeObserver), andTableCardViewdrops its position transition and FLIP, so cards go straight to their new place instead of lagging behind and seeming to shake. - With 3D dice, three.js and Rapier are imported in idle time after opening the table (
dice/layer.tsx,requestIdleCallbackor 1.5 s), so the first roll does not wait for them. -
fps.tsx:FpsCounter(setting) shows frames per second.FpsWatchermeasures every second and, after 120 consecutive seconds under 30 fps (a hidden window does not count), offers «Lower the quality» once, unless everything is already at the minimum. Animations are skipped when the setting or the system (prefers-reduced-motion) asks for it (useNoAnimations).
- Cards known to the viewer travel with their image; hidden ones carry only their back (
visibleFacefalls back to the card's back). Looking at the library top (scry) does not show it face up on the table; only «play with the top revealed» does. - A selected or hovered card that disappears in a patch (or is missing from a new full view) is dropped from the screen state, so a later shortcut never acts on a card that is gone. A full view that brings a log (undo, restart) always clears the hovered card, because ids are reused across those.
- Dropping cards on the zone they came from does nothing (except the library and the battlefield), so the hand cannot be reordered by dragging.
-
src-tauri/src/table/sample.rsis an ignored test that creates an example deck of designed cards without network, to try the table and take screenshots on a machine without Scryfall (PB_DATOS=… PB_CACHE=… cargo test --lib sample_deck -- --ignored).
- Rust:
table::session::tests(50 random actions give the same view by patches as in full, a rejection arrives with its reason, restart deals again with the same list, an open game makes the app busy),table::saved_game::tests,table::setup::tests(three cards give three images and the second time none),protocol::tests::table_routes_parse. - Engine fixture:
src-tauri/crates/table_engine/tests/fixtures.rswritessrc/stores/__tests__/fixtures/table-patches.json(a first view, 60 patches and the final view; rewritten withPB_FIXTURES=1 cargo test -p table_engine --test fixtures).src/stores/__tests__/table-store.test.tsapplies them and must reach the final view; it also checks version jumps, object identity, selection cleanup and that a view with a log replaces it while one without keeps it.tests/log.rsof the engine checksin_effect(). The fixtures folder is excluded from Biome. - Lists:
table_engine::listtests,tests/setup.rs::with_a_list_only_chosen_cards_go,store/game_lists.rs(save, read, replace, delete, gone with the deck),table/setup.rs::designed_card_knows_if_it_can_be_commander,package.rs::game_lists_travel_with_new_ids,src/features/table/lists/__tests__/choice.test.ts. - Dice:
src/features/table/dice/__tests__/geometry.test.ts(faces, opposite sums, reading, label swap, the d4 corners, the d100, no mirrored faces) andphysics.test.ts(the same seed gives the same recording and the same hits; hits are in order with strength 0–1; 300 rolls stop in time, stay on the table and read the engine's face);table::dice::testsin Rust (default look, colours checked, the image prepared square and protected, a missing image refused) andtable::playmat::tests. - Screen:
src/features/table/__tests__/(drag.test.tsgeometry and drop targets,shortcuts.test.ts,search.test.ts,pt.test.ts,depth.test.tsfor the tilt cap and the spring),src/lib/__tests__/errors.test.ts(rejection reasons),src/lib/__tests__/close-guard.test.ts,src/stores/__tests__/ui-store.test.ts(table settings merged with defaults). - Several players:
src/features/table/__tests__/(board-layout.test.tsfor every mode andn= 1…10,mini-board.test.ts,local-config.test.ts,teams.test.ts,commander-damage.test.ts,planar.test.ts,matches.test.ts,death-logic.test.ts,limiter.test.ts); in the enginetests/{teams,formats,turns,matches,death}.rs;table::session::tests(changing who is shown in a local game, refused online). - End, history and replay:
crates/table_engine/tests/summary.rs(places, ties, teams, conceding, an unfinished game);store::games::tests(save and read a deck's games, a deck in two seats counts once, ending again replaces, delete, playing does not change the deck's date, an old database goes from 5 to 6);table::history::tests(an unfinished game is not stored, a finished one carries its record, a guest that followed the game from the mulligan stores the whole replay with the host's fingerprint);table::replay::tests(every point has the fingerprint it had when played, one milestone per turn, no playing during a replay, viewing as a player or everyone); on the screen, insrc/features/table/__tests__/,game-end-logic.test.ts,log.test.ts(log-logic),replay-logic.test.ts,chat.test.ts(chat-logic),history-logic.test.tsandsounds.test.ts.
- A new action on the screen: add it to the engine first (Game Engine), run
pnpm bindings, add its operation inoperations.ts, its menu item and, if it has one, its key inSHORTCUTS, and its sentence inevent-texts.ts::PHRASES(theRecord<Action["type"], string>type makes a missing one fail to compile). - A new action's category in the log:
event-categories.ts::ACTION_CATEGORIES(a missing one fails to compile) and, if it should sound,eventSound. - A new rejection reason: its text in
errors.ts::REASONS.Rejected. - A new die or piece: its solid in
geometry.ts(with the tests of faces and orientation), its piece inqueue.ts/pieces.tsand its silhouette inflat.tsx::SILHOUETTES. - A new setting:
TablePreferencesandDEFAULT_TABLE_PREFSinui-store.ts, thenfeatures/settings/table.tsx. - A new layout: a
BoardLayoutModeinboard-layout.tswith its case indistributeand its test of no overlap forn= 1…10; the thumbnails aremini-board.tsxand never become interactive. - A new format rule (who is the opponent, team life, turn order, who is out): in the engine, with its test in
tests/; the screen only paints whatTableViewsays. - New text: through
t()with the English source in thetablearea of the 15 dictionaries (src/i18n/<code>/table.json), with the game terms of the «Game table terms» table insrc/i18n/GLOSSARY.md(Internationalization).
Use and build · Uso y desarrollo
- User-Guide · Guía de usuario
- Development-Setup · Preparación del entorno de desarrollo
- Testing-and-CI · Tests y CI
- Releases-and-Auto-Updates · Versiones y actualizaciones automáticas
- Conventions · Convenciones
- Rename-to-Tapete · Cambio de nombre a Tapete
- License · Licencia
Architecture · Arquitectura
- Architecture · Arquitectura
- IPC-and-Error-Handling · IPC y manejo de errores
- Rust-App-Layer · Capa de aplicación Rust
Data · Datos
- Deck-Model · Modelo del mazo
- Storage-and-Blobs · Almacenamiento y blobs
- Deck-Package-Format · Formato del paquete de mazo
- Deck-Library · Biblioteca de mazos
Getting cards · Conseguir cartas
- Decklist-Parsing · Parseo de la lista del mazo
- Scryfall-Integration · Integración con Scryfall
- External-Sources · Fuentes externas
- Card-Identification-and-OCR · Identificación de cartas y OCR
- Identify-From-a-Photo · Identificar por foto
Layout, images, PDF · Maquetación, imagen y PDF
- Layout-Engine · Motor de maquetación
- Imaging-and-PDF · Imagen y PDF
- Export · Exportación
- The-Card-Stamp · El sello de las cartas
- Live-Preview · Vista previa en vivo
- Statistics · Estadísticas
Card designer · Diseñador de cartas
- Designer-Overview · Visión general del diseñador
- Designer-Engine · Motor del diseñador
- Designer-Composition · Composición del diseñador
- Frame-Packs · Packs de marcos
- Designer-App-Layer · Capa de aplicación del diseñador
- Designer-UI · Interfaz del diseñador
- Card-Editor-Dialog · Diálogo Editar carta
Game table · Mesa de juego
- Game-Engine · Motor de la mesa
- Game-Table · Mesa de juego
- Online-Play · Juego en línea
- Friends-and-Messages · Amigos y mensajes
Mobile · Móvil
Frontend · Frontend
- Frontend-Architecture · Arquitectura del frontend
- State-Stores · Stores de estado
- Internationalization · Internacionalización
- Themes-and-Skins · Temas y skins
- Icons · Iconos
- Settings-and-Shell · Ajustes y shell
- Tutorials · Tutoriales
- Decklist-Panel · Panel de la lista del mazo
- Add-Card-and-Variants · Añadir carta y variantes
- Card-Search · Búsqueda de cartas
- Set-Browser · Explorador de sets
Reference · Referencia