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:
@@ -1,8 +1,8 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
|
||||
/* Alto de la barra de navegación donde entra el título chico. Tiene que
|
||||
coincidir con el `h-14` de `LargeTitle`: la barra es sticky contra el borde
|
||||
superior de la ventana y el título grande se mide contra este valor. */
|
||||
/* Height of the navigation bar where the small title slides in. It has to
|
||||
match the `h-14` of `LargeTitle`: the bar is sticky to the top edge of the
|
||||
window and the large title is measured against this value. */
|
||||
const BAR_HEIGHT = 56
|
||||
|
||||
function clamp01(value: number) {
|
||||
@@ -11,13 +11,13 @@ function clamp01(value: number) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Progreso de colapso de un Large Title: 0 con el título grande desplegado,
|
||||
* 1 cuando quedó por completo tapado detrás de la barra.
|
||||
* Collapse progress of a Large Title: 0 with the large title fully shown,
|
||||
* 1 once it's completely hidden behind the bar.
|
||||
*
|
||||
* El progreso sale de la posición del título, no del tiempo: se recalcula en
|
||||
* cada frame mientras se scrollea. Por eso el gesto se siente pegado al dedo
|
||||
* en vez de "animado", y por eso `requestAnimationFrame` sirve para agrupar
|
||||
* eventos de scroll, no para interpolar la animación.
|
||||
* The progress comes from the title's position, not from time: it is
|
||||
* recalculated on every frame while scrolling. That's why the gesture feels
|
||||
* stuck to the finger instead of "animated", and why `requestAnimationFrame`
|
||||
* is there to batch scroll events, not to interpolate the animation.
|
||||
*/
|
||||
export function useLargeTitleCollapse() {
|
||||
const titleRef = useRef<HTMLHeadingElement>(null)
|
||||
@@ -32,11 +32,11 @@ export function useLargeTitleCollapse() {
|
||||
const measure = () => {
|
||||
frame = 0
|
||||
const { top, height } = title.getBoundingClientRect()
|
||||
// 0 cuando el borde superior del título llega a la base de la barra, 1
|
||||
// cuando su borde inferior también llegó (quedó enteramente debajo).
|
||||
// 0 when the title's top edge reaches the bottom of the bar, 1 when its
|
||||
// bottom edge got there too (it ended up entirely underneath).
|
||||
const next = clamp01((BAR_HEIGHT - top) / (height || BAR_HEIGHT))
|
||||
// Los títulos de grupo llegan asíncrono y pueden cambiar de alto entre
|
||||
// renders: sin este umbral se re-renderiza en cada frame de scroll.
|
||||
// Group titles arrive asynchronously and can change height between
|
||||
// renders: without this threshold it re-renders on every scroll frame.
|
||||
setProgress((current) => (Math.abs(current - next) < 0.002 ? current : next))
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ export function useLargeTitleCollapse() {
|
||||
window.addEventListener('scroll', schedule, { passive: true })
|
||||
window.addEventListener('resize', schedule)
|
||||
|
||||
// El nombre del grupo se carga después del primer render y la webfont puede
|
||||
// cambiar el alto del título: el rango de colapso depende de esa medida.
|
||||
// The group name loads after the first render and the webfont can change
|
||||
// the title's height: the collapse range depends on that measurement.
|
||||
const observer = new ResizeObserver(schedule)
|
||||
observer.observe(title)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user