Add deck synergy suggestions, a responsive deck layout, and undoable library bulk-add
Suggestion scoring is fully offline (tribal/mechanic/archetype/mana-base signals derived at ingest, no external synergy database), with an "unusual picks" mode that surfaces underappreciated cards instead of staples. The deck page's top panels now use a CSS grid so wide windows don't waste horizontal space. Library's bulk add-to-deck can clobber existing deck quantities, so it now offers an undo (snackbar + command palette, the latter with no timeout) that restores each card's prior state exactly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
15
src/api.ts
15
src/api.ts
@@ -52,6 +52,19 @@ export interface LibraryImportResult {
|
||||
unresolved: string[];
|
||||
}
|
||||
|
||||
export interface SynergyReason {
|
||||
category: string; // "Tribal" | "Mechanic" | "Archetype" | "Mana base"
|
||||
detail: string;
|
||||
}
|
||||
|
||||
export interface CardSuggestion {
|
||||
card: CardRef;
|
||||
quantity_owned: number;
|
||||
score: number;
|
||||
reasons: SynergyReason[];
|
||||
edhrec_rank: number | null;
|
||||
}
|
||||
|
||||
export interface LibraryFilter {
|
||||
text?: string | null;
|
||||
colors_exact?: number | null;
|
||||
@@ -186,6 +199,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 }),
|
||||
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