chore(components): remove dead user prop from MobileNavigation #28

Merged
varutasu merged 1 commit from convoy/cleanup-mobile-nav-dead-props into main 2026-05-26 23:53:29 -04:00
varutasu commented 2026-05-26 23:50:45 -04:00 (Migrated from github.com)

Summary

P3 polish convoy. components/MobileNavigation.js accepted a user prop but never read any field of it — the mobile bottom-bar items (Cards, Decks, Dashboard, Community, More) are statically configured and don't branch on auth state, role, or user identity. This PR removes the dead prop in the component signature + the redundant user={user} JSX attribute at the only active call site (components/Layout.js).

The cleanup was originally surfaced as R8 of fix-layout-default-user (PR #15, squash ca302a8) and deferred there to keep that convoy's scope tight; queued as cleanup-mobile-nav-dead-props in .convoys/ship-readiness.md § Queued convoys.

Audit (pre-edit)

  • rg '\buser\b' components/MobileNavigation.js → 1 hit before (line 5 destructure), 0 after.
  • rg "MobileNavigation" components/ pages/ --type js → only active caller is components/Layout.js line 598; components/Layout.js.backup also calls it but is a no-go-zone per .cursor/rules/no-go-zones.mdc § "Append-only / historical" and stays untouched.
  • Manual read of all 171 lines confirms user is never accessed (no user.email, user.role, user.id, no conditional render gated on user, no pass-through). The navigationItems array is fully static.

Verdict: prop is genuinely dead — the queue entry's premise holds. Safe to remove.

The change

Three-line diff across two files plus the convoy doc:

  • components/MobileNavigation.js line 5: ({ user, onMenuOpen })({ onMenuOpen }).
  • components/Layout.js lines 598-601: drop the user={user} JSX attribute, keep onMenuOpen={...}.
  • .convoys/cleanup-mobile-nav-dead-props.md: planning doc with audit, fix, risks, acceptance criteria (Background + Audit results + The fix + Out of scope + Verification plan + R1/R2 + Owns + As-shipped stub).

No new code. No refactors elsewhere in MobileNavigation.js (the pre-existing unused import { useState } from 'react' on line 3 is left for a future hygiene sweep per the convoy's "single-prop removal" scope rule).

Test plan

  • rg '\buser\b' components/MobileNavigation.js → 0 hits post-edit.
  • rg "MobileNavigation" components/ pages/ --type js → confirm each active call site passes only onMenuOpen (Layout.js verified; .backup intentionally not modified).
  • npm run lint → exit 1 with 128 problems (baseline preserved, no regression).
  • npm run test:run → 21/21 pass; test/components/Layout.test.js's logged-out-branch regression-lock (Gotcha #8) unaffected since it does not inspect MobileNavigation's prop shape.
  • npm run build skipped locally; relying on Vercel preview CI + Playwright smoke + visual-diff workflows on this PR.

Risks

  • R1 — A future per-user bottom-bar feature would need to re-add the prop. Hypothetical examples: an unread-count badge on a "Notifications" tab gated on user.id, or hiding "Community" for unauthenticated visitors. Accepted: re-adding a prop is one line when the feature actually lands; carrying dead state to hedge hypothetical features obscures the current surface and adds nothing.
  • R2 — components/Layout.js.backup still references the old prop shape. Accepted: the backup is a no-go-zone by repo rule, and is dead code by definition. Leaving it as a stale snapshot is the documented convention; the stale call disappears when the backup is eventually deleted in a separate convoy.

Follow-ups

  • Unused import { useState } from 'react' in components/MobileNavigation.js (pre-existing, out of scope here). Will get caught by a future lint-no-unused-imports rule or a generic hygiene sweep.
  • components/Layout.js.backup cleanup — separate convoy when ready.
  • May fold into god-component-split (P2 #13) if that convoy ever lands; this one ships first.

Made with Cursor

## Summary P3 polish convoy. `components/MobileNavigation.js` accepted a `user` prop but never read any field of it — the mobile bottom-bar items (Cards, Decks, Dashboard, Community, More) are statically configured and don't branch on auth state, role, or user identity. This PR removes the dead prop in the component signature + the redundant `user={user}` JSX attribute at the only active call site (`components/Layout.js`). The cleanup was originally surfaced as R8 of `fix-layout-default-user` (PR #15, squash `ca302a8`) and deferred there to keep that convoy's scope tight; queued as `cleanup-mobile-nav-dead-props` in `.convoys/ship-readiness.md` § Queued convoys. ## Audit (pre-edit) - `rg '\buser\b' components/MobileNavigation.js` → 1 hit before (line 5 destructure), 0 after. - `rg "MobileNavigation" components/ pages/ --type js` → only active caller is `components/Layout.js` line 598; `components/Layout.js.backup` also calls it but is a no-go-zone per `.cursor/rules/no-go-zones.mdc` § "Append-only / historical" and stays untouched. - Manual read of all 171 lines confirms `user` is never accessed (no `user.email`, `user.role`, `user.id`, no conditional render gated on `user`, no pass-through). The `navigationItems` array is fully static. Verdict: prop is genuinely dead — the queue entry's premise holds. Safe to remove. ## The change Three-line diff across two files plus the convoy doc: - `components/MobileNavigation.js` line 5: `({ user, onMenuOpen })` → `({ onMenuOpen })`. - `components/Layout.js` lines 598-601: drop the `user={user}` JSX attribute, keep `onMenuOpen={...}`. - `.convoys/cleanup-mobile-nav-dead-props.md`: planning doc with audit, fix, risks, acceptance criteria (Background + Audit results + The fix + Out of scope + Verification plan + R1/R2 + Owns + As-shipped stub). No new code. No refactors elsewhere in MobileNavigation.js (the pre-existing unused `import { useState } from 'react'` on line 3 is left for a future hygiene sweep per the convoy's "single-prop removal" scope rule). ## Test plan - [x] `rg '\buser\b' components/MobileNavigation.js` → 0 hits post-edit. - [x] `rg "MobileNavigation" components/ pages/ --type js` → confirm each active call site passes only `onMenuOpen` (Layout.js verified; .backup intentionally not modified). - [x] `npm run lint` → exit 1 with 128 problems (baseline preserved, no regression). - [x] `npm run test:run` → 21/21 pass; `test/components/Layout.test.js`'s logged-out-branch regression-lock (Gotcha #8) unaffected since it does not inspect MobileNavigation's prop shape. - [ ] `npm run build` skipped locally; relying on Vercel preview CI + Playwright smoke + visual-diff workflows on this PR. ## Risks - **R1 — A future per-user bottom-bar feature would need to re-add the prop.** Hypothetical examples: an unread-count badge on a "Notifications" tab gated on `user.id`, or hiding "Community" for unauthenticated visitors. Accepted: re-adding a prop is one line when the feature actually lands; carrying dead state to hedge hypothetical features obscures the current surface and adds nothing. - **R2 — `components/Layout.js.backup` still references the old prop shape.** Accepted: the backup is a no-go-zone by repo rule, and is dead code by definition. Leaving it as a stale snapshot is the documented convention; the stale call disappears when the backup is eventually deleted in a separate convoy. ## Follow-ups - Unused `import { useState } from 'react'` in `components/MobileNavigation.js` (pre-existing, out of scope here). Will get caught by a future `lint-no-unused-imports` rule or a generic hygiene sweep. - `components/Layout.js.backup` cleanup — separate convoy when ready. - May fold into `god-component-split` (P2 #13) if that convoy ever lands; this one ships first. Made with [Cursor](https://cursor.com)
vercel[bot] commented 2026-05-26 23:50:50 -04:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tcg-vault Ready Ready Preview, Comment May 27, 2026 3:50am

Request Review

[vc]: #TEl9tE3EwbBQxZpHEEYVQAzd8+UxsxKBf6ql54QvS8E=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJ0Y2ctdmF1bHQiLCJwcm9qZWN0SWQiOiJwcmpfRjZXOEVvRkd3Y0g3aWVGcnRvRlNlOXdVVkFhNSIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJ0Y2ctdmF1bHQtZ2l0LWNvbnZveS1jbGVhbnVwLTZmMzliMi1yYW5kYWxsLXN0aWxsd2VsbHMtcHJvamVjdHMudmVyY2VsLmFwcCJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vcmFuZGFsbC1zdGlsbHdlbGxzLXByb2plY3RzL3RjZy12YXVsdC9CUmF6Q2ZtenNOSGNlelFRZ0hHRVVSQm1zdlpRIiwicHJldmlld1VybCI6InRjZy12YXVsdC1naXQtY29udm95LWNsZWFudXAtNmYzOWIyLXJhbmRhbGwtc3RpbGx3ZWxscy1wcm9qZWN0cy52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIn1dLCJyZXF1ZXN0UmV2aWV3VXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3ZlcmNlbC1hZ2VudC9yZXF1ZXN0LXJldmlldz9vd25lcj12YXJ1dGFzdSZyZXBvPXRjZy12YXVsdCZwcj0yOCJ9 The latest updates on your projects. Learn more about [Vercel for GitHub](https://vercel.link/github-learn-more). | Project | Deployment | Actions | Updated (UTC) | | :--- | :----- | :------ | :------ | | [tcg-vault](https://vercel.com/randall-stillwells-projects/tcg-vault) | ![Ready](https://vercel.com/static/status/ready.svg) [Ready](https://vercel.com/randall-stillwells-projects/tcg-vault/BRazCfmzsNHcezQQgHGEURBmsvZQ) | [Preview](https://tcg-vault-git-convoy-cleanup-6f39b2-randall-stillwells-projects.vercel.app), [Comment](https://vercel.live/open-feedback/tcg-vault-git-convoy-cleanup-6f39b2-randall-stillwells-projects.vercel.app?via=pr-comment-feedback-link) | May 27, 2026 3:50am | <a href="https://vercel.com/vercel-agent/request-review?owner=varutasu&repo=tcg-vault&pr=28" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>
github-actions[bot] commented 2026-05-26 23:50:54 -04:00 (Migrated from github.com)

Pipeline Health

Build + CI gates

Gate Status
Vercel build (Preview) pass
CI: Lint pass
CI: Schema map fresh skipped
Preview smoke pass
Visual diff pass

Build runs on Vercel; this CI runs lint and schema-map drift only (no duplicate build).

Role reports

Role Status
Reviewer report pending
A11y audit pending
Design system audit pending

See individual comments above for details. This rollup updates automatically.

<!-- pipeline-rollup --> ## Pipeline Health ### Build + CI gates | Gate | Status | | --- | --- | | Vercel build (Preview) | ✅ pass | | CI: Lint | ✅ pass | | CI: Schema map fresh | ❌ skipped | | Preview smoke | ✅ pass | | Visual diff | ✅ pass | _Build runs on Vercel; this CI runs lint and schema-map drift only (no duplicate build)._ ### Role reports | Role | Status | | --- | --- | | Reviewer report | ⏳ pending | | A11y audit | ⏳ pending | | Design system audit | ⏳ pending | See individual comments above for details. This rollup updates automatically.
github-actions[bot] commented 2026-05-26 23:51:55 -04:00 (Migrated from github.com)

Visual Diff

Screenshots and diffs uploaded as artifacts: view run

If intentional changes: update snapshots locally with npx playwright test --project=visual --update-snapshots and commit.

## Visual Diff Screenshots and diffs uploaded as artifacts: [view run](https://github.com/varutasu/tcg-vault/actions/runs/26489635342) If intentional changes: update snapshots locally with `npx playwright test --project=visual --update-snapshots` and commit.
Sign in to join this conversation.
No description provided.