Improve Add Token disclosure for SAC#2869
Conversation
|
PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-6184ce2c8a34d19598e9 (SDF collaborators only — install instructions in the release description) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aea39a3184
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b9b951deb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e00510aa7d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a1539b9dc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR updates the extension popup’s Add Token flow to treat SAC (classic-asset) tokens as a 2-step flow (Add Token → Change Trust review/submit), while keeping SEP-41 tokens as a direct approval path. It also refactors the prior “SAC implies changeTrust” logic out of useSetupAddTokenFlow and into the UI routing, and adds/updates tests and E2E stubs to cover the new behavior.
Changes:
- Route SAC adds through
ChangeTrustInternal(with fee disclosure/prop wiring) before resolving the dApp request; keep SEP-41 as a direct confirm. - Extend
ChangeTrustInternal/Submit UI to better support “standalone full-height” usage and avoid misleading close-tab prompts in this context. - Add new unit tests + expand E2E coverage/stubs for SAC vs SEP-41 add-token scenarios.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| extension/src/popup/views/AddToken/styles.scss | Removes scroll overflow on the AddToken wrapper styling. |
| extension/src/popup/views/AddToken/index.tsx | Implements SAC 2-step routing into ChangeTrustInternal, fee display, and “Continue” CTA for SAC. |
| extension/src/popup/views/AddToken/tests/AddToken.test.tsx | Adds routing/unit coverage for SAC vs SEP-41 behavior in AddToken. |
| extension/src/popup/locales/pt/translation.json | Adds translations for “Auto-lock timer”, “Auto-Lock Timer”, and “Token address”. |
| extension/src/popup/locales/en/translation.json | Adds English strings for “Auto-lock timer”, “Auto-Lock Timer”, and “Token address”. |
| extension/src/popup/helpers/useSetupAddTokenFlow.ts | Removes SAC trustline submission from the “approve add token” helper; now always dispatches addToken+metrics. |
| extension/src/popup/helpers/useChangeTrustline.ts | Deletes the no-longer-used trustline hook. |
| extension/src/popup/components/WarningMessages/styles.scss | Adds styling for the asset-list banner variant (.ScanAssetList). |
| extension/src/popup/components/WarningMessages/index.tsx | Updates AssetListWarning styling class + icon. |
| extension/src/popup/components/manageAssets/ManageAssetRows/ChangeTrustInternal/SubmitTx/index.tsx | Adds onClose + hideCloseTabHint behavior; routes Done differently on success vs failure. |
| extension/src/popup/components/manageAssets/ManageAssetRows/ChangeTrustInternal/styles.scss | Adds “standalone/full-height” layout rules and scroll behavior for the external Add Token flow. |
| extension/src/popup/components/manageAssets/ManageAssetRows/ChangeTrustInternal/index.tsx | Adds onSuccess, initialFee, isFullHeight; passes fee into XDR build and adjusts padding for submit step. |
| extension/src/popup/components/manageAssets/ManageAssetRows/ChangeTrustInternal/hooks/useChangeTrustData.tsx | Makes change-trust data reload when key inputs (including fee) change. |
| extension/src/popup/components/tests/ChangeTrustInternal.test.tsx | Adds coverage for onSuccess vs onCancel behavior and fee initialization/unit correctness. |
| extension/e2e-tests/integration-tests/freighterApiIntegration.test.ts | Adds/updates E2E coverage for verified/unverified SEP-41 and SAC add-token flows, including SAC-specific stub injection. |
| extension/e2e-tests/helpers/stubs.ts | Adds SAC-specific stubs and a helper to mark a contractId as “verified” via asset-list stubbing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e51fd73e6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
….com/stellar/freighter into feat/addtoken-sac-changetrust-review
|
|
||
| return ( | ||
| <React.Fragment> | ||
| <SubviewHeader title={t("Auto-Lock Timer")} /> |
There was a problem hiding this comment.
side-fix to unify the translations and add the PT translation for it. the prettier was adding them back before push. was missing from the other PR that was merged related to the auto lock
Closes #2826
Small PR to adjust the flow for adding SAC tokens to make it a 2 step flow on the Add token + Confirm Transaction for clarity
and for SEP-41 it continues being a direct approval
e.g. "before" screenshot

Videos: 1 SAC verified / 1 SEP-41 unverified
Screen.Recording.2026-06-24.at.17.45.53.mov
Screen.Recording.2026-06-24.at.17.46.56.mov