Navbar: single create (+) button left of the avatar with New repo / Import / New org dropdown; drop redundant CTAs #466
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#466
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?
Navbar create-button: one "+" entry point for repository/org creation
What's requested
Add a create ("+" / plus) button to the site navbar, positioned immediately left of the identity menu (avatar/initials), opening a dropdown with exactly three items:
/new/import/orgs/newWith that entry point in place, remove the now-redundant buttons:
importlink (App.jsx site nav),New repositorybutton on the explore page toolbar (Repos.jsx Repositories toolbar),New repository/Import repositorybuttons on the profile (Owners.jsx) header — note Owners.jsx also currently carries theNew organizationbutton; that one moves into the dropdown too.The provided plus icon SVG (referenced in the parent task; implementer may inline it) is the button glyph.
Evidence (current tree)
web/src/App.jsx— site nav renders<A href="/import">import</A>as a primary nav item; the right cluster ends withNotificationTray→ theme toggle →IdentityMenu(signed-in only, gatednav().showIdentity).web/src/pages/Repos.jsx(~line 552) — Repositories toolbar right-anchors abtn primary"New repository" CTA, gated oncanWrite().web/src/pages/Owners.jsx(~line 148) — Owners page header carries "New repository" (canWrite-gated), "New organization" (#348 gate), and "Import repository" buttons.web/src/components/IdentityMenu.jsximplements the full popover contract (document-level outside-click close removed inonCleanup, Escape + focus return, arrow-key item walk, Tab-out dismiss, role menu/menuitem, no toggle-fight because the trigger lives inside the root). Reuse that pattern — either extract a shared menu primitive or clone the component, implementer's call.Architecture notes
nav().showIdentity, i.e. signed-in): an anonymous visitor has nothing to create and the three targets all assume auth. Keep the signed-out navbar unchanged.navModellives inweb/src/lib/identity.js— extend the model (e.g. ashowCreateflag + hrefs) there rather than branching inline in App.jsx, matching the existing convention.canWrite(); Owners.jsx gates New org on logged-in writer). The navbar dropdown should show all three for any signed-in user; the target pages already enforce permission server-side and render their own errors — matching the destination page's own gate client-side in the menu is acceptable if trivial, implementer's call, but do not invent a new permission probe (law 6: no new requests).ml-auto flex items-center gap-2); check the 390px header budget (#273): the cluster currently fits because the avatar dropped its btn box — the new trigger should be a compact icon button (plus glyph only, no text label, witharia-label="Create new"and atitle) so it adds ~32px at most./importfrom the primary nav does NOT remove the import page or route —/importstays reachable from the dropdown.max-width: calc(100vw - 1rem)per the mobile-popover rule.Acceptance criteria
aria-label+ tooltip set./new), Import repository (/import), New organization (/orgs/new); selecting an item navigates and closes the menu.importlink removed from the primary site nav;/importpage and route untouched.Icon source (verbatim from the user) — save as the + trigger icon,
1em/currentColorper #465's mechanism:Fix ready for review: #476 (branch fix/issue-466). Create (+) button left of the identity menu, showCreate-gated, three router links; import link / toolbar CTA / Owners CTAs removed; /import route kept. node --test 1009 pass / 0 fail; vite + esbuild green.
REVIEW: PR #476 (fix/issue-466) — verified in scratch worktree /tmp/pr476 (removed afterward); main worktree untouched (still clean).
FINDINGS — all 9 checks pass:
TESTS (scratch, node_modules symlinked from main): node --test web/test/unit/*.test.js = 1012 tests, 1009 pass / 0 fail / 3 skipped (server-smoke skips, no server up) — matches PR claim. vite build + esbuild SDK bundle green. Note: default :8080 run shows 2 smoke failures because a foreign live 'walhub serve' answers :8080 /healthz 200 but / 401 — left untouched per instructions; environmental, unrelated to PR. No browser check performed (per review instructions; popover is a line-level clone of the shipped IdentityMenu contract).
NON-BLOCKING OBSERVATION (pre-existing, out of scope — NOT fixed): CreateMenu.jsx toggle focuses the first item under 'if (!getOpen())' after setOpen, which reads the NEW value, so focus-on-open never fires (fires only on close, into an unmounting menu). IdentityMenu.jsx has the identical line, so the 'matches IdentityMenu' criterion holds bug-for-bug; fixing one side would diverge them. Suggest a follow-up issue covering both menus, not this PR.
No code pushed (nothing to fix). Main worktree left clean.
MERGE RECOMMENDATION: ready to merge.
Fixed by PR #476 (review clean — all 9 checks pass; focus follow-up filed as #477), merged. Closing.