Android: the lists dressed up (docs/design/android-lists.md)
Some checks are pending
CI / check (push) Waiting to run
CI / windows-build (push) Waiting to run
CI / macos-build (push) Waiting to run

The owner approved the designer's «А» for the games list and «Б» for the
databases screen:
- Games: a thin line between games, a disc of each side, the winner's «1»
  on a tile (and the name a little heavier), «½» on quieter tiles, the ECO
  on its own tag that never gives way; the game last opened marked and in
  sight; search matches marked, the ECO tag too. Search finds by the ECO.
- Databases: badges by kind in Catppuccin colours (Mocha dark, Latte light:
  PGN blue, ChessBase peach, archives mauve, online teal, own green, ♞ for the
  player's); the number of games stands out; groups as cards (16/4 dp
  corners, 2 dp apart); the game put aside with its position on a small board
  (no coordinates) and «Continue»; two equal, quiet buttons.
- Settings as cards with icons; the add sheet's icons in tiles of the kind.
- Fixed on the way (the tester): a list read anew after a quick new search
  could show another game's names in a row; clearing a search goes back to
  the top; tiles, tags and buttons grow with a large font.

Reviewed by the designer and the tester on the emulator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
vrubelroman 2026-10-26 19:29:04 +03:00
parent 95572c530b
commit f120c49fd4
22 changed files with 813 additions and 131 deletions

View file

@ -317,8 +317,8 @@ impl Database {
.collect()
}
/// The numbers of the games whose players, event, site or date contain every word
/// of `text` (case does not matter); all games for an empty text.
/// The numbers of the games whose players, event, site, date or opening code (ECO)
/// contain every word of `text` (case does not matter); all games for an empty text.
pub fn find(&self, text: String) -> Vec<u32> {
let Some(pgn) = self.db.as_pgn() else {
return Vec::new();
@ -328,7 +328,7 @@ impl Database {
.iter()
.filter(|e| {
words.is_empty() || {
let hay = ["White", "Black", "Event", "Site", "Date"]
let hay = ["White", "Black", "Event", "Site", "Date", "ECO"]
.iter()
.filter_map(|t| e.tag(t))
.collect::<Vec<_>>()
@ -626,6 +626,10 @@ mod tests {
.all(|r| r.white.contains("Morphy") || r.black.contains("Morphy"))
);
assert!(db.find("no such player anywhere".into()).is_empty());
// By the opening code too: the Opera game is a Philidor (C41).
let c41 = db.find("c41".into());
assert!(!c41.is_empty());
assert!(db.rows_of(c41).iter().all(|r| r.eco == "C41"));
}
#[test]