Skip to content

[scanner] DocsSidebar.tsx: remove unreachable Legacy Components group (empty LEGACY_PROJECTS, uncalled renderLegacyGroup, dangling /docs/legacy-components href) #149

Description

@hivecommons-hive

Finding

src/components/docs/DocsSidebar.tsx (main @ 5fffc7e) still carries the "Legacy Components" sidebar group inherited from the previous docs site, but nothing on this site can ever render it:

  • line 44: const LEGACY_PROJECTS = [] — hard-coded empty, with the comment "No legacy projects on the Hive Commons docs site."
  • line 467: renderLegacyGroup is defined but never called — renderFullSidebar only maps PRIMARY_PROJECTS. npm run lint on main reports it: 467:9 warning 'renderLegacyGroup' is assigned a value but never used (@typescript-eslint/no-unused-vars).
  • lines 163–166 and 229–238: two effects add LEGACY_GROUP_KEY ('__legacy') to the navCollapsed set — collapse state for a group that is never in the DOM. The second effect runs setCollapsed on every pathname change under a general section.
  • line 80: LEGACY_OVERVIEW_HREF = '/docs/legacy-components' — there is no such page under docs/content/; check-internal-links doesn't see it because it only scans content, not TSX.
  • ALL_PROJECTS = [...PRIMARY_PROJECTS, ...LEGACY_PROJECTS] is therefore identical to PRIMARY_PROJECTS.

Net effect: ~70 lines of unreachable JSX and state plumbing, a dangling internal href, and a persistent lint warning that masks real no-unused-vars hits in this file.

Recommendation

Remove the legacy group entirely from DocsSidebar.tsx: LEGACY_PROJECTS, ALL_PROJECTS (use PRIMARY_PROJECTS directly), LEGACY_GROUP_KEY, LEGACY_OVERVIEW_HREF, renderLegacyGroup, the legacyIds block in the initial-collapse effect, and the "Keep legacy group collapsed" effect. GENERAL_SECTION_PATH_REGEX stays — getGeneralSectionSlugFromPath still uses it.

npm run lint, npm run type-check and npm test must stay green, and main's warning count drops from 45 to 44.

Disjoint from open PRs #145 (EditPageLink.tsx) and #148 (adds src/__tests__/DocsSidebar.behavior.test.tsx only; it does not reference the legacy group).


Filed by scanner agent (ACMM L5 — hold-gated mode)


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 5fffc7e

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerCreated by Hive for agent-filed issue provenancebugSomething isn't workinghive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedhive/hosted-available-oke-11-placeholder-r05xCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions