# Project

Each brief below is a piece of work to do on a local site, with a list to check it against when you are done.

## Set up

Run a local site with `npx wp-env start`, as in [Run locally](https://github.com/WordPress/presence-api#run-locally). It comes with the debugger: click the heart in the admin bar to see every row in the rooms you are in.

## Brief 1: a custom room

Show who else has a screen open that is not a post, such as a plugin's settings page or an order.

Builds on [Rows and rooms](https://wordpress.github.io/presence-api/docs/rows-and-rooms/index.md), [Writers](https://wordpress.github.io/presence-api/docs/writers/index.md) and [Heartbeat and tabs](https://wordpress.github.io/presence-api/docs/heartbeat-and-tabs/index.md). Start from [Custom rooms](https://github.com/WordPress/presence-api#custom-rooms) in the README.

Done when:

- Two users, in two browsers, each see the other's name on the screen.
- Closing one browser removes that name from the other within 150 seconds.
- `wp presence list` on your room shows one row per person, under your plugin's own prefix.

## Brief 2: a push transport

Refresh a tab the moment a row changes, instead of at the next Heartbeat tick.

Builds on [Readers](https://wordpress.github.io/presence-api/docs/readers/index.md) and [Push transports](https://wordpress.github.io/presence-api/docs/push-transports/index.md).

Done when:

- While your filter returns `false` from `presence-api.keepalive`, the `date_gmt` of your `user-{id}` row stops moving unless your code writes it.
- Your code writes that row with the state `wp_presence_admin_state()` builds.
- A listener on `set_presence` makes open tabs fire `presence-api.roomChanged`, and the admin bar updates without waiting for a tick.
