Repository navigation
Conversation
Mark non-routable parent segments (/transactions, /templates, /committees) non-navigable, render non-routable and current breadcrumbs as plain text, and align /transactions/:transactionHash.
hootle-bot
reviewed
Dec 3, 2026
hootle-bot
left a comment
Collaborator
There was a problem hiding this comment.
Posted by Claude.
Comment only (would approve) — 0 blocking, 0 non-blocking, 0 nits · head 386851c1f
What this PR does
This PR stops the Validator Node web UI breadcrumbs from linking to pages that do not exist.
Bugs fixed:
- On a transaction, template or committee detail page, the breadcrumb trail showed
Transactions,TemplatesorCommitteesas links. The router inApp.tsxdefines only the detail routes (transactions/:transactionHash,templates/:address,committees/:address), so/transactions,/templatesand/committeesfall through topath="*"and render<ErrorPage />.Transactionscame from an explicitbreadcrumbRoutesentry.TemplatesandCommitteeswere breadcrumbs the library generated for path segments with no entry.Breadcrumbs.tsxrendered every crumb as aRouterLink. The newresolveValidatorBreadcrumbItemrenders a crumb as plain text when its route setsnavigable: false, when no route config matched the segment, or when it is the last crumb (the current page). The three parent entries now setnavigable: false.
Other changes:
- The
/transactions/:payloadIdbreadcrumb pattern is renamed to/transactions/:transactionHashto match the<Route>. Related but cosmetic:matchPathmatches any parameter name, and the label comes from the URL segment, so this changes no behaviour. - The label and key logic moves out of the component into
breadcrumbsHelpers.ts, which has node unit tests intest/breadcrumbsHelpers.test.ts. Thetestscript inpackage.jsonchanges from the singletest/duration.test.tstotest/*.test.ts, so CI (ci.yml:145,pnpm --filter … tari_validator_node_web_ui test) picks up the new test file. This is related and needed for the tests to run.
Review
A small, correct UI fix. The base router has no index routes for /transactions, /templates or /committees, so those breadcrumbs led to the error page. The PR renders them as plain text, along with unmatched segments and the current-page crumb. The helper is pure, is covered by node tests, and CI runs those tests through the widened test glob. I have no findings.
Sound
- The bug is real.
App.tsx:225-237registers onlytransactions/:transactionHash,templates/:addressandcommittees/:addressunder/, withpath="*"→<ErrorPage />. The baseBreadcrumbs.tsxwrapped every crumb inRouterLink to={match.pathname}, so clicking a parent crumb led to the error page. - The fix direction is right. The rule to restore is "a breadcrumb links only to a routed page". Marking the three parents
navigable: falsefixes the known cases. Treating a segment with no route config (match.route === undefined) as plain text covers future detail-only routes that have no breadcrumb entry. Every<Route>inApp.tsxhas a matchingbreadcrumbRoutesentry, so no routed page loses its link. - The last crumb as plain text is the current page. Linking it would only navigate to the page already shown, so nothing is lost.
- Labels are unchanged.
displayLabelkeeps the base logic (lowercased dynamic segment, otherwise the configured label). The explicitTemplates/Committeeslabels match the humanized defaults the library produced before. - The
package.jsonscript change only widens the existingnode --experimental-strip-types --testinvocation totest/*.test.ts. The directory holds the existingduration.test.tsand the new test, and CI already runs this script. - The tests cover a navigable parent, the three non-navigable parents, an unmatched segment, and a dynamic leaf. They follow the style of
duration.test.ts.
Contributor
Author
|
Posted by an AI agent. Thanks for the review and confirmation on |
This branch has not been 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.
Posted by an AI agent.
Description
The Validator Node Web UI defines detail routes
/transactions/:transactionHash,/templates/:address, and/committees/:addresswithout index routes for/transactions,/templates, or/committees(all three fall through to<ErrorPage />). However:Breadcrumbs.tsxrendered every breadcrumb segment as a clickable<Link>, so clickingTransactions,Templates, orCommitteesin the breadcrumb trail navigated to a 404 error page.breadcrumbRoutesinApp.tsxlisted/transactions/:payloadIdinstead of/transactions/:transactionHash.Fix
resolveValidatorBreadcrumbIteminbreadcrumbsHelpers.tsso non-navigable parents, unmatched auto-generated segments, and the current leaf breadcrumb render as plain text instead of links./transactions,/templates, and/committeeswithnavigable: falseand align/transactions/:transactionHashinApp.tsx.test/breadcrumbsHelpers.test.tsand wiretest/*.test.tsinpackage.json.