Skip to content

ntp: batched api #1446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
334 changes: 203 additions & 131 deletions special-pages/pages/new-tab/app/activity/ActivityProvider.js

Large diffs are not rendered by default.

51 changes: 50 additions & 1 deletion special-pages/pages/new-tab/app/activity/activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,35 @@ Notes:
- {@link "NewTab Messages".ActivityGetConfigRequest}
- Used to fetch the initial config data (eg: expanded vs collapsed)
- returns {@link "NewTab Messages".ActivityConfig}
-

### `activity_getUrls`
- {@link "NewTab Messages".ActivityGetUrlsRequest}
- Used to fetch the initial config data (eg: expanded vs collapsed)
- returns {@link "NewTab Messages".UrlInfo}

```json
{
"urls": ["..."],
"totalTrackersBlocked": 123
}
```

### `activity_getDataForUrls`
- {@link "NewTab Messages".ActivityGetDataForUrlsRequest}
- Used to confirm the burn action - native side may or may not show a modal
- sends {@link "NewTab Messages".DataForUrlsParams}
- returns {@link "NewTab Messages".ActivityData}
- Note: This response is the same format as `activity_getData`, where DomainActivity items are delivered under `.activity`

```json
{
"activity": [
{"...": "..."}
]
}
```


### `activity_confirmBurn`
- {@link "NewTab Messages".ActivityConfirmBurnRequest}
- Used to confirm the burn action - native side may or may not show a modal
Expand Down Expand Up @@ -93,6 +121,27 @@ by sending the notification `activity_burnAnimationComplete`
- The activity data used in the feed.
- returns {@link "NewTab Messages".ActivityData}

### `activity_onDataPatch`
- {@link "NewTab Messages".ActivityOnDataPatchSubscription}
- The activity data used in the feed.
- returns {@link "NewTab Messages".UrlInfo} + optional {@link "NewTab Messages".PatchData}

```json
{
"urls": ["..."],
"totalTrackersBlocked": 123
}
```
```json
{
"urls": ["..."],
"totalTrackersBlocked": 123,
"patch": {
"...": "..."
}
}
```

### `activity_onConfigUpdate`
- {@link "NewTab Messages".ActivityOnDataUpdateSubscription }
- The widget config
Expand Down
167 changes: 0 additions & 167 deletions special-pages/pages/new-tab/app/activity/activity.service.js

This file was deleted.

Loading
Loading