Skip to content

chore(admin): delete AnalyticsNavLink, which nothing mounts - #863

Merged
sydevs-bot merged 1 commit into
mainfrom
claude/chore-860-delete-analytics-nav-link
Sep 29, 2026
Merged

sydevs-bot merged 1 commit into
mainfrom
claude/chore-860-delete-analytics-nav-link

Conversation

@sydevs-bot

Copy link
Copy Markdown
Contributor

Summary

  • Deletes src/components/admin/AnalyticsNavLink.tsx. Nothing imports it, it is absent from the
    generated import map, and payload.config.ts:128 registers AdminNavLinks instead.
  • AdminNavLinks + NavLink are the generalisation that replaced it — same href, same label,
    same active check — mounted from payload.config.ts:128 and AtlasSidebar.tsx:31.
  • Corrects the docs/rules/admin-ui.md snippet, which named the dead component and, beside it,
    InactiveAccountAlert — a component that exists nowhere in the repo.

No behaviour changes. The component rendered nowhere, so no admin surface can move.

Preview

Nothing to see — the deleted file mounted nowhere, so the admin UI is byte-identical. Links to
confirm that, rather than to inspect a change:

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, tsc --noEmit, tsc -p tsconfig.test.json, 2236 unit tests in 165 files
  • Targeted specs: none — the deleted file had no spec, and no spec referenced it
  • Build: N/A — CI does not build; Railway builds the preview
  • pnpm generate:importmap && git diff --exit-code 'src/app/(payload)/admin/importMap.js': ✓ unchanged.
    That unchanged map is the proof the deleted component was registered nowhere.

Manual verification

Nothing. The import-map check above replaces the admin-panel run the ticket first asked for.

Notes for reviewer

  • One finding dismissed. A review pass flagged that the snippet's views: line lists only
    analytics while the config also registers map. The ticket already ruled on this: the snippet
    is illustrative and omits providers, Nav, graphics and the map view by design, so it
    needs to stop naming things that are not there, not to grow. Growing it here would widen the PR
    past its criteria.
  • Follow-up filed: docs(admin-ui): four stale component references, and no guard that would catch them #862. The same review found three more stale references in the same file,
    outside this ticket's scope: RulesEditor (named three times, exists nowhere), and two
    src/components/admin/ paths that lost their folder-plus-barrel spelling.
  • The ticket's open question — whether InactiveAccountAlert was removed or never built — is
    unanswered. The clone is shallow, so history cannot say. Deleted per the ticket's own
    instruction absent a correction.
Detail

Why the doc fix ships with the deletion rather than separately. The two acceptance criteria
sets are the same finding: admin-ui.md:230 was the only remaining reference to the deleted
component, so leaving it would have failed the ticket's git grep criterion.

Why nothing caught this. No knip, ts-prune or unimported config exists.
@typescript-eslint/no-unused-vars is file-scoped, so an orphaned module has no unused symbol
inside it. tests/unit/lib-boundary.spec.ts is the repo's only consumer-counting guard and its
root is src/lib/, not src/components/. tests/unit/client-bundle-safety.spec.ts did walk the
file — clientEntries() treats every 'use client' file as a graph root — but it asks what an
entry imports, never what imports it, so a root passes by construction.

Relationship to #851. That audit named AnalyticsNavLink.tsx:8's hard-coded
pathname === '/admin/analytics' twice as a site that breaks on a changed routes.admin. It does
not, because it never runs. NavLink.tsx:13 compares against the href it links to, so a moved
route breaks both halves together instead of one silently. No ordering against #859 is needed —
that PR touches src/lib/utilities/adminUrl.ts, src/payload.config.ts and one new spec, none of
them this file.

Review pass. /simplify (two agents, reuse + simplification and altitude + efficiency) and the
deterministic comment-lint over added comments. pr-review-toolkit is not installed here.
Security review skipped: no changed path matches securityReview.triggerPattern.

Closes #860

🤖 Written by the sydevs autonomous loop — see what this is

🤖 Generated with Claude Code

https://claude.ai/code/session_01WiqrCnUFMKzeS2HgqjAbZy


Generated by Claude Code

The component was unreachable: no import, no entry in the generated admin
import map, and `payload.config.ts` registers `AdminNavLinks` in
`beforeNavLinks` instead. `AdminNavLinks` + `NavLink` generalise it — same
href, same label, same active check — and two sites mount that pair.

It read as live admin UI, so #851's audit named its hard-coded
`pathname === '/admin/analytics'` twice as a route-unsafe site. `NavLink`
compares against the href it links to, so a moved `routes.admin` breaks both
halves together instead of one silently.

The `admin-ui.md` snippet named it, and named `InactiveAccountAlert` beside
it — a component that exists nowhere in the repo. Both lines and the prose
now match what the config registers.

Closes #860

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WiqrCnUFMKzeS2HgqjAbZy
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-863 September 29, 2026 03:45 Destroyed
@railway-app

railway-app Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-863 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Sep 29, 2026 at 3:47 am UTC
1 service not affected by this PR
  • mailpit

@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Adversarial review skipped: 2 file(s), 34 changed line(s), under review.skipWhen. Say @sydevs-bot review to force one.

🤖 sydevs dispatcher

@sydevs-bot
sydevs-bot added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit aa72da9 Sep 29, 2026
22 checks passed
@sydevs-bot
sydevs-bot deleted the claude/chore-860-delete-analytics-nav-link branch September 29, 2026 04:32

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-863 — a4ebd3af Deployed Sep 29, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

chore(admin): delete AnalyticsNavLink, which nothing mounts

3 participants