Fix #419: bio autogrow #425

Merged
crueber merged 1 commit from fix/issue-419 into main 2026-09-12 23:11:47 +00:00
Owner

Fixes #419: the owner (Repos.jsx ProfileForm) and org (Org.jsx ProfileTab) bio textareas now grow/shrink to fit via one shared helper, web/src/lib/autogrow.js — no per-page copies, no other textareas, no backend change.

Behavior (cap stated as required): grown height capped at exactly 50vh (AUTOGROW_MAX_VH), overflow-y:auto beyond; rows=6/rows=5 heights stay as the floor and no-JS fallback. Caret stays in view: while fitted the box IS the content (no inner scroll); past the cap a trailing caret (Enter-at-end) is pinned into view, mid-text carets use native scroll. Height resets to auto before measuring so deleting lines shrinks back.

Split per lib convention (attachUpload/settingsNav): pure headless-testable math (autogrowMaxPx, clampAutogrowHeight) + DOM-touching initAutogrow/growTextarea (also headless-run against stubs).

Verification: web/test/unit/autogrow.test.js — 18 new tests green; full suite 865 pass / 2 fail where the 2 fails are the pre-existing smoke.test.js live-server probes (identical 2 fail on clean main: they probe 127.0.0.1:8080, untouched by this change); vite build clean (chunk-size warning pre-existing); no new deps.

Law 12: no doc amendment — no doc pins textarea sizing, so code and docs do not disagree; bio_markdown write path untouched.

Fixes #419: the owner (Repos.jsx ProfileForm) and org (Org.jsx ProfileTab) bio textareas now grow/shrink to fit via one shared helper, web/src/lib/autogrow.js — no per-page copies, no other textareas, no backend change. Behavior (cap stated as required): grown height capped at exactly 50vh (AUTOGROW_MAX_VH), overflow-y:auto beyond; rows=6/rows=5 heights stay as the floor and no-JS fallback. Caret stays in view: while fitted the box IS the content (no inner scroll); past the cap a trailing caret (Enter-at-end) is pinned into view, mid-text carets use native scroll. Height resets to auto before measuring so deleting lines shrinks back. Split per lib convention (attachUpload/settingsNav): pure headless-testable math (autogrowMaxPx, clampAutogrowHeight) + DOM-touching initAutogrow/growTextarea (also headless-run against stubs). Verification: web/test/unit/autogrow.test.js — 18 new tests green; full suite 865 pass / 2 fail where the 2 fails are the pre-existing smoke.test.js live-server probes (identical 2 fail on clean main: they probe 127.0.0.1:8080, untouched by this change); vite build clean (chunk-size warning pre-existing); no new deps. Law 12: no doc amendment — no doc pins textarea sizing, so code and docs do not disagree; bio_markdown write path untouched.
Owner (Repos.jsx) and org (Org.jsx) profile bio textareas consume one
shared web/src/lib/autogrow.js helper: grow/shrink from the rows floor,
caret line kept in view on every input incl. newline, grown height
capped at exactly 50vh with overflow-y:auto beyond. Pure height math
kept headless-testable per repo lib convention; no backend change.
Sign in to join this conversation.
No description provided.