feat(giveback): add Causes tab, remove obsolete Campaign tab#6250
Merged
Conversation
New "Causes" tab to manage your backed causes: your picks sit up top as compact rows, with a category-filterable discovery grid below. Add/remove auto-saves via a new toggleAndSave on useGivebackCauseSelection, which reads the freshest selection through a ref (no stale closure on rapid toggles) and rolls back the optimistic change if the save fails. - GivebackCauseCard gains a buttonToggle variant (corner + toggles, card isn't a big tap target) for the discovery grid - Shared GivebackTabHeading primitive for consistent tab headers - GivebackFilterChip restyled as a bordered tag pill - Tab nav now scrolls horizontally on narrow screens The old 'why'/Campaign tab stays for now; it is removed in the final restructure PR.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The redesign drops the 'why'/Campaign tab entirely (its content is split between the funnel and FAQ), so remove it now instead of keeping a transitional shim. Deletes the tab plus the cluster that existed only to serve it: GivebackCampaignPanel, GivebackSelectedCauses, GivebackEditCausesModal, GivebackBudgetStory. Tabs are now Take action / Impact / Causes. Kept GivebackFaq, Headline, Mascot and Section: those are wired in by the upcoming FAQ and hero PRs.
The causes tab fires SaveGivebackCauses on every toggle but couldn't tell an add from a removal. Capture the direction from the pre-toggle state so the event carries action: 'add' | 'remove' alongside cause_id and origin.
The edit-causes modal flow was removed with the Campaign tab; this event is no longer fired anywhere. The 'opened cause manager' signal is now ClickGivebackTab with tab='causes'.
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.
Changes
Second step of the giveback design pass from #6247 (PR 2/6). Adds the Causes management tab and removes the obsolete Campaign tab.
Causes tab (new)
GivebackCausesPanel— your backed causes sit up top as compact rows (emblem, name, learn-more, remove); a category-filterable discovery grid of the rest sits below. Adding/removing a cause auto-saves with no Save step.useGivebackCauseSelection.toggleAndSave(new) — toggles and persists immediately. Reads the freshest selection through a ref so back-to-back toggles can't persist from a stale snapshot, and rolls the optimistic change back if the save fails. The cause visibly moving between sections is the feedback, so there's no success toast.GivebackCauseCardgains abuttonTogglevariant: only the corner "+" toggles (the card isn't a big tap target), used by the discovery grid. Default stays whole-card-tappable for the onboarding funnel. Card layout restructured to its final form.GivebackTabHeading(new) — shared tab header primitive.GivebackFilterChiprestyled as a bordered tag pill.Campaign tab removed
The redesign drops the
why/Campaign tab entirely (its content is split between the funnel and FAQ), so it's removed here rather than kept as a transitional shim. Deletes the cluster that existed only to serve it:GivebackCampaignPanel(+spec),GivebackSelectedCauses,GivebackEditCausesModal,GivebackBudgetStory.Tabs are now Take action / Impact / Causes.
Kept
GivebackFaq/GivebackHeadline/GivebackMascot/GivebackSection— they're wired in by the upcoming FAQ (PR4) and hero (PR5) PRs, not compat.GivebackCommunityGoalProgressalso stays (still used by the Impact tab; removed when PR3 redesigns it).Scope notes
useGivebackCauseSelectioninstances (page-level + this panel) share the same React Query key, so no double fetch, andhasSavedCausesis query-derived so it stays consistent after a save. Their localselectedIdsdiverge, but the inline onboarding picker and this tab are never interactive at the same time, so it isn't user-visible.save()toast-timer polish from feat(giveback): full design pass — warm-up funnel, reward-ladder impact, causes tab #6247 is deferred to the funnel PR; onlytoggleAndSaveis included here.Verification
tsc: no new errors (27 pre-existing, unrelated)toggleAndSavetests (immediate persist, back-to-back chaining, optimistic rollback)Preview domain
https://feat-giveback-causes-tab.preview.app.daily.dev