Skip to content

Commit bb32cbf

Browse files
shakyShaneShane Osbourne
andauthored
ntp: add next-steps docs (#1290)
Co-authored-by: Shane Osbourne <[email protected]>
1 parent afe41f9 commit bb32cbf

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

special-pages/pages/new-tab/app/new-tab.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ children:
66
- ./update-notification/update-notification.md
77
- ./privacy-stats/privacy-stats.md
88
- ./favorites/favorites.md
9+
- ./next-steps/next-steps.md
910
---
1011

1112
## Requests

special-pages/pages/new-tab/app/next-steps/next-steps.service.md renamed to special-pages/pages/new-tab/app/next-steps/next-steps.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,37 @@
22
title: Next Steps Cards
33
---
44

5+
## Setup
6+
7+
- Widget ID: `nextSteps`
8+
- Add it to the `widgets` field on [initialSetup](../new-tab.md)
9+
- Example:
10+
11+
```json
12+
{
13+
"...": "...",
14+
"widgets": [
15+
{"id": "nextSteps"},
16+
{"...": "..."}
17+
]
18+
}
19+
```
20+
521
## Requests:
622
- {@link "NewTab Messages".NextStepsGetDataRequest `nextSteps_getData`}
723
- Used to fetch the initial data (during the first render)
8-
- returns {@link "NewTab Messages".NextStepsData}
24+
- returns {@link "NewTab Messages".NextStepsData} - either `null` or `Array<{id: string}>`
25+
- Note: Please use `null` to represent when there's nothing to show (instead of an empty array.)
26+
- IDs: Please find the list of supported IDs here {@link "NewTab Messages".NextStepsCards}
27+
- Example:
28+
29+
```json
30+
[
31+
{ "id": "bringStuff" },
32+
{ "id": "defaultApp" }
33+
]
34+
```
35+
936
- {@link "NewTab Messages".NextStepsGetConfigRequest `nextSteps_getConfig`}
1037
- Used to fetch the initial config (during the first render)
1138
- returns {@link "NewTab Messages".NextStepsConfig}
@@ -14,8 +41,9 @@ title: Next Steps Cards
1441
- {@link "NewTab Messages".NextStepsOnDataUpdateSubscription `nextSteps_onDataUpdate`}.
1542
- The messages available for the platform
1643
- returns {@link "NewTab Messages".NextStepsData}
44+
- as mentioned in the request, please use `null` to represent when there's nothing to show (instead of an empty array.)
1745
- {@link "NewTab Messages".NextStepsOnConfigUpdateSubscription `nextSteps_onConfigUpdate`}.
18-
- The widget config
46+
- The widget-specific config, to toggle things like the expansion
1947
- returns {@link "NewTab Messages".NextStepsConfig}
2048

2149
## Notifications:

0 commit comments

Comments
 (0)