Fix the Lens hero CTA: "Review N fixes" pointed at a retired route - #772
Merged
Merged
Conversation
"Review N fixes" pointed at #/review. That page was retired when its apply lifecycle moved onto the Optimize detail pages, and primaryKeyFor aliases the hash to the Dashboard so old bookmarks do not 404. The button therefore re-rendered the page the reader was already on: the address bar changed and nothing else did. Critical Rule 24(c) is about exactly this, checking that a destination resolves rather than that a link exists. The CTA now builds its href from the top opportunity, which is the page that can apply the fix and the one the sub-line already names. The test pins the inverse of the defect rather than deleting anything: the href must be computed, and #/review must not appear as a link target. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Greptile, both valid. P1: the fix reintroduced the defect it removed, one analyzer along. relearn is not in DETAIL_ANALYZER_NAMES, so when a priced relearn cluster is the biggest contributor the CTA opened #/optimize/relearn, which renders "no relearn finding in the latest scan" under a button promising a fix. analyzerSurfaceHref now resolves each analyzer to a surface that actually renders it: its detail card, the Rules view for relearn, the Summarize view for summarize, and the ranked Optimize landing for anything with no surface of its own. P2: the test pattern-matched the source that builds the href, so it would have stayed green if the helper or the router later sent readers back to the Dashboard. It now lifts analyzerSurfaceHref, optimizeFindingHref and primaryKeyFor out of the page and RESOLVES each analyzer through the real router, asserting the primary view key is never 'dashboard'. Parametrised over all eleven detail analyzers plus the three without a detail card. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Greptile, valid: the two new parametrized tests shell out to node through _resolve, so without it they failed with FileNotFoundError instead of skipping. The file already carries the _node marker the other JS tests use; these now use it too. Verified by running the file with node off PATH: 28 passed, 36 skipped, no errors. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Reported from a live Lens (2026-09-25): clicking Review 8 fixes put
#/reviewin the address bar and left the reader on the Dashboard.Why
#/reviewis a retired page. Its apply lifecycle moved onto the Optimize detail pages and its summary onto the Dashboard's own band, andprimaryKeyForaliases the hash todashboardso old bookmarks do not 404. The Dashboard's own CTA was never repointed, so it navigated to an alias of the page it was already on.This is the shape Critical Rule 24(c) describes: the link existed, the route resolved, and the destination gave the reader nothing new.
Fix
The CTA builds its href from the biggest opportunity (
optimizeFindingHref(opps[0].name)), which is the page that can apply the fix and the one the button's own sub-line already names ("starts with the biggest one: Subagent"). With no priced opportunity the hero renders its empty state and never reaches the CTA.Tests
tests/unit/test_lens_dashboard_states.pygains a case pinning the inverse of the defect per Critical Rule 23: the href must be computed from the top opportunity, and#/reviewmust not appear as a link target anywhere in the file. Unit suite andtest_lens_module_parses.pygreen.🤖 Generated with Claude Code