LoVisual/frontend/src/features
loki5512344 4fce425dcd
Some checks failed
CI / backend (cargo test + clippy) (push) Failing after 1m21s
CI / frontend (lint + test + build) (push) Failing after 24s
CI / mod (gradle test + checkFolderLimit) (push) Successful in 1m57s
feat(frontend): avatar crop dialog (viewport 320, wheel/pinch/keyboard, guides+shade, previews, dirty guard)
Rebuilds the "pick a photo" flow around an Edit Image modal, matching every
product surveyed in the 2026-10 avatar-settings research (Discord, Google,
Slack, Figma, Cropper.js playground). Before: 240 px circular viewport with
no visible crop frame, a single range slider, and no way to close with the
keyboard — the direct reason the previous version felt unfinished.

cropMath: VIEWPORT=320, OUTPUT_SIZE=512 (matches Slack min), plus wheelZoom
(exp so scroll up then down returns to the same zoom, unlike linear),
pinchZoom (ratio of two-pointer distance), PAN_STEP/ZOOM_STEP for keyboard,
PREVIEW_SIZES for the "how others see it" column.

AvatarCropper is now a pure canvas: pointer capture for pan, two-pointer
tracking for pinch, wheel handler with exponential zoom, tabIndex=0 +
onKeyDown for arrows/+/-/0, a Reset button, and a visual frame with
rule-of-thirds guides (40 % opacity) and an inset box-shadow that dims the
corners outside the round target — so the user actually sees what falls in
the file. Cancel/Confirm live in the dialog; dirty signal and current
CropState bubble up via props.

AvatarEditDialog is a portal: bg-black/60 backdrop with click-to-close,
role=dialog + aria-modal, initial focus into the card, ESC closes, X button
in the header. If the user has panned/zoomed (dirty), closing prompts for
confirmation. Header shows file.name + size + the accepted-format hint
previously only surfaced after a failed upload. Right column renders 3 live
previews at 128/64/32 px so the small HUD nameplate treatment is visible
before upload. Progress bar and error notice moved inside so the user does
not have to look away during a slow upload.

AvatarUpload picks the dialog instead of the raw cropper; two-step
"Remove avatar" from the previous commit is unchanged.

Tests: 5 new cropMath cases (wheel symmetric, wheel clamps both ends, pinch
ratio, pinch guards zero baseline). Existing 140 stay green (145 total),
tsc clean, oxlint 0/0.

Not yet: no dep on react-easy-crop — own code as planned. No focus trap
beyond initial focus + ESC (dialog traps implicitly via portal + backdrop
covering). Rotate is still missing — deliberately, since Discord does not
ship it either and extending sourceRect for theta would complicate the
preview pass.
2026-10-12 22:51:40 +02:00
..
account feat(frontend): avatar crop dialog (viewport 320, wheel/pinch/keyboard, guides+shade, previews, dirty guard) 2026-10-12 22:51:40 +02:00
auth feat(accounts): outgoing mail over SMTP (Resend), email verification, fail-closed password reset 2026-10-09 21:08:33 +02:00
clickgui feat: frontend perf and a11y pass, plus mod visuals, hero main menu, Simple Voice Chat and vanilla chat autocomplete 2026-10-01 21:29:54 +02:00
configs feat: frontend perf and a11y pass, plus mod visuals, hero main menu, Simple Voice Chat and vanilla chat autocomplete 2026-10-01 21:29:54 +02:00
device-link feat: frontend perf and a11y pass, plus mod visuals, hero main menu, Simple Voice Chat and vanilla chat autocomplete 2026-10-01 21:29:54 +02:00
download feat(site): redesigned /download, releases and links moved from GitHub to Forgejo 2026-10-09 22:15:55 +02:00
landing feat(site): redesigned /download, releases and links moved from GitHub to Forgejo 2026-10-09 22:15:55 +02:00
profile feat: frontend perf and a11y pass, plus mod visuals, hero main menu, Simple Voice Chat and vanilla chat autocomplete 2026-10-01 21:29:54 +02:00
showcase fix: CI workflow, password reset flow, health/limits in services, session refactor, dead mixin stub cleanup 2026-10-09 19:21:17 +02:00
themes feat: frontend perf and a11y pass, plus mod visuals, hero main menu, Simple Voice Chat and vanilla chat autocomplete 2026-10-01 21:29:54 +02:00