You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(ui,citizen-claim-widget): finalize next task component and claim - #299
Finalizes the NextTaskModal component and CitizenClaimWidget post-claim flow to resolve issue #276 (following PR #248 and parent issue #246).
Key Updates
Figma Visual Alignment: Styled the primary action button consistently in both Anchor (link) mode and Button (callback) mode with full-width primary styling, matching the Figma design reference.
Error Retention & Toasts: On navigation rejection or invalid URL errors, the modal stays open and displays the error toast instead of prematurely closing.
Responsive Inner Scrolling: Added overflowY: auto and a responsive container so that on compact viewports (small mobile 320×568, iPhone SE 375×667, landscape 667×375) the headline, task card, and action buttons remain fully scrollable and interactable without clipping.
Configurable Copy: Made headline, supportingCopy, recommendedLabel, skipLabel, and statusLabel configurable on NextTaskContent with fallback defaults.
CitizenClaimWidget Claim Flow Tests: Added mock claim execution fixtures in Storybook and automated Playwright integration tests covering single-chain claim, multi-chain claim, all-fail fallback, and post-claim next-task drawer presentation.
3. Small Mobile Viewport (320×568) — Inner Scroll & Action Buttons
4. iPhone SE (375×667) — Top Viewport
5. iPhone SE (375×667) — Bottom Action Buttons
6. CitizenClaimWidget — Claim In Progress
7. CitizenClaimWidget — Next Task Drawer Open After Claim
Verification
Local Run Results (HEAD 1a944d0)
Note: a later comment-only commit (05efda67) corrects the resolveNavigation JSDoc wording; no code or tests changed after these runs, so the results below stand for the current head.
pnpm install — passed
pnpm build — passed (18/18 packages)
NextTaskModal smoke spec (-g NextTaskModal) — 21/21 passed, including regression tests for stale navigation completions across close/reopen and a throwing onClose after successful navigation
Full pnpm test:demo — 344 passed, 1 flaky (passed on retry), 1 skipped, 1 failed; the single failure is the pre-existing, unrelated tests/widgets/ai-credits-widget/states.spec.ts:247
cd packages/ui && npx tsc --noEmit — exactly the 9 pre-existing errors; none in this PR's files
Lint — @goodwidget/ui and @goodwidget/citizen-claim-widget filters at 0 errors (root-level lint failures are pre-existing in unrelated apps)
… flow (GoodDollar#276)
- Match visual reference with primary button styling in both Anchor and Button CTA modes
- Retain modal on host navigation error/rejection and invalid URLs with error toast
- Add responsive inner scrolling for small mobile and landscape viewports
- Support configurable copy fields with fallback defaults on NextTaskContent
- Add Playwright tests and Storybook fixtures for CitizenClaimWidget claim flow
- Refresh visual evidence in design-system and citizen-claim-widget test-results
ClosesGoodDollar#276
Follows GoodDollar#248GoodDollar#246
HushLuxe
changed the title
feat(ui,citizen-claim-widget): finalize next task component and claim…
feat(ui,citizen-claim-widget): finalize next task component and claim
Nov 9, 2026
L03TJ3
linked an issue
Nov 10, 2026
that may be
closed
by this pull request
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The modal permits concurrent navigation attempts and nests a button inside a link, while widget tests leave partial-success handling and CTA callback wiring unverified.
This PR addresses the remaining Next Task work from #248 for issue #276, refining the shared modal and adding real CitizenClaimWidget post-claim flow coverage.
Changes:
Gives link-mode CTAs primary styling, retains the drawer on navigation errors, and adds inner scrolling.
Adds configurable copy fields and exports default text constants.
Adds Storybook fixtures and Playwright coverage for claim outcomes, custom copy, and responsive layouts.
…t task component
- Fix 1: Set navigation guard immediately on entry to prevent concurrent double-fire, reset on failure to allow retries
- Fix 2: Render styled CTA child inside Anchor as non-interactive span (tag="span", role="presentation", tabIndex={-1}, pointerEvents="none")
- Fix 3: Add multi-chain partial-success fixture and story to ensure drawer opens when at least one chain succeeds
- Fix 4: Strengthen widget flow tests to press CTA, verify host-side navigation callback, and test Skip dismissal independently
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Responsive tests can miss drawer-clipped actions, while fixed waits and missing claim-outcome checks allow drawer-state assertions to pass before completion or when a claim unexpectedly fails.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Assert drawer actions are fully in the viewport after scrolling
tests/design-system/smoke.spec.ts:608
toBeVisible() and toBeEnabled() can pass for controls clipped by the drawer, and scrollIntoViewIfNeeded() does not assert that scrolling exposed them. Restore toBeInViewport({ ratio: 1 }) after each scroll so unreachable actions fail the responsive tests. Apply the same assertion to the CTA and Skip action in the long-copy test at tests/design-system/smoke.spec.ts:700–704.
Wait for claim completion before asserting drawer outcomes
The fixed two-second waits let these negative assertions pass before claim execution finishes; the absent-content test also passes if the claim fails. Wait for both expected per-chain outcomes and for the Claim button to become enabled again before checking the drawer state. Apply this to both the all-failed case here and the successful-claim-without-content case at tests/widgets/citizen-claim-widget/states.spec.ts:339–342.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Tests leave the single-claim fallback and long-copy responsive layouts insufficiently covered, while the duplicate-click check has a timing race that can cause false failures.
No open issues 🎉
3 previously missed issues
In code that hasn't changed since last review
Cover long-copy layouts across viewports and image states
tests/design-system/smoke.spec.ts:697
The viewport matrix uses only short copy, while the sole long-copy test always includes an image and sets the Storybook manager—not the story iframe—to 375×667. Long-copy landscape and image-free layouts can therefore regress without failing these checks. Run realistic copy with and without an image through direct iframe URLs at small-mobile, landscape, and desktop sizes, checking that the headline, card, and both actions are reachable and capturing screenshots.
Dispatch rejection-guard clicks in one browser task
tests/design-system/smoke.spec.ts:720
These two awaited Playwright clicks are not guaranteed to arrive within the story's 200ms rejection delay. On a slow runner, the first attempt can reject and reset the guard before the second click, turning that click into the successful retry; the subsequent open-state and call-count assertions then fail even though the guard works correctly. Dispatch both presses in one browser task so the rejection cannot occur between them.
The Celo mock still returns a positive entitlement in the singleChain fixture, so claimablesByChain contains one entry and the widget executes actions.claimAll([42220]), not actions.claim() (see CitizenClaimWidget.tsx:262–274,319). The separate singleClaimSucceeded opening branch could therefore break without this test failing. Please add a fixture that reaches the single-claim fallback branch and assert that its successful claim opens the drawer.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active test gaps leave rapid-click behavior vulnerable to CI timing and fail to cover the single-claim success drawer trigger and realistic long-content responsive cases.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active findings show that stale navigation rejections can permit duplicate navigation, while errors from onClose are misreported as navigation failures and can also enable repeat navigation.
@HushLuxe thanks for the work. Please update the PR description and PR so they match your latest commit (db51580):
Design reference: add the current design image to the PR description. Update it whenever the UI changes. Your screenshots and test results are from before the Nov 18 layout change, so please redo them.
Fix two lines in the description: it says "single clean commit" but there are 9 commits (no need to squash, just change the text), and "Remaining risks" mentions ai-credits, while the failing test in CI is the live-RPC one.
Shared code: you changed the shared Drawer (height='fit', maxHeight) and added an xs breakpoint in config.ts. Issue [GoodBounty] Finalize Next Task component PR (#248) #276 says not to change the shared Drawer. Please explain why it was needed, or move it out of shared code.
The reason will be displayed to describe this comment to others. Learn more.
Blocking: Setting the guard before await resolveNavigation(...) means dismissWithReason (L131) returns early for as long as the promise is pending. The close button, the overlay and “Skip for now” all do nothing, and fit mode also disables drag. If the host router hangs or is slow, the user is stuck with no feedback.
Suggestion: let dismissal go through while navigation is pending. Bump navigationGenerationRef so the late result is ignored, then report onDismissed and call onClose. Also show a loading/disabled state on the CTA while it’s pending. Could you add a test: a never-settling resolveNavigation, then press Skip, then assert the sheet closes?
The reason will be displayed to describe this comment to others. Learn more.
Because the guard resets after a failure, each retry fires onClicked again, so analytics will count several clicks for one intent. Either document that, or fire onClicked only after navigation succeeds.
The reason will be displayed to describe this comment to others. Learn more.
These styles only work on web. On native the long copy will clip without scrolling. Consider Sheet.ScrollView (or a ScrollView inside the frame). Also, maxHeight="100%" inside a sheet with no set height probably doesn’t resolve to anything useful, which may be why the long-copy clipping concern is still open.
The reason will be displayed to describe this comment to others. Learn more.
This works on web. Could you check it once by hand on native? Tamagui’s Anchor renders as Text there, so this becomes a View inside Text, and layout or press behaviour can differ.
The reason will be displayed to describe this comment to others. Learn more.
This applies to every drawer, half/full included, across all widgets, not just fit. Also:
calc()/vh strings aren’t supported on React Native.
On iOS Safari, 100vh includes the area behind the URL bar, so the bottom of the sheet (where the CTA sits) can still be clipped. dvh handles this better.
Since #276 asks not to change the shared Drawer, could this live in NextTaskModal, or at least apply only when height === 'fit'?
The reason will be displayed to describe this comment to others. Learn more.
Adding a global breakpoint affects every widget and every host config, and could clash with a host that defines its own xs. It’s only used for one heading size. Could that use $sm or a local useMedia check instead?
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the iteration. The stale-navigation generation guard, keep-open-on-error behaviour, URL allowlisting and the expanded Playwright coverage are all solid.
Requesting changes for two things:
A pending resolveNavigation makes the sheet impossible to dismiss (see inline on NextTaskModal.tsx).
The shared Drawer is modified despite #276 asking not to, and the maxHeight change applies to every drawer in every widget. Please scope it to fit mode or move it into NextTaskModal, and explain the change in the PR body.
Also: please drop the qa-evidence/*.jpg files from the repo (attach them to the PR instead), and fix the “single clean commit” line in the description.
Checked against #276: items 2, 3 and 4 are fully met. Still outstanding:
Item 1: refresh the screenshots against the current layout.
Item 5: add docs for nextTaskContent and the new copy fields.
Item 6: add a test that missing fields fall back to the defaults.
Drawer: the height: 'fit' and maxHeight changes conflict with the “no Drawer API redesign” constraint.
Process: document the Anchor theme-manifest limitation in the PR, rerun the required commands (including tsc --noEmit) on the latest commit, and post the handoff comment.
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
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.
Finalizes the
NextTaskModalcomponent andCitizenClaimWidgetpost-claim flow to resolve issue #276 (following PR #248 and parent issue #246).Key Updates
Anchor(link) mode andButton(callback) mode with full-width primary styling, matching the Figma design reference.overflowY: autoand a responsive container so that on compact viewports (small mobile 320×568, iPhone SE 375×667, landscape 667×375) the headline, task card, and action buttons remain fully scrollable and interactable without clipping.headline,supportingCopy,recommendedLabel,skipLabel, andstatusLabelconfigurable onNextTaskContentwith fallback defaults.Closes #276
Follows #248 #246
Acceptance Criteria Checklist
Visual QA Evidence
1. CTA Primary Button (Anchor / Link mode matching Figma)
2. Navigation Error Handling (Modal retained, error toast displayed)
3. Small Mobile Viewport (320×568) — Inner Scroll & Action Buttons
4. iPhone SE (375×667) — Top Viewport
5. iPhone SE (375×667) — Bottom Action Buttons
6. CitizenClaimWidget — Claim In Progress
7. CitizenClaimWidget — Next Task Drawer Open After Claim
Verification
Local Run Results (HEAD
1a944d0)Note: a later comment-only commit (
05efda67) corrects theresolveNavigationJSDoc wording; no code or tests changed after these runs, so the results below stand for the current head.pnpm install— passedpnpm build— passed (18/18 packages)-g NextTaskModal) — 21/21 passed, including regression tests for stale navigation completions across close/reopen and a throwingonCloseafter successful navigationtests/widgets/citizen-claim-widget/states.spec.ts— 12/12 passed (2 live-RPC tests flaky, passed on retry)packages/uiunit tests — 5/5 passedpnpm test:demo— 344 passed, 1 flaky (passed on retry), 1 skipped, 1 failed; the single failure is the pre-existing, unrelatedtests/widgets/ai-credits-widget/states.spec.ts:247cd packages/ui && npx tsc --noEmit— exactly the 9 pre-existing errors; none in this PR's files@goodwidget/uiand@goodwidget/citizen-claim-widgetfilters at 0 errors (root-level lint failures are pre-existing in unrelated apps)Remaining risks
PR Feature: Next Task component (NextTaskModal) #248 and unrelated to this change.