Repository navigation
refactor(citations): make the source scope a segmented control beside the table it scopes - #748
Merged
Merged
Conversation
… the table it scopes
The own/competitor/third-party filter was a dropdown at the end of the page's
filter bar, which misplaced it twice over.
It was the only control there with no label. Every other filter — Topic,
Prompt, Platform, Region — names itself above the input; this one leaned on a
"Sources" placeholder that its own default value ("All") covered up, so the bar
ended in a box reading "All" with nothing on screen saying all of what. It also
carried none of the sizing the others share, so it rendered taller and in a
larger type than its neighbours.
And it does not scope the page. The KPIs count every citation whatever it says,
and Competitor Gaps and Source Types ignore it outright — it narrows the Domains
and URLs tables and nothing else. Sitting among the page-wide filters it claimed
a reach it never had.
It now renders as a segmented control inside the Top Sources card, above the two
tabs it applies to and hidden on the two it does not, shaped like the date-range
control so the two read as the same kind of choice.
Also drops the `showCategoryToggles` prop, which existed only to hide this
dropdown on the single-URL page, and the unused Button import left behind by
#742.
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
The own/competitor/third-party filter on Citations was a dropdown at the end of the page's filter bar. It is now a segmented control inside the Top Sources card, next to the tables it actually scopes.
Two things were wrong with where it sat.
It was the only control in the bar with no label. Topic, Prompt, Platform and Region each name themselves above the input. This one leaned on a
Sourcesplaceholder that its own default value covered up — so the bar ended in a box reading "All", with nothing on screen saying all of what. It also carried none of the sizing its neighbours share (h-8 w-40 text-xs), so it rendered taller and in a larger type than the rest of the row.It does not scope the page. The KPI cards count every citation whatever it says, and Competitor Gaps and Source Types read the same data regardless — it narrows the Domains and URLs tables and nothing else. Sitting among the page-wide filters it claimed a reach it never had.
It now renders as a segmented control shaped like the date-range control, so the two read as the same kind of choice.
One deliberate deviation from the mockup
The design shows the control standing above all four tabs. It renders only on Domains and URLs — the two it applies to — because a control sitting over Competitor Gaps that does nothing when clicked is worse than the alternative. The cost is that the tab row shifts up by about 40px when you switch to Gaps or Source Types. Happy to make it always-visible if the mockup should be followed literally; it is a one-line change.
Also removed
showCategoryToggles, a prop that existed only to hide this dropdown on the single-URL page — with the control gone from the bar, the URL page needs nothing.Buttonimport left behind by fix(citations): replace source filters with client-side scope #742. Lint warnings drop from 8 to 7.Related issue
None — follow-up on the source filters merged in #742.
Type of change
refactor— Code change that neither fixes a bug nor adds a featureHow to test
/dashboard/citations/url) — its filter bar is unchanged, and never showed this control.Known inconsistency, left alone
The tab counts (
Domains (4300),URLs (11169)) are unfiltered totals, so picking Competitors leaves the heading unchanged while the table shrinks. Moving the control next to the tabs makes that more visible, but the fix is not obvious: the URL table is capped at 2,000 rows while the true unique-URL count is far higher, so switching the label to the filtered row count would trade one wrong number for another. Worth deciding separately.Checklist
feature/,fix/,chore/,docs/)yarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)