Skip to content

Improve Add Token disclosure for SAC#2869

Open
leofelix077 wants to merge 18 commits into
masterfrom
feat/addtoken-sac-changetrust-review
Open

Improve Add Token disclosure for SAC#2869
leofelix077 wants to merge 18 commits into
masterfrom
feat/addtoken-sac-changetrust-review

Conversation

@leofelix077

@leofelix077 leofelix077 commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

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

⚠️ - Some UI issues like double padding or double spacing were also added as part of this PR to make it more consistent

e.g. "before" screenshot
Screenshot 2026-06-23 at 16 41 06

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

@leofelix077 leofelix077 self-assigned this Jun 24, 2026
@leofelix077 leofelix077 added wip not for merging yet don't review yet wip / tests in progress / missing videos or screenshots / pending self code-review labels Jun 24, 2026
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

PR Preview build is ready: https://github.com/stellar/freighter/releases/tag/untagged-6184ce2c8a34d19598e9 (SDF collaborators only — install instructions in the release description)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread extension/src/popup/views/AddToken/index.tsx Outdated
@leofelix077 leofelix077 changed the title Feat/addtoken sac changetrust review Improve Add Token disclosure for SAC Jun 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread extension/src/popup/views/AddToken/index.tsx
Comment thread extension/e2e-tests/integration-tests/freighterApiIntegration.test.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copilot AI review requested due to automatic review settings June 25, 2026 16:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread extension/src/popup/views/AddToken/index.tsx
Comment thread extension/src/popup/locales/pt/translation.json Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread extension/src/popup/views/AddToken/index.tsx

return (
<React.Fragment>
<SubviewHeader title={t("Auto-Lock Timer")} />

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@leofelix077 leofelix077 added enhancement New feature or request and removed wip not for merging yet don't review yet wip / tests in progress / missing videos or screenshots / pending self code-review labels Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Add Token disclosure for SAC (classic-asset) tokens

2 participants