Repository navigation
chore(admin): delete AnalyticsNavLink, which nothing mounts - #863
Merged
Merged
Conversation
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
Bot
temporarily deployed
to
sahajcloud / SahajCloud-pr-863
September 29, 2026 03:45
Destroyed
|
🚅 Deployed to the SahajCloud-pr-863 environment in sahajcloud
1 service not affected by this PR
|
This was referenced Sep 29, 2026
sydevs-bot
marked this pull request as ready for review
September 29, 2026 03:57
sydevs-bot
enabled auto-merge
September 29, 2026 03:57
Contributor
Author
|
Adversarial review skipped: 2 file(s), 34 changed line(s), under 🤖 sydevs dispatcher |
Ardnived
approved these changes
Sep 29, 2026
This was referenced Sep 29, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/components/admin/AnalyticsNavLink.tsx. Nothing imports it, it is absent from thegenerated import map, and
payload.config.ts:128registersAdminNavLinksinstead.AdminNavLinks+NavLinkare the generalisation that replaced it — same href, same label,same active check — mounted from
payload.config.ts:128andAtlasSidebar.tsx:31.docs/rules/admin-ui.mdsnippet, 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:
shows Dashboard and Analytics
Analytics link still resolves, and renders active
Test results
.claude/skills/pr-prep/check.sh— lint,tsc --noEmit,tsc -p tsconfig.test.json, 2236 unit tests in 165 filespnpm 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
views:line lists onlyanalyticswhile the config also registersmap. The ticket already ruled on this: the snippetis illustrative and omits
providers,Nav,graphicsand themapview by design, so itneeds to stop naming things that are not there, not to grow. Growing it here would widen the PR
past its criteria.
outside this ticket's scope:
RulesEditor(named three times, exists nowhere), and twosrc/components/admin/paths that lost their folder-plus-barrel spelling.InactiveAccountAlertwas removed or never built — isunanswered. 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:230was the only remaining reference to the deletedcomponent, so leaving it would have failed the ticket's
git grepcriterion.Why nothing caught this. No knip, ts-prune or unimported config exists.
@typescript-eslint/no-unused-varsis file-scoped, so an orphaned module has no unused symbolinside it.
tests/unit/lib-boundary.spec.tsis the repo's only consumer-counting guard and itsroot is
src/lib/, notsrc/components/.tests/unit/client-bundle-safety.spec.tsdid walk thefile —
clientEntries()treats every'use client'file as a graph root — but it asks what anentry imports, never what imports it, so a root passes by construction.
Relationship to #851. That audit named
AnalyticsNavLink.tsx:8's hard-codedpathname === '/admin/analytics'twice as a site that breaks on a changedroutes.admin. It doesnot, because it never runs.
NavLink.tsx:13compares against the href it links to, so a movedroute 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.tsand one new spec, none ofthem this file.
Review pass.
/simplify(two agents, reuse + simplification and altitude + efficiency) and thedeterministic
comment-lintover added comments.pr-review-toolkitis 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