Skip to content

fix(navigation): respect backLabel state in BackButton#1117

Open
Khaostica wants to merge 1 commit into
entrius:testfrom
Khaostica:fix/back-button-respects-back-label
Open

fix(navigation): respect backLabel state in BackButton#1117
Khaostica wants to merge 1 commit into
entrius:testfrom
Khaostica:fix/back-button-respects-back-label

Conversation

@Khaostica
Copy link
Copy Markdown

@Khaostica Khaostica commented May 13, 2026

Summary

BackButton read navigation state with the key backTo, but every caller across the codebase passes backLabel (20+ sites: MinerPRsTable, RepositoryPRsTable, HomePage, WatchlistPage, BountySidebar, etc.). The key mismatch meant the rendered label always fell through to the destination page's hardcoded label prop, so every caller's intent was silently dropped.

Visible symptom: opening a PR from a miner's Pull Requests tab shows "Back to Repositories" in the top-left even though the user came from the miner page. Click behavior was already correct (navigate(-1)), so this was confusing rather than functionally broken.

Fix: BackButton now reads state.backLabel and uses it as the label when present, falling back to the label prop otherwise. All 20+ existing callers benefit without any changes on their side.

Related Issues

None

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

Before:
image

After:
image

Additional Videos

Before:
https://github.com/user-attachments/assets/ec96b4be-9264-426d-855a-b7bf8262ab7a

After:
https://github.com/user-attachments/assets/a45a5a33-0e69-4478-9688-8e8a9ac79713

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked
  • Tested against the test API
  • npm run format and npm run lint:fix have been run
  • npm run build passes
  • Screenshots included for any UI/visual changes

BackButton read `state.backTo` from location state, but every caller passes
`state.backLabel` (20+ sites: MinerPRsTable, RepositoryPRsTable, HomePage,
WatchlistPage, BountySidebar, etc.). The key mismatch meant the displayed
label always fell back to the hardcoded `label` prop on the destination page,
so e.g. navigating to a PR from a miner's pull-requests tab rendered
"Back to Repositories" instead of "Back to <miner>".

Click behavior was already correct because of `navigate(-1)` when history
exists. Only the label was wrong, which made it confusing rather than
functionally broken.

Now reads `state.backLabel` and uses it as the label when present, falling
back to the `label` prop otherwise. All existing callers benefit without
needing to change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 13, 2026
@Khaostica Khaostica marked this pull request as ready for review May 13, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant