Repository navigation
fix(content): keep filters reachable on zero results, and allow deleting selections - #733
Merged
Merged
Conversation
…ing selections Two problems on the Content page, both about a list the reader cannot get out of. Selecting a filter combination that matched nothing unmounted the whole content branch, filter bar included, and replaced it with the "No content opportunities yet" + Generate card. The filter values live in React state, so the reader was stuck with no control on screen to undo their own choice and an empty state that was simply wrong — data existed, the filter just matched nothing. Only the unfiltered view can say a brand truly has no opportunities, so the Generate card is now gated on that, and the no-matches message carries a Clear filters button. The bulk bar offered send, done and dismiss but no way to remove anything. Dismissing hides a row behind a status filter and leaves it in the table, which is no help to a brand carrying hundreds of stale suggestions — across production the open list averages 147 rows per brand against 114 dismissed in total. Delete now sits last in the bar, behind a confirmation that states the count and warns separately when the selection includes a generated brief: the brief lives on the opportunity row, so it goes with it, and brief_usage.opportunity_id is ON DELETE SET NULL, so quota already spent stays spent. Closes #660 Closes #731
gkhngyk
force-pushed
the
feature/660-731-content-filters-and-bulk-delete
branch
from
August 18, 2026 10:22
4dfa853 to
6dbd8a6
Compare
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
Two problems on the Content page, both about a list the reader cannot get out of. They share the same file and the same bulk bar, so they land together.
Zero-result filters hid the filters themselves (#660). Selecting a filter combination that matched nothing unmounted the whole content branch — filter bar included — and replaced it with the "No content opportunities yet" + Generate card. The filter values live in React state, so the reader was left with no control on screen to undo their own choice, and the empty state was wrong: data existed, the filter just matched nothing.
Only the unfiltered view can say a brand truly has no opportunities, so the Generate card is now gated on
!hasActiveFilters. When filters are active the header, KPIs, filter bar and table stay rendered, and the existing no-matches message — previously unreachable in this state — now carries a Clear filters button.Nothing could be removed (#731). The bulk bar offered send, done and dismiss. Dismissing only moves a row behind a status filter and leaves it in the table, which is no help to a brand carrying hundreds of stale suggestions: across production the open list averages 147 rows per brand, against 114 dismissed in total across every brand.
Delete now sits last in the bar and is the only destructive-styled trigger there. It opens a confirmation stating the count, following the same
Dialogshape as Dismiss all.Two details worth calling out in review:
brief_usage.opportunity_idisON DELETE SET NULL, so the usage record survives and quota already spent stays spent — deleting must not hand back an allowance.assertOpportunitiesAccess(ids, req.user.id), exactly likePOST /bulk/statusnext to it, so deletion is available to any org member. Content: let selected opportunities be deleted, with a confirmation #731 raised whether permanent deletion should instead be admin/manager only. That is a product decision and is deliberately not made here; say the word and it is a one-line change.Single-row deletion is intentionally out of scope — on a list this long a per-row delete invites accidents.
Related issue
Closes #660
Closes #731
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
Filters (#660)
dismissedon a brand that has none).Delete (#731)
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)yarn buildand the server test suite (276 tests) also pass locally.