chore: update comments and documentation for clarity and consistency across various files

- Translated comments from Spanish to English in vite.config.ts, docker-compose.yml, attendance-risk.ts, analytics.ts, attendance.ts, attendees.ts, enums.ts, groups.ts, and onboarding.ts.
- Improved descriptions for better understanding of code functionality and purpose.
- Ensured uniformity in terminology and phrasing throughout the codebase.
This commit is contained in:
Jose Selesan
2026-10-01 16:06:54 -03:00
parent 01b35691df
commit 69275c37b4
100 changed files with 1121 additions and 1086 deletions

View File

@@ -20,8 +20,8 @@ export function BottomNav() {
isActive ? 'text-accent-fg' : 'text-foreground/80 hover:text-primary',
)}
>
{/* Pastilla suave detrás del ícono: el estado activo se lee por
color + fondo, no solo por el tono del texto. */}
{/* Soft pill behind the icon: the active state is read by
color + background, not only by the text tone. */}
<span
className={cn(
'flex size-8 items-center justify-center rounded-lg transition-colors duration-150',

View File

@@ -9,9 +9,9 @@ export function Header() {
<header className="sticky top-0 z-40 h-16 w-full border-b border-border bg-background/90 backdrop-blur">
<div className="mx-auto flex h-full w-full max-w-7xl items-center justify-between px-4 lg:px-6">
<div className="flex min-w-0 items-center">
{/* `Link` y no `<a>`: en mobile el logo es la única forma de volver al
inicio y un anchor recargaría el documento entero, perdiendo el
estado en memoria (cache de React Query, evento de instalación). */}
{/* `Link` and not `<a>`: on mobile the logo is the only way back to the
home screen and an anchor would reload the whole document, losing
the in-memory state (React Query cache, install event). */}
<Link to="/" className="flex items-center lg:hidden" aria-label="Gruperly inicio">
<Logo className="h-8" />
</Link>

View File

@@ -4,32 +4,33 @@ import { useImmersiveBarHost } from '../../context/ImmersiveBarProvider'
import { useLargeTitleCollapse } from '../../hooks/useLargeTitleCollapse'
type LargeTitleProps = {
/** Texto del título. Es el mismo en el grande y en el de la barra: el `h1`
* real es el grande, el de la barra es un duplicado visual. */
/** Title text. It's the same in the large title and in the bar's copy: the
* real `h1` is the large one, the bar's is a visual duplicate. */
title: string
/** Acción a la izquierda de la barra. En desktop es el link "volver" que
* antes vivía en el cuerpo de la pantalla; en mobile se oculta. */
/** Action to the left of the bar. On desktop it's the "Volver" link that
* used to live in the screen body; on mobile it's hidden. */
leading?: ReactNode
/** Contexto que no puede desaparecer al scrollear (ej. el contador de
* presentes). Viaja a la barra y se funde con el título. */
/** Context that can't disappear on scroll (e.g. the present counter). It
* travels to the bar and blends with the title. */
barTrailing?: ReactNode
/** Metadatos bajo el título grande: badges, descripción. Se van al colapsar. */
/** Metadata under the large title: badges, description. It goes away when
* the title collapses. */
children?: ReactNode
}
/**
* Encabezado de pantalla con Large Title (patrón de iOS): el título arranca
* grande y al scrollear se desliza debajo de la barra, que se opaca y recibe
* el título en versión chica.
* Screen header with Large Title (the iOS pattern): the title starts large and
* slides under the bar as you scroll, while the bar goes opaque and takes the
* title in its small version.
*
* El título grande es un bloque normal en el flujo; la barra vive en una caja
* sticky que el layout monta arriba de `<main>` (ver `ImmersiveBarHost`), así
* el contenido se desliza por debajo sin márgenes negativos ni `fixed` que
* haya que compensar en desktop.
* The large title is a normal block in the flow; the bar lives in a sticky box
* that the layout mounts above `<main>` (see `ImmersiveBarHost`), so the content
* slides under it without negative margins or a `fixed` we'd have to compensate
* for on desktop.
*
* El estado del scroll vive acá adentro a propósito: `children` llega como prop
* ya construido, así React reutiliza los elementos y el subtree de abajo no se
* re-renderiza en cada frame de scroll.
* The scroll state lives in here on purpose: `children` arrives as an already
* built prop, so React reuses the elements and the subtree below doesn't
* re-render on every scroll frame.
*/
export function LargeTitle({ title, leading, barTrailing, children }: LargeTitleProps) {
const { titleRef, progress } = useLargeTitleCollapse()
@@ -40,9 +41,9 @@ export function LargeTitle({ title, leading, barTrailing, children }: LargeTitle
{barHost
? createPortal(
<div className="relative flex h-full items-center gap-3 px-4 lg:px-0">
{/* El fondo va en una capa propia: se opaca con el scroll mientras
el título entra, y `leading` (el link "volver") no puede
fundirse con él porque existe siempre. */}
{/* The background goes on its own layer: it goes opaque with the
scroll while the title slides in, and `leading` (the "Volver"
link) can't blend with it because it always exists. */}
<div
className="absolute inset-0 border-b border-border bg-background/80 backdrop-blur-md"
style={{ opacity: progress }}

View File

@@ -12,18 +12,18 @@ export function RootLayout({ children }: { children: ReactNode }) {
return (
<div className="min-h-dvh w-full overflow-x-clip">
{/* En las rutas immersive la pantalla trae su propia barra (LargeTitle),
con el logo y el nombre del grupo: el header global con logo + tema +
avatar sería una segunda barra compitiendo por los mismos píxeles. */}
{/* On immersive routes the screen brings its own bar (LargeTitle) with
the logo and the group name: the global header with logo + theme +
avatar would be a second bar competing for the same pixels. */}
{immersive ? null : <Header />}
<div className="mx-auto flex w-full max-w-7xl gap-6 lg:px-6">
<Sidebar immersive={immersive} />
<ImmersiveBarProvider>
{/* pt-0 en immersive: el padding superior lo aporta la caja de la
barra, y si no el título grande arrancaría 16px más abajo de la
base de la barra y el colapso se mediría corrido. */}
{/* pt-0 on immersive: the bar's box provides the top padding,
otherwise the large title would start 16px below the bottom of the
bar and the collapse would be measured off. */}
<main
className={cn(
'min-w-0 flex-1 px-4 pb-[calc(6rem+env(safe-area-inset-bottom))] lg:px-0 lg:pb-8',

View File

@@ -7,17 +7,17 @@ export function Sidebar({ immersive = false }: { immersive?: boolean }) {
const location = useLocation()
return (
// Sin header global no hay nada que esquive arriba: la columna del sidebar
// pasa a ocupar la ventana completa y queda a la altura de la barra de
// LargeTitle.
// Without the global header there's nothing to clear above: the sidebar
// column takes over the whole window and lines up with the height of the
// LargeTitle bar.
<aside
className={cn(
'sticky hidden w-64 shrink-0 flex-col border-r border-border bg-surface px-4 py-6 lg:flex',
immersive ? 'top-0 h-dvh' : 'top-16 h-[calc(100dvh-4rem)]',
)}
>
{/* `Link` y no `<a>`: un anchor recargaría el documento y perdería el
estado en memoria (cache de React Query, evento de instalación). */}
{/* `Link` and not `<a>`: an anchor would reload the document and lose the
in-memory state (React Query cache, install event). */}
<Link to="/" className="mb-8 flex items-center px-1" aria-label="Gruperly inicio">
<Logo className="h-10" />
</Link>

View File

@@ -13,10 +13,10 @@ export const NAV_ITEMS: NavItem[] = [
{ label: 'Ajustes', to: '/settings', icon: Settings },
]
/** Una sección sigue activa dentro de sus subrutas: en `/groups/abc` el ítem
* activo es "Grupos", no ninguno. El prefijo se corta en el separador para
* que `/groupsomething` no se considere "/groups". La raíz es exacta: no hay
* subrutas del home que deban marcarla. */
/** A section stays active within its subroutes: on `/groups/abc` the active
* item is "Grupos", not none. The prefix is cut at the separator so
* `/groupsomething` isn't taken for "/groups". The root is exact: the home has
* no subroutes that should mark it. */
export function isNavItemActive(pathname: string, to: string): boolean {
if (to === '/') return pathname === '/'
return pathname === to || pathname.startsWith(`${to}/`)

View File

@@ -12,10 +12,10 @@ const variants: Record<BadgeVariant, string> = {
warning: 'bg-warning-soft text-warning',
danger: 'bg-danger-soft text-danger',
neutral: 'bg-primary-soft text-primary',
/* Estado informativo que no es alerta: lista de espera, cupos libres. Usa la
tinta de acento legible (`accent-fg` es el azul claro en tema oscuro,
7.1:1 sobre la tarjeta) y no el `accent` directo, que en oscuro da 2.2:1
y no alcanza el mínimo de 3:1 para contenido no textual. */
/* Informational state, not an alert: waitlist, free spots. Uses the legible
accent ink (`accent-fg` is the light blue in the dark theme, 7.1:1 on the
card) and not the plain `accent`, which in dark scores 2.2:1 and misses the
3:1 minimum for non-text content. */
info: 'bg-accent-soft text-accent-fg',
}

View File

@@ -28,9 +28,9 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
ref={ref}
type={type}
className={cn(
// `transition-*` explícito en vez de `transition-all`: solo se animan
// color, fondo, borde y transform. El feedback de presión se anula
// con `motion-reduce` para respetar prefers-reduced-motion.
// Explicit `transition-*` instead of `transition-all`: only color,
// background, border and transform are animated. Press feedback is
// cancelled with `motion-reduce` to respect prefers-reduced-motion.
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl font-medium transition-[color,background-color,border-color,fill,stroke,transform] duration-150 ease-out active:scale-[0.96] motion-reduce:active:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent disabled:pointer-events-none disabled:opacity-50',
variants[variant],
sizes[size],

View File

@@ -11,8 +11,8 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
<input
ref={ref}
className={cn(
// text-base (16px) en mobile: iOS auto-zoomea al enfocar controles con
// font-size < 16px y, al cerrar el teclado, no restaura el scale.
// text-base (16px) on mobile: iOS auto-zooms when focusing controls
// with font-size < 16px and doesn't restore the scale on keyboard close.
'h-10 w-full rounded-xl border border-border bg-surface px-3 text-base sm:text-sm text-primary placeholder:text-foreground/40 transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/30 disabled:cursor-not-allowed disabled:opacity-50',
invalid && 'border-danger focus:border-danger focus:ring-danger/30',
className,

View File

@@ -2,19 +2,20 @@ import { type ReactNode, useId, useState } from 'react'
import { cn } from '../../lib/utils'
export type TooltipProps = {
/** Texto explicativo que se muestra al hacer hover, foco de teclado o tap. */
/** Explanatory text shown on hover, keyboard focus or tap. */
content: ReactNode
/** Contenido del disparador. Queda dentro de un <button> para ser accesible. */
/** Trigger content. It sits inside a <button> to stay accessible. */
children: ReactNode
className?: string
/** Posicionamiento alternativo del globo (por defecto: abajo, anclado a la derecha en sm+). */
/** Alternate positioning for the bubble (default: below, anchored right on sm+). */
tooltipClassName?: string
}
/**
* Tooltip accesible sin dependencias: hover (ratón), foco (teclado) y tap
* (táctil, vía focus). Se cierra con Escape, al salir el puntero o al perder
* el foco. El globo se ancla abajo del disparador para no tapar el contenido.
* Accessible tooltip with no dependencies: hover (mouse), focus (keyboard) and
* tap (touch, via focus). It closes on Escape, when the pointer leaves or when
* it loses focus. The bubble is anchored below the trigger so it doesn't cover
* the content.
*/
export function Tooltip({ content, children, className, tooltipClassName }: TooltipProps) {
const [open, setOpen] = useState(false)
@@ -28,8 +29,8 @@ export function Tooltip({ content, children, className, tooltipClassName }: Tool
<button
type="button"
aria-describedby={open ? id : undefined}
// El hover solo aplica a punteros de ratón: en táctil no hay "hover
// persistente" y el tap se resuelve con focus + click.
// Hover only applies to mouse pointers: on touch there is no
// "persistent hover" and tap is handled with focus + click.
onPointerEnter={(e) => {
if (e.pointerType === 'mouse') show()
}}