Skip to content

feat(connections): Mercury's partner disclosures and a Disconnect dialog - #567

Merged
jfrench9 merged 4 commits into
mainfrom
feature/mercury-compliance-disclosures
Nov 18, 2026
Merged

jfrench9 merged 4 commits into
mainfrom
feature/mercury-compliance-disclosures

Conversation

@jfrench9

@jfrench9 jfrench9 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Mercury's production OAuth credentials are issued after its compliance team reviews a recorded demo showing "Powered by Mercury", its not-a-bank disclosure, a mercury.com link, and a way to disconnect. This puts all four on every screen of the Mercury flow, following Mercury's partner disclosure guidance (revised 2026-03-13), and makes a token-only deployment ask for each company's own Mercury token.

Changes

  • New connections/components/MercuryDisclosure.tsx: Mercury's not-a-bank disclosure and its Treasury disclosure as verbatim constants, a PoweredByMercury block (wordmark, mercury.com link, disclosure), and a logomark on a white tile so the dark mark reads in dark mode. Logo files from Mercury's partner media kit in public/images/mercury_logo.svg and mercury_logomark.svg.
  • Connection marketplace (/connections, Mercury row): "banking*" carries an asterisk with the disclosure directly beneath it.
  • Mercury setup form (MercurySetupForm): logo, "Powered by Mercury" with the disclosure under the asterisked "banking*"; the treasury checkbox reads "Include Mercury Treasury accounts" with Mercury's Treasury disclosure under it, at the label's size. The token field is labelled "Mercury API token for this company (read-only)" and says each company connects with its own. When the API lists Mercury with api_key required (no Mercury OAuth client), the Mercury sign-in is hidden and Connect waits for a token.
  • OAuth callback (/connections/mercury-callback): the block on the loading, success, and error states, centred with the loader so it is in view while connecting.
  • Connection card (ConnectionCard): Mercury logo and the block. Every provider whose removal is a disconnect (QuickBooks, Mercury, Plaid) gets a labelled Disconnect button titled "Disconnect {provider}", matching its dialog; an external integration keeps the icon-only "Delete connection".
  • Delete dialog (DeleteConnectionModal): a bank feed (Mercury, Plaid) reads Disconnect {provider} and says what happens: access is given up, inbox lines and the counterparties only they used are deleted, posted entries stay without the provider's transaction details, and chart accounts stay but are unlinked. Mercury's carries the disclosure. The toast after a disconnect says "{Provider} disconnected", not "Connection deleted successfully".

Deploy Notes

None. Works against the current API: without the new required_config from the companion robosystems PR, the form behaves as before. Mercury stays dark in hosted production (CONNECTION_MERCURY_ENABLED is off), so these screens are not visible there until it is turned on.

Testing

  • npm run test:all green in the pre-commit hook on every commit (137 files, 1271 tests), with new tests for the disclosures, the Treasury disclosure, the token-required form, and the Disconnect dialog.
  • npm run build not run; every changed screen was served by the dev server and exercised in the browser.
  • End to end on the local stack against Mercury's sandbox, both routes: personal token and OAuth each connected, ran the first sync into the Inbox, and disconnected. The disconnect purge matched the dialog (one posted line kept with the feed's details scrubbed, inbox lines and feed-only counterparties deleted, chart accounts unlinked), and the OAuth disconnect revoked the token at Mercury.

🤖 Generated with Claude Code

…cury dialog

Every screen of the Mercury flow carries Powered by Mercury, the wordmark,
a mercury.com link and Mercury's not-a-bank disclosure, verbatim from its
partner disclosure guidance; the Treasury checkbox carries the Treasury
disclosure. A bank feed's delete dialog now reads Disconnect and says what
is deleted and what stays.
…ny's token

When the API lists Mercury with api_key required (no Mercury OAuth client),
the form drops the Mercury sign-in and the Connect button waits for a
token. The field says whose token it is: each company connects with its
own.
@github-actions github-actions Bot added the change:normal Normal change: automated review documented on the pull request before merge label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Change classification: normal — platform or application code changed.

