Skip to content

Commit

Permalink
Update Snaps user interface section (#1829)
Browse files Browse the repository at this point in the history
* Update Snaps user interface section

* Update snaps/features/notifications.md

Co-authored-by: Byron Gravenorst <[email protected]>

---------

Co-authored-by: Byron Gravenorst <[email protected]>
  • Loading branch information
alexandratran and bgravenorst authored Jan 23, 2025
1 parent 0973848 commit 9182a62
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ of the [MetaMask developer page](https://metamask.io/developer/).
## December 2024

- Documented [Swellchain](/services/reference/swellchain) support. ([#1776](https://github.com/MetaMask/metamask-docs/pull/1776))
- Documented [Snap Notifications Expanded View](/snaps/features/notifications/#expanded-view).
- Documented [Snaps notifications expanded view](/snaps/features/notifications/#expanded-view).
([#1774](https://github.com/MetaMask/metamask-docs/pull/1774))
- Documented [`snap_getInterfaceContext`](/snaps/reference/snaps-api/#snap_getinterfacecontext).
([#1772](https://github.com/MetaMask/metamask-docs/pull/1772))
Expand Down
2 changes: 1 addition & 1 deletion snaps/features/custom-ui/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ implementing the following features:
- [Home pages](home-pages.md)
- [Transaction insights](../transaction-insights.md)
- [Signature insights](../signature-insights.md)
- [Notifications (Expanded View)](../notifications.md#expanded-view)
- [Notifications (expanded view)](../notifications.md#expanded-view)

:::note
JSX is supported in the MetaMask extension and Flask version 12 and later.
Expand Down
6 changes: 4 additions & 2 deletions snaps/features/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ Each Snap can trigger up to:

## Expanded view

In-app notifications can include an optional expanded view that will be displayed when the user clicks on the notification. The expanded view includes a title, content, and an optional footer link.
In-app notifications can include an optional expanded view that displays when selected.
The expanded view includes a title, content, and an optional footer link.

The following example displays a notification in MetaMask, with the message "Hello, world!" When the user clicks on the notification, the expanded view displays a page with a title, a paragraph, and a link to the MetaMask Snaps directory:
The following example displays a notification in MetaMask, with the message "Hello, world!"
When the user selects the notification, the expanded view displays a page with a title, a paragraph, and a link to the MetaMask Snaps directory:

```javascript title="index.js"
await snap.request({
Expand Down
16 changes: 9 additions & 7 deletions snaps/learn/about-snaps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ For each Snap, the user can:
A Snap can also display a [home page](../../features/custom-ui/home-pages.md) within MetaMask that
the user can access using the Snaps menu.

Other than the settings page and home page, a Snap can
[modify the MetaMask UI](../../features/custom-ui/index.md) only
by displaying [dialogs](../../features/custom-ui/dialogs.md),
[transaction insights](../../reference/entry-points.md#ontransaction), or
[signature insights](../../features/signature-insights.md).

This means that many Snaps must use companion dapps and custom JSON-RPC API methods to
Other than the settings page and home page, a Snap can modify the MetaMask UI by displaying
[custom UI](../../features/custom-ui/index.md) in
[dialogs](../../features/custom-ui/dialogs.md),
[transaction insights](../../features/transaction-insights.md),
[signature insights](../../features/signature-insights.md), and
[notifications (expanded view)](../../features/notifications.md#expanded-view).
An [account management Snap](../../features/custom-evm-accounts/index.md) can also modify the MetaMask UI by leveraging native account UX.

Many Snaps must use companion dapps and custom JSON-RPC API methods to
present data to the user.

:::note
Expand Down

0 comments on commit 9182a62

Please sign in to comment.