Version Packages - #78
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to master, this PR will be updated.
Releases
@cockatrice/datatrice@4.4.0
Minor Changes
4396583: State-layer support for the UI revamp: optimistic card moves, a segmented Cockatrice-parity message log, reveal/peek plumbing, private-chat selectors, and a batch of reducer fixes. Unit test coverage is now ~90%.
Optimistic mutations. New
store/games/optimistic.tsregistry (beginOptimistic/isOptimisticPending/consumeOptimistic/rollbackOptimistic, key buildersmoveOpKey/attrOpKey). ThecardMovedlistener consumes matching pending ops so the server echo of a cross-zone move is not double-applied, reconciles server-corrected positions/ids (a cross-player table-to-table move migrates the optimistic entry to the server's new card id, preserving client-tracked fields like the owner annotation), and the wire layer rolls back on command error.Segmented message log. Every
messageLog.tsformatter now returns aLogEntry { text, segments }(segment kindsplain/player/card/number) so the UI can style tokens individually, andclassifyLogTonebuckets lines intophase/turn/system/actionfor color-coding. Log wording is rewritten to Cockatrice-desktop parity (move lines with from-clauses and per-zone phrasing, "turns … face-down", counter totals as "now", coin-flip wording for 2-sided dice, P/T changes reported "from OLD to NEW", possessive arrow lines, translated counter names). New formatters:formatCardsRevealed,formatCardPeeked,formatCardUndoneDraw.gameMessageAppendedacceptsstring | LogEntry.Reveal / zone-view plumbing. A new
cardsRevealedlistener detects Servatrice auto-top-reveals (suppressing chat spam and the dialog, tracking a persistenttopRevealedCardper zone), logs peeks per card, and dispatches a newincomingRevealstate slot (+getIncomingRevealselector) when another player reveals cards to you. Reversed (bottom-N) library views now index correctly (zoneViewRevealedcarriesisReversed; reveal ids offset bycardCount − N), hidden bottom-view drags reorder within the snapshot, and a cross-zone move into a viewed zone inserts into it (zoneViewCardInserted).PlayerEntrygainsdrawSeq/lastDrawCount(draw beacon), with adrawBeaconBumpedaction.New server selectors for the revamped UI:
getPrivateMessagesForUser(conversations keyed by the other user's name — backs private chats),getIsUserAdmin,getBanHistoryByUser,getWarnHistoryByUser,getAdminNotesByUser.Fixes.
resetCardStategains a keep-annotations carve-out); all other non-table zones still clear it.cardMovedcarriesisUndoDraw, detected from the event context) instead of being swallowed by the hidden-card early return.Note:
zoneViewRevealed(action payload andGameResponseImplbridge method) gains a requiredisReversedargument, andcardMovedan optionalisUndoDraw.@cockatrice/sockatrice@4.2.0
Minor Changes
4396583: Protocol-layer additions for the UI revamp: a heterogeneous bulk counter command, per-command options plumbing, undo-draw detection, reversed zone-view support, and a sanitizer robustness fix.
request.game.bulkSetCardCounterEntries(+ exportedCardCounterEntrytype): batches per-cardCommand_SetCardCounterentries with heterogeneous(cardId, counterId, counterValue)values into a singleCommandContainer, judge-wrapped per card owner — unlikebulkSetCardCounter, which applies one value to every target. Backs the "increment all card counters" context-menu action (CockatriceactIncrementAllCardCountersparity).moveCard,setCardAttr,incCardCounter,setCardCounter,incCounter,setCounter,setActivePhase, andcreateArrowgain a trailing optionaloptionsparameter (spread intosendGameCommand), so callers can attach command options — e.g. grouping actions into one undo step — that previously had no way through. Backward-compatible.moveCardevent handler inspects the event context forContext_UndoDraw_extand passes a new optionalisUndoDrawflag toIGameResponse.cardMoved, letting consumers log "undoes their last draw" instead of a generic move.dumpZonenow forwards the request'sisReversedflag into thezoneViewRevealedresponse callback (new required parameter onIGameResponse.zoneViewRevealed), so bottom-N library views preserve their ordering direction.sanitizeHtmlno longer breaks when imported before awindowexists (worker / test import order). DOMPurify is now created lazily and memoized on first use, the link hook (target="_blank"+rel="noopener noreferrer") registers defensively, and if no real instance is available the input is returned unmodified rather than throwing.@cockatrice/webatrice@5.0.0
Major Changes
4396583: Ground-up UI revamp ("sonic"): a new visual system, a rewritten game board and navigation, plus a full deck editor, private chats, in-game context menus, and a greatly expanded shortcut system.
New styling engine and theme. MUI's
ThemeProvider/CssBaselineandmaterial-theme.tsare gone; Tailwind CSS 3.4 (+ PostCSS/autoprefixer) provides the styling layer, with a dark purple design-token palette (styles/tokens.cssmapped to Tailwind utilities) andlucide-reacticonography. The MUI components still in use are reskinned viastyles/mui-overrides.css;InputField,CheckboxField, andToastare now custom Tailwind components. The app is dark-only.Tabbed top navigation. A new browser-style
TopBarderives tabs from route + store state: a pinned Lobby tab plus tabs for joined rooms, active games, the open deck, shortcuts, and player chats. Closing a room/game tab sends the leave command; deck/shortcut/player tabs are sticky so open work survives navigation. An F5 refresh restores the last route via localStorage (MemoryRouter has no URL bar).Game board rewrite. The right-sidebar architecture (
RightPanel,CardPreview,GameLog,PhaseBar,TurnControls) is deleted, replaced by thePlayerBoxcomponent tree with aBattlefieldSidebarright rail (hovered-card preview, player list, chat), aPhaseTrack, a rewritten arrow overlay, and a new pre-gameGameLobby(deck picking from.cod, ready/host controls, spectators). The chat log renders datatrice's new segmented log entries with per-token styling and tone-based coloring. New in-game affordances: drag drop hints (the target snap cell highlights during a drag, scoped to the board you're over), an optional snap-grid overlay toggle, battlefield card transform/flip-face support,ZoneRevealDialog/IncomingRevealDialog/LibrarySearchDialog, and a middle-click big-card zoom.In-game context menus. A portal-based
ContextMenu(dividers, checkable items, shortcut hints, nested submenus) is wired across cards, the battlefield/library/graveyard/hand/exile zones, player seats, and the player list — card actions, move-to-zone, counters, P/T, flip, clone, peek, attach, and moderation/seat actions.Full deck editor.
features/decksis net-new (the previous page was a stub): a card-search editor backed by Scryfall (read-through Dexie cache, newscryfallCachetable in DB v4),.codXML parse/serialize with autosave to servatrice, mana-curve/type/color breakdowns, printings, pricing with TCGplayer buy links, Commander bracket assessment, import from decklist text, and an export modal. Decks are cached in-memory across tab switches; the My Decks card/list view mode persists to localStorage. The deck route is now/deck/:deckId(was/deck).Related cards.
CardRelatedLinksshows a card's other faces, tokens, meld pieces, and combo pieces (from Scryfallcard_faces/all_parts) in the right-rail preview, the big-card zoom, and the deck editor's card detail modal — with add-to-deck affordances where applicable.Private chats. The player profile page is now a two-column layout with a private-chat panel driven by
Command_Message/Event_UserMessage. Chats open from a right-clickUserActionsMenuon any username (chat messages, player lists); open conversations persist as sticky TopBar tabs, and a globalPrivateMessageNotifierpops a toast for new inbound messages (suppressed while viewing that sender).Keyboard shortcuts. Default game shortcuts grow from 16 to 71 actions, mirroring Cockatrice desktop where browser-safe (untap-all is
Ctrl+U, not F5; other Chromium-reserved keys rebound). Coverage spans phases/turn, draw/mulligan, zone views, P/T deltas, card counters, selection, clone/flip/peek/attach, arrows, tokens, and deck-editor/room bindings. A new/shortcutspage (from the account menu) shows visual keycaps.Fixes from play-testing: battlefield drag/move correctness backed by datatrice's new optimistic-move handling (no flicker/revert), big-card preview rework,
.cod/decklist parser hardening (cards without UUIDs still resolve and price), Chrome autofill styling, and reveal/search dialog behavior.Breaking changes: the deck editor route moved to
/deck/:deckId; the light MUI theme is gone (dark purple only); the in-game right-sidebar layout is replaced wholesale; several shortcuts differ from Cockatrice desktop; the deck editor calls Scryfall and links to TCGplayer.Patch Changes