You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Admin nav: keep a folded item lit when a role may open only a later, nested tab #517
Follow-up from #514 (admin navigation restructure). Latent today: no role has this shape, and a nav test (every role lights every tab it may open, lib/admin/__tests__/nav.test.ts) fails the moment one does.
navFor(subject) (lib/admin/nav.ts) opens a folded item at the first tab the role may open by rewriting the item's href to that tab's href. isActive(item, pathname) then matches that rewritten href by prefix plus the item's also paths. For Members this is fine: the tabs are separate route roots (/admin/users, /admin/invites, /admin/affiliates) and also covers the siblings.
For an item whose tabs nest under the first tab's path — Rewind: /admin/rewind, /admin/rewind/playground, /admin/shares, /admin/rewind/settings — a role allowed only Playground and Settings would get href = /admin/rewind/playground, and /admin/rewind/settings would not light the item (the base prefix /admin/rewind/ is gone and is not in also).
Fix. When navFor rewrites href, keep the original href in also for that subject's copy of the item (or make isActive consult the item's children's hrefs as well as also). One unit test with a fixture role of that shape.
Activity