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:
@@ -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',
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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}/`)
|
||||
|
||||
Reference in New Issue
Block a user