Skip to content

refactor!: Standardise SnapInterfaceController action names and types#3912

Merged
Mrtenz merged 4 commits intocontroller-refactorsfrom
mrtenz/snap-interface-controller-refactor
Mar 23, 2026
Merged

refactor!: Standardise SnapInterfaceController action names and types#3912
Mrtenz merged 4 commits intocontroller-refactorsfrom
mrtenz/snap-interface-controller-refactor

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Mar 23, 2026

This renames all SnapInterfaceController action and event names and types to follow the Controller...Action pattern used in most other controllers.


Note

Medium Risk
Breaking API/type rename for SnapInterfaceController action types and exports, plus a new handler-registration mechanism; risk is mainly integration/compile-time breakage and potential mismatches in messenger wiring if any method list is incomplete.

Overview
Standardizes SnapInterfaceController action typing to the ControllerNameDoSomethingAction pattern (breaking). A new auto-generated SnapInterfaceController-method-action-types.ts defines method action types (and SnapInterfaceControllerMethodActions), replacing the previously inline CreateInterface/GetInterface/etc. type aliases.

SnapInterfaceController now registers actions via messenger.registerMethodActionHandlers with an explicit exposed-method list, and interface/index.ts updates exports to surface the new action types while narrowing what’s re-exported from the controller module. Downstream usages (e.g., SnapController, SnapInsightsController, snaps-simulation) are updated to reference the renamed SnapInterfaceController...Action types, and the changelog documents the breaking rename set.

Written by Cursor Bugbot for commit 4cd791b. This will update automatically on new commits. Configure here.

@Mrtenz Mrtenz marked this pull request as ready for review March 23, 2026 14:25
@Mrtenz Mrtenz requested a review from a team as a code owner March 23, 2026 14:25
@@ -1 +1,21 @@
export * from './SnapInterfaceController';
export type {
ExpandedView,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is ExpandedView used anywhere else?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It isn't, removed.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (controller-refactors@4e04a91). Learn more about missing BASE report.

Additional details and impacted files
@@                   Coverage Diff                   @@
##             controller-refactors    #3912   +/-   ##
=======================================================
  Coverage                        ?   98.55%           
=======================================================
  Files                           ?      425           
  Lines                           ?    12343           
  Branches                        ?     1935           
=======================================================
  Hits                            ?    12165           
  Misses                          ?      178           
  Partials                        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

SnapInterfaceControllerGetStateAction,
SnapInterfaceControllerState,
SnapInterfaceControllerStateChangeEvent,
StoredInterface,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is StoredInterface used?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, mainly in tests though.

@Mrtenz Mrtenz merged commit 2799c4c into controller-refactors Mar 23, 2026
119 of 120 checks passed
@Mrtenz Mrtenz deleted the mrtenz/snap-interface-controller-refactor branch March 23, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants