Spare/rarity filters, owned-only suggestions, and a Game night tab
Library filters: - "Only spare copies" quick filter (Library): cards with more copies owned than the decks' main boards use, the opposite of the ⚠ over-assignment warning. Rows show "N spare" while it's on. - Rarity toggles (C/U/R/M) in the shared criteria panel, so Library, Card Search and the set browser all get them. Any printing counts, since the library tracks cards rather than printings; within a set it's that set's printing. Arena-only printings don't count for a card that also exists on paper, so a digital re-rarity can't make a paper common read as rare. Suggestions: - "From my collection" toggle (remembered) narrows candidates to owned cards before scoring and paging, so "Suggest more" keeps finding them. - Each suggestion reports copies other decks already use, shown as "N spare" / "all in other decks". suggest_cards now takes a SuggestOptions struct instead of a bare `unusual` flag. Game tab: a life counter for 2-6 players with tap/hold ±1/±10, a running change bubble, poison and per-opponent commander damage (which also comes off life), out-of-the-game markers, dice and a coin, and a random first player. A seat's deck puts its commander's art behind the life total. On phones the board fills the screen with the far row turned to face across the table, and asks to keep the screen awake. The game is per-device scratch state in localStorage, not synced. Plain filter chips now show an accent background when active; before, "Unusual picks" only changed its text colour.
This commit is contained in:
11
src/api.ts
11
src/api.ts
@@ -80,6 +80,8 @@ export interface SynergyReason {
|
||||
export interface CardSuggestion {
|
||||
card: CardRef;
|
||||
quantity_owned: number;
|
||||
/** Copies other decks' main boards already use. */
|
||||
quantity_assigned: number;
|
||||
score: number;
|
||||
reasons: SynergyReason[];
|
||||
edhrec_rank: number | null;
|
||||
@@ -133,6 +135,11 @@ export interface LibraryFilter {
|
||||
/** Only cards with zero owned copies. Only honored by `searchReference`
|
||||
* (`searchLibrary` already returns owned cards exclusively). */
|
||||
not_owned?: boolean;
|
||||
/** Only cards with more copies owned than the decks' main boards use. */
|
||||
spares_only?: boolean;
|
||||
/** Only cards printed at any of these rarities ("common", "uncommon",
|
||||
* "rare", "mythic"). Any printing counts; with `set_code`, that set's. */
|
||||
rarities?: string[];
|
||||
}
|
||||
|
||||
export interface Status {
|
||||
@@ -396,8 +403,8 @@ export const api = {
|
||||
isMaybeboard = false,
|
||||
) => invoke<void>("set_deck_card", { deckId, oracleId, quantity, isCommander, isMaybeboard }),
|
||||
deckContents: (deckId: number) => invoke<DeckEntry[]>("deck_contents", { deckId }),
|
||||
suggestCards: (deckId: number, offset = 0, unusual = false) =>
|
||||
invoke<CardSuggestion[]>("suggest_cards", { deckId, offset, unusual }),
|
||||
suggestCards: (deckId: number, offset = 0, options: { unusual?: boolean; owned_only?: boolean } = {}) =>
|
||||
invoke<CardSuggestion[]>("suggest_cards", { deckId, offset, options }),
|
||||
cardDecks: (oracleId: string) => invoke<Deck[]>("card_decks", { oracleId }),
|
||||
|
||||
exportDeck: (deckId: number, path: string) => invoke<void>("export_deck", { deckId, path }),
|
||||
|
||||
Reference in New Issue
Block a user