Repository navigation
feat(nav): put Reports in the sidebar - #750
Merged
Merged
Conversation
Reports had exactly one entry point in the app: a button on the Visibility
page. From Citations, Site Audit or anywhere else there was no route to it at
all — you had to go back to Visibility first, or type the URL.
The sidebar was already half-wired for this. Both sidebar.tsx and mobile-nav.tsx
carry a `Reports: t('reports')` label mapping and `nav.reports` exists in the
messages file; all three were dead, because no nav item ever referenced them.
This adds the missing item, and both navs pick it up from the shared config.
It goes in its own group rather than under Analytics or Optimization, because it
draws on both: of its thirteen sections `auditScore` comes from Site Audit and
the rest from the analytics surfaces, so filing it under either heading would
understate what it covers. It is also an output rather than a surface you
analyze on, which puts it after the two, matching the order of the work.
An untitled group had no divider of its own — the header is what separates the
titled ones — so its items read as the tail of the group above. Untitled groups
after the first now carry a rule in both the expanded and collapsed sidebar;
the existing groups render exactly as before.
No plan gate: `custom_reports` is in all four plans and nothing enforces it
server-side, so declaring a `requiredFeature` here would imply a lock that does
not exist.
The button on Visibility stays as a contextual shortcut.
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.
Summary
Reports had exactly one entry point in the app — a button on the Visibility page. From Citations, Site Audit, or anywhere else there was no route to
/dashboard/reportsat all: you had to navigate back to Visibility first, or type the URL.The sidebar was already half-wired for this. Both
sidebar.tsxandmobile-nav.tsxcarry aReports: t('reports')label mapping, andnav.reportsexists inmessages/en.json. All three were dead code, because no nav item ever referenced them. This adds the missing item; both navs read the same config, so the mobile menu needed no separate change.Why its own group
Reports draws on both existing groups. Of its thirteen sections,
auditScorecomes from Site Audit (Optimization) and the remaining twelve from the analytics surfaces:kpis, trend, shareOfVoice, competitors, topicPerformance, promptPerformance, mentionEvidence, queryFanout, aiTraffic, shoppingVisibility, auditScore, citations, citationEvidenceFiling it under either heading would understate what it covers. It is also an output rather than a surface you analyze on, which puts it after the two — matching the order of the work: look, optimize, report.
The group has no title on purpose: a one-item group headed "REPORTS" above an item labelled "Reports" is a header repeating its own contents.
One supporting fix
An untitled group had no divider of its own — the uppercase header is what separates the titled ones — so a trailing untitled group's items read as the tail of the group above it. Untitled groups after the first now carry a rule, in both the expanded and collapsed sidebar. The first group needs none (nothing precedes it), and the existing titled groups render exactly as before.
No plan gate
custom_reportsis included in all four plans, and nothing enforces it server-side —lib/actions/reports.tsperforms no feature check. Declaring arequiredFeatureon the nav item would imply a lock that does not exist, so it is left off. Whether report generation should be gated is a separate product question.The button on Visibility stays, now as a contextual shortcut rather than the only way in.
Related issue
None — came out of a question about where Reports belongs in the navigation.
Type of change
feat— New featureHow to test
/dashboard/reportsopens and the nav item takes the active highlight.«). The rule is still there, the icon is centred, and hovering shows the "Reports" tooltip.Checklist
feature/,fix/,chore/,docs/)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)