Fix #498: edit mode exit on navigate #501

Merged
crueber merged 1 commit from fix/issue-498 into main 2026-09-13 21:55:02 +00:00
Owner

Profile edit mode leaked onto the repositories/organizations tabs (the #442 hoist) and survived leaving the owner page (the #455 module-scope signal had no exit path).\n\n- web/src/pages/Repos.jsx: single <ProfileForm> Show re-scoped under view() === 'profile' (first in the profile branch; gate + onDone byte-identical); new pathname createEffect + unmount onCleanup clear the module state unless the RESULTING path is the editing owner's profile view exactly. Tab switches close it too (unsaved edits discarded by unmount — decided per criteria 1+5). #455 openEditor untouched: synchronous set-then-navigate batches, so the effect sees only the post-navigation path — no toggle-fight. onCleanup joins the solid-js import (Repo.jsx popover precedent); useLocation now bound in OwnerPage.\n- web/src/lib/owners.js: new pure editStaysOpen(pathname, editingOwner) (keys on the EDITING slug, so cross-owner navigation exits).\n- Tests: new owner-profile-edit-exit-498.test.js (13: predicate decision table + wiring + no-fight pins); #498-scoped rewrites of the stale owner-profile-edit-all-views-442 placement pins and the profile-sidebar-421 form-above-gates pin.\n- docs/go/12_web_ui.md decision entry (law 12).\n\nVerification: node --test web/test/unit/*.test.js 1110 total / 1108 pass / 2 fail — the 2 are pre-existing on pristine origin/main (identical live-server smoke subtests at 1097/1095/2; +13 net new, zero PR-caused); vite build + esbuild green. No backend change, no new deps. Browser proof open (shared-daemon loopback guard — no private daemon per workspace rules). Do NOT merge (review first).

Profile edit mode leaked onto the repositories/organizations tabs (the #442 hoist) and survived leaving the owner page (the #455 module-scope signal had no exit path).\n\n- `web/src/pages/Repos.jsx`: single `<ProfileForm>` Show re-scoped under `view() === 'profile'` (first in the profile branch; gate + onDone byte-identical); new pathname `createEffect` + unmount `onCleanup` clear the module state unless the RESULTING path is the editing owner's profile view exactly. Tab switches close it too (unsaved edits discarded by unmount — decided per criteria 1+5). #455 `openEditor` untouched: synchronous set-then-navigate batches, so the effect sees only the post-navigation path — no toggle-fight. `onCleanup` joins the solid-js import (Repo.jsx popover precedent); `useLocation` now bound in OwnerPage.\n- `web/src/lib/owners.js`: new pure `editStaysOpen(pathname, editingOwner)` (keys on the EDITING slug, so cross-owner navigation exits).\n- Tests: new `owner-profile-edit-exit-498.test.js` (13: predicate decision table + wiring + no-fight pins); #498-scoped rewrites of the stale `owner-profile-edit-all-views-442` placement pins and the `profile-sidebar-421` form-above-gates pin.\n- `docs/go/12_web_ui.md` decision entry (law 12).\n\nVerification: `node --test web/test/unit/*.test.js` 1110 total / 1108 pass / 2 fail — the 2 are pre-existing on pristine origin/main (identical live-server smoke subtests at 1097/1095/2; +13 net new, zero PR-caused); `vite build` + `esbuild` green. No backend change, no new deps. Browser proof open (shared-daemon loopback guard — no private daemon per workspace rules). Do NOT merge (review first).
Profile edit mode leaked onto the repositories/organizations tabs (the
#442 hoist) and survived leaving the owner page (the #455 module-scope
signal had no exit path). Repos.jsx: the ProfileForm Show re-scopes
under view() === 'profile', and a pathname createEffect + unmount
onCleanup clear the module state unless the resulting path is the
editing owner's profile view exactly (shared pure editStaysOpen in
lib/owners.js — tab switches close it too, unsaved edits discarded by
unmount). #455 openEditor ordering untouched (set-then-navigate, batched
— no toggle-fight); gates/save/invalidate byte-identical. No backend
change, no new deps.
Sign in to join this conversation.
No description provided.