Add deck analysis panel with mana production/consumption bars and oracle text search

Threads a new produced_mana/produces_colorless field through the whole card
read path (ingest, library, filters, decks, search) so the deck view can
show what colors a deck's manabase actually produces, alongside its existing
color identity. Also adds a mana consumption bar (colored casting costs of
nonland spells) and stacks the mana curve histogram by color. Adds an
oracle-text substring filter to the library search, mirroring the existing
location filter. Rearranges the deck sidebar list into two rows (name, then
format chip + actions) so long names and action buttons no longer collide,
and removes the drop shadows from the commander hero panel/image.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 23:54:47 -05:00
parent 4ac536caa2
commit e3f8a299de
17 changed files with 1054 additions and 161 deletions

View File

@@ -5,7 +5,7 @@
use std::path::PathBuf;
use std::sync::Mutex;
use mtgc_core::{CardRef, Deck, DeckEntry, LibraryCard, LibraryFilter, LibraryStats};
use mtgc_core::{CardRef, Deck, DeckEntry, LibraryCard, LibraryFacets, LibraryFilter, LibraryStats};
use serde::Serialize;
use tauri::{AppHandle, Emitter, State};
@@ -142,6 +142,12 @@ pub fn get_library_stats(db: Db) -> Res<LibraryStats> {
s.catalog()?.library_stats().map_err(|e| e.to_string())
}
#[tauri::command]
pub fn get_library_facets(db: Db) -> Res<LibraryFacets> {
let s = db.lock().unwrap();
s.catalog()?.library_facets().map_err(|e| e.to_string())
}
#[tauri::command]
pub fn list_decks(db: Db) -> Res<Vec<Deck>> {
let s = db.lock().unwrap();

View File

@@ -31,6 +31,7 @@ pub fn run() {
commands::set_location,
commands::search_library,
commands::get_library_stats,
commands::get_library_facets,
commands::list_decks,
commands::create_deck,
commands::delete_deck,