Profile edit mode persists across tab navigation; must live only on the profile view and exit on any navigation away #498
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#498
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
Profile edit mode must exist only on the profile view (
/:owner) and be exited by any navigation away. Today it persists across tab navigation and beyond the owner page entirely.(Static diagnosis from code reading - no local repro run.)
Evidence
web/src/pages/Repos.jsx:318- the edit-open state is module scope:const [getEditingOwner, setEditingOwner] = createSignal(null);(deliberately hoisted in #455 because the three owner routes remountOwnerPage). Nothing ever clears it on navigation.<Show when={getEditing() && getProfile()?.can_edit}>is hoisted above the per-view<Show when={view() === "profile"}>gate (#442), so the form renders in the main column on the repositories and organizations tabs whenever edit mode is open - not only on the profile view.onDone(save/cancel) andopenEditor's re-entry path. There is noonCleanupand no pathname effect inOwnerPagethat clearssetEditingOwnerwhen the route leaves/:owner(or between tabs).useLocationis imported but unused in the component.Architecture notes
OwnerPage, so a component-local signal would not survive the tab-to-profile navigation). The bug is not the hoist itself but the missing exit path, and the form gate being outside the profile view.<ProfileForm>inside the profile view only (re-scope theShowunderview() === "profile").createEffect/onCleanupinOwnerPagewatchinguseLocation().pathnamethat callssetEditingOwner(null)when the pathname leaves/{owner}(and, if the product wants tab switches to close it too, when it leaves the profile view exactly). The repo has cleanup precedent viaonCleanupin the popover patterns (RefPicker/TasksOverlayinweb/src/pages/Repo.jsx).openEditor's navigate-to-/{owner}behavior (#455) working: opening the editor from another tab must still land on the profile view with the form open, without the exit effect immediately closing it (open-then-navigate ordering matters - the effect must key on the resulting pathname).Acceptance criteria
/{owner}and opens the form there (#455 behavior preserved).profile:{owner}on success.openEditor's navigation (form does not flash open-then-close or close-then-refuse).Fix ready for review: PR #501 (branch
fix/issue-498). ProfileForm re-scoped underview()==='profile'; pathname effect + unmount cleanup exit edit mode on any navigation away (tab switches close it too, unsaved edits discarded); #455 open-then-navigate preserved with no toggle-fight (batched set-then-navigate, effect keys on resulting pathname). Headless: newowner-profile-edit-exit-498.test.js(13 tests); full suite 1110/1108/2 (2 pre-existing live-server smoke, identical on main); vite+esbuild green. No backend change, no new deps. Do NOT merge without review.REVIEW PR #501 (fix/issue-498) — verified in scratch worktree /tmp/pr501 @
3fa8d90, node_modules symlinked from main. No browser (headless only, stated explicitly); no docker/build changes; no live-instance contact beyond what smoke.test.js itself fetches.CRITERIA (issue #498, all 5 met by code+tests):
PINS FAITHFUL: 442 file keeps button/module-signal/gate/save/bio pins (only 2 placement tests rewritten, SUPERSEDED headers); 455 file untouched; 421 pin flipped with #498 header. No weakening. Tab-switches-close decided explicitly (issue's open question; consistent with criteria 1+5), documented in code + docs entry.
LAWS: 1 (no new deps — onCleanup joins solid-js import, helper in existing lib/owners.js; no package.json/lock change), 7 (N/A), 8 (web-local only, no seam/core changes), 12 (12_web_ui.md decision entry appended, counts accurate).
TESTS (scratch): targeted 4 files (498+442+455+421) exit=0; full suite excl. smoke.test.js exit=0, 1107 pass / 0 fail; full suite incl. smoke 1108 pass / 2 fail — both failures are the live-server smoke subtests (smoke.test.js fetches 127.0.0.1:8080 over HTTP, imports no PR-changed source; served / returned 401 from whatever is listening there) — environmental, cannot be PR-caused. vite build exit=0; esbuild with exact build:sdk flags exit=0. (My first npx-from-root attempt failed on cwd/version — invocation error, not a PR issue.)
No fixes needed — nothing pushed. MERGE RECOMMENDATION: ready to merge.
Fixed by PR #501 (review clean — all 8 checks pass, #455 no-fight proven, pins faithful), merged. Closing.