feat(nav): collapse settings, theme and log out into a user menu #63

Merged
jfro merged 2 commits from feat/59-user-menu into main 2026-11-14 01:09:02 +00:00
Owner

What changed

Same branch the Prover passed (feat/59-user-menu @7fc4950), now pushed as PR #63 into main as Jeremy asked, with screenshots (C11). Forgejo CI is green on it, and it still merges cleanly after #60's merge (e07248f).

Fixes #59

Red, then green

  • The signed-in header has a user menu (avatar + name button) holding Settings, the theme toggle and Log out, with the app version in its footer; signed-out keeps the theme toggle and no menu.: export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix test test/lamplighter_web/components/user_menu_test.exs
    • fails on the base (169940c): exit 1
    • passes on the branch (81314e7): exit 0

Checks

  • mix precommit (compile --warnings-as-errors, format, full test suite) passes on feat/59-user-menu. (Upper Wolfjaw): export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix precommit 2>&1 | tail -3, exit 0
  • In real Chromium at 390px and 1280px, the user menu opens from the avatar button (aria-expanded true), and Escape, a click outside, picking Settings, and a patch link each close it; the theme toggle inside it switches to dark. (Upper Wolfjaw): timeout 120 ~/.venvs/pw/bin/python /home/peak/work/lamplighter-v1-2/checks/user_menu_browser.py, exit 0
  • Nye's real-browser check of feat/59-user-menu @7fc4950 (Chromium, dev server :4127) passes at 390px and desktop: Enter opens the menu, Tab goes Settings → theme (system/light/dark) → Log out, Escape closes, the menu stays open across a LiveView re-render and a theme pick, it fits the viewport in dark theme, and Log out signs out. (Nye): cd /tmp && python3 /home/peak/work/lamplighter-v1-2/review59/nye_check.py, exit 0
  • Upper Wolfjaw's Playwright check reproduces on my computer against feat/59-user-menu @7fc4950: Escape, click-away, Settings navigation and a patch link all close the menu, and the theme toggle switches, at 390px and desktop. (Nye): cd /tmp && python3 /home/peak/work/lamplighter-v1-2/review59/uw_check.py, exit 0
  • Read the diff against main and ran the full suite myself (893 tests pass at 7fc4950, clean tree); existing #current-user/#nav-settings tests still hold. Untested: browser behavior (relied on C3/C7/C8), the named a11y nits, Safari/touch. (Prover): export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && cd /home/peak/work/lamplighter-v1-2/lamplighter && mix test, exit 0
  • PR #63 is open on git.knope.dev from feat/59-user-menu @7fc4950 into main, mergeable after #60's merge, with the 390px and desktop screenshots (closed and open) in a comment. (Upper Wolfjaw): curl -sf --noproxy '*' https://git.knope.dev/api/v1/repos/jfro/lamplighter/pulls/63 | jq -e '.state=="open" and .mergeable==true and .head.ref=="feat/59-user-menu" and (.head.sha|startswith("7fc4950")) and .base.ref=="main"' && curl -sf --noproxy '*' https://git.knope.dev/api/v1/repos/jfro/lamplighter/issues/63/comments | jq -e '[.[].body|contains("![390-open](") and contains("![desktop-open](") and contains("![390-closed](") and contains("![desktop-closed](")]|any', exit 0
  • Read the 3-file diff against the merge base and re-ran the user-menu tests (6 pass); the full suite and browser checks (C2, C3, C7, C8) back it. Untested: the named a11y nits (no aria-haspopup, no focus return on Escape, Tab past Log out leaves the menu open), Safari, touch. (Prover): export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && cd /home/peak/work/lamplighter-v1-2/lamplighter && mix test test/lamplighter_web/components/user_menu_test.exs, exit 0

Risks

Nye's optional a11y nits aren't taken: tabbing past Log out leaves the menu open, the button has no aria-haspopup, and Escape doesn't move focus back to the button. Safari and touch aren't tested.

Prover

Passed (Sonnet): Read the 3-file diff against the merge base and re-ran the user-menu tests (6 pass); the full suite and browser checks (C2, C3, C7, C8) back it. Untested: the named a11y nits (no aria-haspopup, no focus return on Escape, Tab past Log out leaves the menu open), Safari, touch.

Every command above was run by Fortysix's Basecamp itself, on the branch named.

