Merge views into Match, expand history, and polish the UI
- Match page now holds players/match info, turn stats with a turn picker, and the deck lists (My deck · Preview · Opponent); the Deck and Turn tabs are gone. Section heights are draggable and remembered. - History: sortable, resizable columns; deck and commander columns; right-click to show only or hide games with a value, with filter chips; stats tiles (win rate overall, last 10/100, last 7 days, play/draw, average length and turns) that follow the filters. Commanders are backfilled for games recorded before they were stored. - Deck panel shows copies per zone against the deck total (e.g. 2/5). - Preview can be cleared with ✕, a click on the image, or Esc. - Customize menu stays open while toggling; Arrange covers deck sections and turn stats together. - Fix squeezed nav buttons and the header pushing controls off-screen. - Fix known opponent cards being double-counted when also revealed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5b3c8c8e63
commit
b3325e8ecc
15 files changed
+760
-183
No files matched your search
@@ -65,3 +65,36 @@ def test_recorder_ignores_unfinished_match(tmp_path):
|
||||
t.handle(ev)
|
||||
rec.observe(ev, t)
|
||||
assert store.games() == []
|
||||
|
||||
|
||||
def test_old_database_is_upgraded_and_backfilled(tmp_path):
|
||||
import sqlite3
|
||||
path = tmp_path / "old.db"
|
||||
store = HistoryStore(path)
|
||||
import_log(FIXTURE, store, None)
|
||||
# Simulate a database from before commanders were stored.
|
||||
conn = sqlite3.connect(path)
|
||||
conn.execute("UPDATE games SET my_commander = NULL, opp_commander = NULL")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
store = HistoryStore(path)
|
||||
assert all(g.my_commander is None for g in store.games())
|
||||
assert store.backfill_commanders(None) == 2
|
||||
assert all(g.my_commander == "" and g.opp_commander == "" for g in store.games()) # not a Brawl match
|
||||
assert store.backfill_commanders(None) == 0
|
||||
|
||||
|
||||
def test_schema_without_commander_columns_gets_them(tmp_path):
|
||||
import sqlite3
|
||||
path = tmp_path / "v1.db"
|
||||
conn = sqlite3.connect(path)
|
||||
conn.executescript("""CREATE TABLE games (match_id TEXT NOT NULL, game_number INTEGER NOT NULL,
|
||||
started_ms INTEGER, ended_ms INTEGER, event_id TEXT, opponent TEXT, deck_name TEXT, on_play TEXT,
|
||||
result TEXT, my_colors TEXT, opp_colors TEXT, turns INTEGER, best_of INTEGER,
|
||||
PRIMARY KEY (match_id, game_number));
|
||||
INSERT INTO games VALUES ('m1', 1, 1, 2, 'Ladder', 'Opp', 'Deck', 'me', 'Won', 'U', 'R', 5, 1);""")
|
||||
conn.commit()
|
||||
conn.close()
|
||||
games = HistoryStore(path).games()
|
||||
assert len(games) == 1 and games[0].deck_name == "Deck" and games[0].my_commander is None
|
||||
Reference in new issue
Block a user