A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The change-classification job requests that review and passes once it has been posted. Recorded by the change-classification job.

@jfrench9

Copy link
Copy Markdown
Member Author

@claude please review this PR

@claude

claude Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Claude finished @jfrench9's task in 24s —— View job


Review of PR #567: Mercury disclosures and Disconnect dialog

I read the full non-test diff against origin/main. I did not run the test suite or the app, so what follows comes from reading the code. The PR reports test:all green and a manual sandbox run.

The change is clean and matches the repo conventions: the work is colocated, the disclosure is a single shared component, and the new props are backward compatible. I found no blocking bugs. The points below are small.

Worth a look

  1. The disclosure may sit below the fold on the OAuth callback loading state. In mercury-callback/page.tsx the PoweredByMercury block renders after a LoadingState with min-h-[60vh]. The block lands roughly 60vh down, so it may need a scroll to see. The state is brief, but the stated purpose is a recorded compliance demo. If every screen has to show the block visibly, put it above the loader, or drop the min-h and centre the pair together.

  2. The Treasury disclosure is text-xs, but the comment says the disclosure must match its neighbour's size. The MercuryDisclosure doc comment says the disclosure appears "at the neighbouring text's size". MERCURY_TREASURY_DISCLOSURE in MercurySetupForm.tsx is text-xs, while the checkbox label next to it is text-sm. Mercury's guidance as you've quoted it would seem to want them equal. The text-xs also sits under the token helper text, which is text-xs, so check which neighbour counts. Either use text-sm or soften the comment.

  3. Plaid gets the Disconnect dialog but not the Disconnect button. DeleteConnectionModal now treats Plaid as a bank feed ("Disconnect Plaid", purge description). ConnectionCard only gives Mercury the labelled button and the "Disconnect Mercury" title. Plaid and QuickBooks keep the icon-only button titled "Delete connection", so the button says delete and the dialog says disconnect. Consider driving the label from DISCONNECTING_PROVIDERS instead of provider === 'mercury'.

  4. The provider comparisons depend on casing. content.tsx lowercases connectionToDelete.provider before the DISCONNECTING_PROVIDERS lookup. ConnectionCard and MercuryLogomark compare provider === 'mercury' directly. I did not confirm that provider is already lowercased there. If it is, this is fine. If not, a Mercury value would miss the logo and the block.

Nits

  • Duplicate partner text: the "Not banking* with Mercury yet?" paragraph is now duplicated in content.tsx and MercurySetupForm.tsx. A small shared snippet would keep the asterisk and the disclosure from drifting.
  • Dead-end token form: when tokenRequired is true and the token field is empty, Connect is disabled with no hint. A short note such as "Paste a token to continue" would help. The placeholder partly covers this.
  • Unused prop: PoweredByMercury accepts asterisk through the shared props interface, and MercuryLogomark doesn't use it. This is harmless.

Looks good

  • tokenRequired form logic: canConnect gates on a non-empty token, and the button label and usingApiKey handling are consistent. The existing apiKeyMode path is unchanged.
  • Disconnect toast: it is keyed off DISCONNECTING_PROVIDERS and falls back to the old message for other providers.
  • Modal copy: the JSX around {label}’s renders without a stray space.
  • Legal text: the verbatim disclosure constants are exported, so the tests can assert them exactly.
  • SVG images: next/image handles the local SVGs without extra config.

I'd merge after considering items 1 to 3.

Every disconnecting provider's card button reads Disconnect, matching its
dialog; the Treasury disclosure matches the checkbox label's size; the
callback's loading state keeps the disclosure in view.
@jfrench9
jfrench9 merged commit d9d9b37 into main Nov 18, 2026
7 checks passed
@jfrench9
jfrench9 deleted the feature/mercury-compliance-disclosures branch November 18, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:normal Normal change: automated review documented on the pull request before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant