Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/SdazaP/ruTournament/llms.txt

Use this file to discover all available pages before exploring further.

The Participants page (/dashboard/tournament/:id/competitors) is your central hub for managing the roster of a tournament after it has been created. From here you can add new competitors mid-tournament, correct names, reassign category memberships, search and filter the list, and permanently remove competitors. All changes are persisted immediately to IndexedDB via db.tournaments.put() — no server round-trip is needed. The page is read-only when the tournament status is Finalized.

Adding a competitor

The add-competitor form appears at the top of the page whenever the tournament is not Finalized. It contains three elements:
  1. Name input — type the competitor’s full name. A duplicate check (isDuplicateName) runs when you click Agregar. If the name matches any existing competitor, an error message "Ya existe un competidor con ese nombre" appears beneath the input and the add action is blocked.
  2. Category selector — a CategoryToggle component displays all categories in the tournament as clickable tags. Select exactly one category to associate the new competitor with on creation. (You can add more categories later in Edit Mode.)
  3. Agregar button — clicking this calls handleAdd, which validates uniqueness one final time, creates a CompetitorLocal record with id: Date.now().toString(), and writes it to IndexedDB.
// CompetitorLocal shape (from db.ts)
interface CompetitorLocal {
  id?: string;
  name?: string;
  categories: string[];        // category IDs (not names)
  roles?: string[];            // global staff roles
  assignedRoles?: Record<string, string[]>; // per-category role assignments
}

Editing competitors

All modifications to existing competitors are gated behind Edit Mode. To enable it, click the “Activar Edición” button in the top-right corner of the page. While Edit Mode is active:
  • Every competitor row becomes an editable form: the name cell switches from a static <span> to a text <input>, and the category tags become interactive toggles.
  • A yellow “Modo edición activado” notification badge bounces in the bottom-right corner as a persistent reminder.
  • The app tracks which competitors have been changed and counts unsaved modifications.
To persist your changes, click “Activar Edición” a second time (which acts as a “stop editing” toggle). If there are unsaved changes, a Save Changes modal appears with three options:
ButtonAction
Guardar CambiosCalls db.tournaments.put() with the updated competitors array and exits Edit Mode.
Descartar CambiosReverts all in-memory edits to the snapshot taken when Edit Mode was activated.
CancelarDismisses the modal and returns to Edit Mode without saving or discarding.
The same exit-confirmation modal also fires if you attempt to navigate away (e.g., click a sidebar link) while Edit Mode is active and unsaved changes exist.

Searching and filtering

Two controls sit above the competitor table and work together to narrow the visible list:
  • Search bar — a case-insensitive substring filter on competitor names. The match uses participant.name.toLowerCase().includes(searchTerm.toLowerCase()), so partial names work. Clear the field to show all competitors.
  • Category filter dropdown — shows all categories in the tournament, plus an “All categories” option at the top. Selecting a category hides every competitor not enrolled in that category. The filter resolves category IDs back to names internally, so it always shows the human-readable category name.
A live count (N competidores encontrados) below the controls reflects the current filtered result set.

Removing a competitor

Competitor deletion is only available while Edit Mode is active. When Edit Mode is on, a “Eliminar” button (trash-icon + label) appears in the rightmost column of each competitor row. Clicking it opens a confirmation modal that shows:
  • The competitor’s name.
  • A warning if the competitor already has results recorded in any round.
  • A secondary notice reminding you that any group or schedule slots previously generated for this competitor will show as “Desconocido” (Unknown) until you regenerate the groups for their categories.
Confirming calls handleDelete, which removes the competitor from the TournamentLocal.competitors array and writes the updated tournament to IndexedDB.
Deleting a competitor permanently removes their solve results from every round and category. If scramble groups or schedules have already been generated for this tournament, the deleted competitor’s slots will appear as “Unknown” until you regenerate groups for their affected categories. This action cannot be undone.

Category assignments

Each competitor can belong to multiple categories simultaneously. In the competitor table, each row displays a CategoryToggle — a row of colour-coded category tags showing which events the competitor is enrolled in. To add a category to an existing competitor, Edit Mode must be active. Click an unselected category tag on the competitor’s row. The category ID is added to competitor.categories immediately in local state; if you are not in bulk-edit mode the change is also flushed to IndexedDB right away. To remove a category, click an already-selected (highlighted) tag while Edit Mode is active. Before the removal is applied, a Remove Category confirmation modal appears showing:
  • The category name being removed.
  • The competitor’s name.
  • A caution that any previously generated schedule or group for this category will have an “Unknown” placeholder until groups are regenerated.
Confirm with “Sí, Retirar” to call confirmRemoveCategory, which filters the category ID out of competitor.categories and persists the update.
Removing a competitor from a category also removes their results for that category. Previously generated groups for that category will show a placeholder until you regenerate them. This cannot be undone.
All edits to existing participants — name changes, category additions, and category removals — require Edit Mode to be active. When the tournament status is Finalized, the Edit Mode button is disabled and displays a lock icon. Reactivate the tournament from the tournament dashboard (change status back to activo) to re-enable editing.

Build docs developers (and LLMs) love