The tablero (board) module provides everything needed to render and operate ComuniTEA’s AAC communication board. It exports two primary hooks —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ElthonJohan/comunitea/llms.txt
Use this file to discover all available pages before exploring further.
useTablero for board navigation state and useFrase for managing the four-slot sentence strip — plus the buildMergedBoard utilities, the Pictograma and Subcategoria data types, and the pre-built data constants (ALL_SUBCATS, PERSONAS_ROW, PETICIONES_ROW, and the pic() factory). Together these form a complete, self-contained state management layer that keeps board navigation and sentence composition in sync without any external state management library.
Data structures
Pictograma
The atomic unit of the tablero. Every tile on the board, in the sentence strip, and in the personas/peticiones rows is a Pictograma.
Subcategoria
A named group of pictograms displayed as a horizontal row on the board.
pic() factory function
Use pic() to create Pictograma objects without manually spreading optional fields.
Unique pictogram identifier. Also used as the
audioAssetKey fallback.Emoji displayed when no
imageUri is set.Human-readable text shown below the pictogram tile and spoken aloud.
Category string (e.g.
"comida", "personas", "peticiones"). Routes taps in useFrase.agregarPictograma().Whether the pictogram appears in the Favorites row. Defaults to
false.Explicit key to look up in the bundled audio asset map. Omit to use
id as the key.Remote or local URI for a photo-based pictogram (e.g. child’s avatar, custom photo).
Pre-built data constants
ALL_SUBCATS
The full default board — an array of Subcategoria objects covering fruits, food, toys, vegetables, sweets, hygiene, clothing, emotions, places, animals, actions, and more. Exported from features/tablero/data/tablero.ts.
PERSONAS_ROW
Default people pictograms shown in the Personas row when the child profile has no custom important_people set.
PETICIONES_ROW
The fixed row of social/action pictograms shown beneath the board.
buildMergedBoard
buildMergedBoard is not a single function but a set of merge utilities in features/tablero/buildMergedBoard.ts that combine default board data with per-child personalization.
mergeAllSubcats
ALL_SUBCATS with an optional "Le gusta" subcategory prepended, built from the child’s preferred_activities profile field. If preferred is empty or null, returns ALL_SUBCATS unchanged.
The
preferred_activities array from the child’s profile. Each entry is a raw activity identifier or a custom:Label string.mergePersonasRow
importantPeople is empty, falls back to PERSONAS_ROW; otherwise parses emoji|Name lines and creates custom pictos.
Array of
"emoji|Name" strings from the child profile (e.g. "👩|Mamá").Remote avatar URL. Used as
imageUri on the “Yo” picto.Helper functions
useTablero
useTablero is the main board navigation hook. It derives the subcategory list from the child’s profile, manages the active category filter, controls the category overlay drawer, and exposes the FlatList ref for programmatic scroll-to-category.
Return shape
The visible subcategories slice. For
basic-level users this is capped at 4 (maxSubcategoriasVisibles = 4); for intermediate/advanced it’s unlimited. Computed from mergeAllSubcats(childProfile.preferred_activities).Deduplicated category summaries derived from all subcategories (including those beyond the visible slice). Used to populate the category overlay drawer.
The
categoriaId of the currently highlighted category, or null if no filter is active.Controls the visibility of the category drawer overlay.
Shows the category selection overlay.
Hides the category selection overlay.
Sets
categoriaActiva, closes the overlay, and scrolls the FlatList to the matching subcategory row using scrollToIndex.Clears the active category filter (shows all subcategories).
Human-readable label for the active category (e.g.
"Comida"), or null.Pass this directly to your
FlatList so selectCategoria can call scrollToIndex.Merged Personas row:
[childYoPicto, ...importantPeople] or [childYoPicto, ...PERSONAS_ROW].Always equals
PETICIONES_ROW (the five social-action pictograms).Flat list of all pictograms across all subcategories where
esFavorito === true.Snapshot object
{ subcategorias, categoriaActiva, overlayVisible } — useful if you need to pass board state as a prop without destructuring.CategoriaResumen shape
useFrase
useFrase manages the four-slot AAC sentence strip. The strip follows a fixed structure: [Persona] [Petición] [Objeto 1] [Objeto 2]. Routing is automatic — pictograms with categoria === "personas" go into slot 0, "peticiones" into slot 1, and everything else into slot 2 then slot 3. Sentence playback uses speakFrasePhrase(), which runs through ElevenLabs TTS with the same fallback chain as useSpeech.
Sentence strip slot structure
Return shape
Always occupied. Defaults to the “Yo” picto built from the child’s avatar. Updated when a pictogram with
categoria === "personas" is tapped.The social/action verb (petición).
null when empty. Setting this slot enables playback (fraseLista = true).Two optional object slots. The first empty slot is always filled first. If both are occupied, the second is overwritten.
Computed array of all four slots in order:
[slotPersona, slotPeticion, slotsObjeto[0], slotsObjeto[1]]. Convenient for rendering a flat list of slot tiles.true when slotPeticion !== null. Use this to enable the ▶ play button.Alias for
fraseLista. Both reflect the same condition.The primary tap handler. Routes to
agregarPersona, agregarPeticion, or agregarObjeto based on p.categoria.Removes a pictogram by slot index. Removing slot 0 resets it to the default “Yo” picto. Removing slots 1–3 sets the slot to
null.Resets all slots: petición and objeto slots become
null, persona resets to the child’s default “Yo” picto.Assembles the label text from all occupied slots, optionally runs AI expansion via
expandTableroSlots(), stops any concurrent speech, and plays the full sentence using speakFrasePhrase(). Also calls recordSentenceSpoken() on the child profile context.FraseState type
useTablero + useFrase together
The two hooks compose naturally:useTablero drives board navigation, useFrase manages the sentence strip, and agregarPictograma bridges them.
leerFrase() stops any ongoing speech from the G2/G3 exercise hooks (stopSpeakG2, stopSpeakG3) before playing the sentence, so boards and exercises never overlap audio.