Skip to content

fix: remove duplicate back links on detail pages now covered by Breadcrumb (#238) - #424

Open
Ayinkx wants to merge 1 commit into
AnchorNet-Org:mainfrom
Ayinkx:fix/issue-238-remove-duplicate-back-links
Open

fix: remove duplicate back links on detail pages now covered by Breadcrumb (#238)#424
Ayinkx wants to merge 1 commit into
AnchorNet-Org:mainfrom
Ayinkx:fix/issue-238-remove-duplicate-back-links

Conversation

@Ayinkx

@Ayinkx Ayinkx commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #238.

Both detail pages (src/app/anchors/[id]/page.tsx and src/app/settlements/[id]/page.tsx) already render a Breadcrumb (with a link back to the parent list) immediately above the detail component. AnchorDetail and SettlementDetail still rendered their own standalone ← Back to anchors / ← Back to settlements link at the top of their markup — a leftover from before Breadcrumb was added — resulting in two stacked "go back" affordances on every detail page.

What changed

  • Removed the leading <Link href="/anchors">← Back to anchors</Link> block from src/components/AnchorDetail.tsx.
  • Removed the leading <Link href="/settlements">← Back to settlements</Link> block from src/components/SettlementDetail.tsx.
  • Dropped the now-obsolete assertions on those links from AnchorDetail.test.tsx and SettlementDetail.test.tsx.
  • No change to data-loading, deactivate/execute/cancel, or ConfirmDialog behavior.

Call-site check

Per the issue's requirement, I confirmed neither component is used anywhere else without a Breadcrumb:

  • AnchorDetail — used only by src/app/anchors/[id]/page.tsx (renders Breadcrumb).
  • SettlementDetail — used only by src/app/settlements/[id]/page.tsx (renders Breadcrumb).

A grep across src/ found no other call sites. The src/app/anchors/[id]/loading.tsx and src/app/settlements/[id]/loading.tsx files render their own back-link during the loading state and don't render a Breadcrumb, so they are intentionally untouched (as the issue notes).

Note on the 404 branch

The not-found message inside each component still renders its inline Back to anchors / Back to settlements link (inside the error card). That link is context-specific ("this record was not found") and is not the redundant top-of-page link described in the issue, so it was kept.

Acceptance criteria

  • AnchorDetail and SettlementDetail no longer render their own "← Back to X" link.
  • The Breadcrumb on both detail pages remains the sole back-navigation affordance.
  • Existing tests are updated and continue to pass.

Test evidence

npx vitest run src/components/AnchorDetail.test.tsx src/components/SettlementDetail.test.tsx:

Test Files  1 failed | 1 passed (2)
     Tests  1 failed | 15 passed (16)

The single failure (disables Execute and Cancel while settlement action is pending in SettlementDetail.test.tsx) is a pre-existing, timing-sensitive test that also fails on clean main (verified via git stash); it is unrelated to this change.

Full-suite comparison against clean main (both run locally):

  • main: 10 test files failed, 48 tests failed / 577 passed
  • this branch: 9 test files failed, 47 tests failed / 578 passed

The remaining failures (e.g. src/lib/wallet.test.ts SecurityError localStorage spying) exist on main and are untouched by this PR.

npx tsc --noEmit: 15 pre-existing errors, none in the changed files (identical count on main).

npx eslint on the four changed files: 3 pre-existing @typescript-eslint/no-explicit-any errors on untouched lines (identical on main); no new warnings/errors introduced.

Checklist

  • CHANGELOG.md entry added under [Unreleased] (this PR changes user-facing behavior: removes the redundant link).
  • Tests updated for the change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the redundant "← Back to X" link now duplicated by Breadcrumb on the detail pages

1 participant