## What changed Same branch the Prover passed (feat/59-user-menu @7fc4950), now pushed as PR #63 into main as Jeremy asked, with screenshots (C11). Forgejo CI is green on it, and it still merges cleanly after #60's merge (e07248f). Fixes #59 ## Red, then green - The signed-in header has a user menu (avatar + name button) holding Settings, the theme toggle and Log out, with the app version in its footer; signed-out keeps the theme toggle and no menu.: `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix test test/lamplighter_web/components/user_menu_test.exs` - fails on the base (169940c): exit 1 - passes on the branch (81314e7): exit 0 ## Checks - mix precommit (compile --warnings-as-errors, format, full test suite) passes on feat/59-user-menu. (Upper Wolfjaw): `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix precommit 2>&1 | tail -3`, exit 0 - In real Chromium at 390px and 1280px, the user menu opens from the avatar button (aria-expanded true), and Escape, a click outside, picking Settings, and a patch link each close it; the theme toggle inside it switches to dark. (Upper Wolfjaw): `timeout 120 ~/.venvs/pw/bin/python /home/peak/work/lamplighter-v1-2/checks/user_menu_browser.py`, exit 0 - Nye's real-browser check of feat/59-user-menu @7fc4950 (Chromium, dev server :4127) passes at 390px and desktop: Enter opens the menu, Tab goes Settings → theme (system/light/dark) → Log out, Escape closes, the menu stays open across a LiveView re-render and a theme pick, it fits the viewport in dark theme, and Log out signs out. (Nye): `cd /tmp && python3 /home/peak/work/lamplighter-v1-2/review59/nye_check.py`, exit 0 - Upper Wolfjaw's Playwright check reproduces on my computer against feat/59-user-menu @7fc4950: Escape, click-away, Settings navigation and a patch link all close the menu, and the theme toggle switches, at 390px and desktop. (Nye): `cd /tmp && python3 /home/peak/work/lamplighter-v1-2/review59/uw_check.py`, exit 0 - Read the diff against main and ran the full suite myself (893 tests pass at 7fc4950, clean tree); existing #current-user/#nav-settings tests still hold. Untested: browser behavior (relied on C3/C7/C8), the named a11y nits, Safari/touch. (Prover): `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && cd /home/peak/work/lamplighter-v1-2/lamplighter && mix test`, exit 0 - PR #63 is open on git.knope.dev from feat/59-user-menu @7fc4950 into main, mergeable after #60's merge, with the 390px and desktop screenshots (closed and open) in a comment. (Upper Wolfjaw): `curl -sf --noproxy '*' https://git.knope.dev/api/v1/repos/jfro/lamplighter/pulls/63 | jq -e '.state=="open" and .mergeable==true and .head.ref=="feat/59-user-menu" and (.head.sha|startswith("7fc4950")) and .base.ref=="main"' && curl -sf --noproxy '*' https://git.knope.dev/api/v1/repos/jfro/lamplighter/issues/63/comments | jq -e '[.[].body|contains("![390-open](") and contains("![desktop-open](") and contains("![390-closed](") and contains("![desktop-closed](")]|any'`, exit 0 - Read the 3-file diff against the merge base and re-ran the user-menu tests (6 pass); the full suite and browser checks (C2, C3, C7, C8) back it. Untested: the named a11y nits (no aria-haspopup, no focus return on Escape, Tab past Log out leaves the menu open), Safari, touch. (Prover): `export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && cd /home/peak/work/lamplighter-v1-2/lamplighter && mix test test/lamplighter_web/components/user_menu_test.exs`, exit 0 ## Risks Nye's optional a11y nits aren't taken: tabbing past Log out leaves the menu open, the button has no aria-haspopup, and Escape doesn't move focus back to the button. Safari and touch aren't tested. ## Prover Passed (Sonnet): Read the 3-file diff against the merge base and re-ran the user-menu tests (6 pass); the full suite and browser checks (C2, C3, C7, C8) back it. Untested: the named a11y nits (no aria-haspopup, no focus return on Escape, Tab past Log out leaves the menu open), Safari, touch. Every command above was run by Fortysix's Basecamp itself, on the branch named.
jfro added this to the v1.2 milestone 2026-11-14 00:15:37 +00:00
The signed-in user's avatar and name now open a dropdown holding
Settings, the theme toggle and Log out, with the running version in
its footer. Escape, a click outside or picking Settings closes it.

Closes #59
fix(nav): close the user menu when the page navigates
All checks were successful
CI / test (pull_request) Successful in 1m28s
7fc49504e3
LiveView's link handling swallows the click before phx-click-away sees
it, so patch links (like the dashboard's summary tiles) left the menu
open. Popovers now keep their close command in data-close-on-navigate
and app.js runs it on phx:page-loading-start.
Author
Owner

Screenshots at feat/59-user-menu @7fc4950 (Chromium):

390-closed
390-closed

390-open
390-open

desktop-closed
desktop-closed

desktop-open
desktop-open

Screenshots at feat/59-user-menu @7fc4950 (Chromium): **390-closed** ![390-closed](https://git.knope.dev/attachments/11d215fd-5a71-453a-a02b-b92a71111e24) **390-open** ![390-open](https://git.knope.dev/attachments/2cc0ea2c-4fee-4db6-b978-3858f1f07857) **desktop-closed** ![desktop-closed](https://git.knope.dev/attachments/8778d982-987e-491f-9e9e-0dd85f8c2bf5) **desktop-open** ![desktop-open](https://git.knope.dev/attachments/c61d5fef-b5a4-4511-a6e3-198e2d536eac)
jfro merged commit e6c968ea01 into main 2026-11-14 01:09:02 +00:00
jfro deleted branch feat/59-user-menu 2026-11-14 01:09:02 +00:00
Sign in to join this conversation.
No description provided.