- Move completed plan files to .plans/done/ - Move 18 open plan files to .plans/open/ - Update .gitignore to exclude .verified_plans temp file - Verified all 18 open plans still describe unimplemented issues
2.6 KiB
Issue #124: Nav sidebar clicks don't navigate between views
Summary
The NcAppNavigationItem components in App.vue use @click handlers to call router.push(),
but the component internally renders an <a href="#"> that intercepts the click event, navigating
to # (root hash) before the Vue click handler fires. The fix is to use NcAppNavigationItem's
built-in :to prop which renders the element as a <router-link>, handling navigation natively.
Plan
Step 1: Modify src/App.vue navigation items
For each NcAppNavigationItem:
- Replace
@click="navigate('routeName')"with:to="{ name: 'routeName' }" - Remove the
:activebinding sinceNcAppNavigationItemauto-detects active state from:to - Keep icon template slots unchanged
Step 2: Remove the navigate() function and useRouter import
Since navigation is now handled by the :to prop:
- Remove
const router = useRouter() - Remove the
navigate()function - Remove
useRouterfrom the import (keepuseRoutesincecurrentRoutestill needs it)
Step 3: Keep currentRoute if needed, OR remove
Actually, with :to prop, NcAppNavigationItem automatically sets active state. But for routes
like member-detail that should highlight "Mitglieder", we need the :active prop for parent
route matching. The :to prop only auto-activates on exact route match.
Decision: Keep :active bindings for nav items that have sub-routes (Mitglieder, Familien, Lager)
to handle parent-route highlighting. For items with no sub-routes (Beiträge, Berichte, Audit-Log,
Einstellungen), :to auto-active is sufficient — but for consistency, keep all :active bindings.
Actually, let me reconsider: the :to prop with vue-router uses router-link-active class which
matches prefix. So /members/5 would still match { name: 'members' } route... but only if
the path matches. Since named routes have exact paths, it depends on router-link behavior.
Safest approach: Keep :active bindings for items with child routes, remove them for simple routes.
No -- for consistency and zero regression risk, keep ALL :active bindings.
Step 4: Verify build compiles
Run npm run build to ensure no errors.
Acceptance Criteria Checklist
- Each
NcAppNavigationItemuses:toprop with the correct route object - No
@click="navigate(...)"handlers remain on navigation items - The
navigate()function is removed - The
useRouterimport is removed (no longer needed) :activebindings are preserved for parent-route highlighting- Build succeeds without errors
- All existing routes still work (no route names changed)