Repository navigation
Card Search
English · Español
The Search screen (src/features/buscar/) looks up any card with no deck involved: a name or Scryfall syntax, filters, sorted results and a details page. Adding to the deck is one button at the end, not the point of the screen; that is why it is a screen of its own and not a variation of the Add card dialog.
| File | Responsibility |
|---|---|
src-tauri/src/commands/buscar.rs |
cartas_buscar, carta_ficha, carta_aclaraciones; builds the query (consulta, parametros) and the details (ficha_de), with tests. |
src-tauri/src/scryfall/client.rs |
Scryfall::buscar_pagina, Scryfall::aclaraciones. |
src/stores/busqueda-store.ts |
useBusqueda: filters, results, page, open card. A store because changing tab unmounts the screen and the search must still be there on return. |
src/features/buscar/buscar-screen.tsx |
The screen: field with suggestions, filters (side panel on desktop, HojaMenu otherwise), sort bar and results. |
src/features/buscar/filtros-panel.tsx |
The filter controls. |
src/features/buscar/ficha-carta.tsx |
The details dialog (DialogoAdaptable). |
src/features/buscar/simbolos-mana.tsx |
Mana symbols drawn in CSS inside rules text and costs. |
src/features/buscar/consulta.ts |
The pure part: factory filters, hayCriterio, cuantosFiltros, claveDeFiltros, partirSimbolos, with tests. |
It reuses RejillaCartas and useSugerencias from features/variants/ and traerCarta to add a card.
The query is built in Rust, as all heavy work is. FiltrosCartas carries what the screen asked for:
flowchart LR
P[FiltrosCartas] --> C[consulta: the q parameter]
P --> X[parametros: order, dir, unique, include_multilingual]
C --> S[/cards/search + page/]
X --> S
S --> R[PaginaCartas: cartas, total, hayMas]
-
textogoes as written (it may be Scryfall syntax); withexacto, chosen from the suggestions, it becomes!"name". - Every other value goes through
solo_alfanumerico, so a filter cannot smuggle in another query. - Colours:
c>=(includes),c=(exactly) orid<=(identity within them, for a commander). Colourless with colours is meaningless, so the colours win. -
include_multilingual=trueis what makes "rayo" find the Spanish printed name; with no language filter results still come in English. It is dropped only for "all printings" with no language, which would list every printing in every language.
An empty query returns an empty page without calling Scryfall. A query with no matches (a 404 from Scryfall) is also an empty page, not an error.
-
Filters search by themselves, the text does not.
claveDeFiltrosis the filters without the text: when it changes, a search runs after 350 ms (filters are often changed several in a row). The text waits for Enter, the button or a suggestion, to avoid a request per keystroke. Returning to the screen does not search again. -
Paging. Scryfall gives up to 175 cards per page. A sentinel at the end of the grid (
useVisible, with theScrollAreaviewport as root) asks for the next page; if that fails it stops asking and shows "Retry". Pages are not remembered inbusquedas: the store already keeps them. -
Stale answers.
busqueda-store.tsnumbers each request and drops the answer of any but the last. -
Details.
ficha_degives one entry per face: split and adventure cards share one image and carry each face's text; double-faced cards have an image per face, and only they get the "other face" button. Printed text wins over Oracle text, so a card in Spanish reads in Spanish. -
Prices. Scryfall gives no price to non-English printings, so
carta_fichaasks for the same printing in English; if that fails the details still open, without a price. This is the same rule as Statistics. -
Printings.
card_printswith the language of the open card; Cockatrice rows are dropped because they have no details page. If it fails the details still work. - Rulings. They belong to the card, not to the printing, so they are asked for once per card name, not again when switching printing. Scryfall has them only in English, and the heading says so.
-
Adding.
traerCartaplusinsertarat the end of the open deck, with a toast as feedback: the deck is not on screen.
- A new filter: a field in
FiltrosCartasand its piece inconsulta(with a test), then the control infiltros-panel.tsxand the count incuantosFiltros. - A new detail: a field in
FichaCarta/CaraFicha(ScryCardmay already read it) and its line inficha-carta.tsx.
Use and build · Uso y desarrollo
- User-Guide · Guía de usuario
- Development-Setup · Preparación del entorno de desarrollo
- Testing-and-CI · Tests y CI
- Releases-and-Auto-Updates · Versiones y actualizaciones automáticas
- Conventions · Convenciones
Architecture · Arquitectura
- Architecture · Arquitectura
- IPC-and-Error-Handling · IPC y manejo de errores
- Rust-App-Layer · Capa de aplicación Rust
Data · Datos
- Deck-Model · Modelo del mazo
- Storage-and-Blobs · Almacenamiento y blobs
- Deck-Package-Format · Formato del paquete de mazo
- Deck-Library · Biblioteca de mazos
Getting cards · Conseguir cartas
- Decklist-Parsing · Parseo de la lista del mazo
- Scryfall-Integration · Integración con Scryfall
- External-Sources · Fuentes externas
- Card-Identification-and-OCR · Identificación de cartas y OCR
Layout, images, PDF · Maquetación, imagen y PDF
- Layout-Engine · Motor de maquetación
- Imaging-and-PDF · Imagen y PDF
- Export · Exportación
- Live-Preview · Vista previa en vivo
- Statistics · Estadísticas
Card designer · Diseñador de cartas
- Designer-Overview · Visión general del diseñador
- Designer-Engine · Motor del diseñador
- Designer-Composition · Composición del diseñador
- Frame-Packs · Packs de marcos
- Designer-App-Layer · Capa de aplicación del diseñador
- Designer-UI · Interfaz del diseñador
- Card-Editor-Dialog · Diálogo Editar carta
Game table · Mesa de juego
Mobile · Móvil
Frontend · Frontend
- Frontend-Architecture · Arquitectura del frontend
- State-Stores · Stores de estado
- Internationalization · Internacionalización
- Themes-and-Skins · Temas y skins
- Icons · Iconos
- Settings-and-Shell · Ajustes y shell
- Tutorials · Tutoriales
- Decklist-Panel · Panel de la lista del mazo
- Add-Card-and-Variants · Añadir carta y variantes
- Card-Search · Búsqueda de cartas
- Set-Browser · Explorador de sets
Reference · Referencia