@protobase/cli 0.123.0 → 0.123.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.123.0";
2
+ var version = "0.123.2";
3
3
  //#endregion
4
4
  export { version };
@@ -1,3 +1,4 @@
1
+ import "@protobase/schema";
1
2
  import "@protobase/config";
2
3
  //#region src/dev/dev-relay.d.ts
3
4
  /** Ends the relay protobase dev started, when the dev server closes. */
@@ -21,10 +21,10 @@ const relayEnded = (code) => {
21
21
  /**
22
22
  * The config with a relay of its own when `realtime.relay` names none: without a `url`, protobase dev runs the relay
23
23
  * from its npm package for the app at `devUrl`, with keys it makes unless the config sets them, and gives the app its
24
- * address and keys. It starts on the first load whose config has `realtime.relay`, and again when an edit changes the
24
+ * address and keys; its apps file declares the events of `views`' typing conversation pages too. It starts on the first load whose config has `realtime.relay`, and again when an edit changes the
25
25
  * app's entry in its apps file; a config without `realtime.relay`, or one with a `url`, stops it.
26
26
  */
27
- const withDevRelay = async (config, projectDir, devUrl) => {
27
+ const withDevRelay = async (config, projectDir, devUrl, views) => {
28
28
  const relay = config.realtime?.relay;
29
29
  if (!relay || relay.url) {
30
30
  await stopDevRelay();
@@ -37,7 +37,10 @@ const withDevRelay = async (config, projectDir, devUrl) => {
37
37
  ticketKey: relay.ticketKey || keys.ticketKey
38
38
  };
39
39
  const entry = JSON.stringify({
40
- ...relayAppEntry(options, devUrl),
40
+ ...relayAppEntry(options, {
41
+ url: devUrl,
42
+ views
43
+ }),
41
44
  limits: devLimits
42
45
  });
43
46
  if (store.__protobaseDevRelay?.entry !== entry) {
package/dist/dev/entry.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { projectResources } from "../config/project-parts.js";
1
2
  import { buildProject } from "../config/build-project.js";
2
3
  import { projectIcons } from "../build/app-icons.js";
3
4
  import { projectErrorReporter } from "../project/error-reporter.js";
@@ -13,7 +14,9 @@ import { upgradeWebSocket } from "@hono/node-server";
13
14
  import { Hono } from "hono";
14
15
  //#region src/dev/entry.ts
15
16
  const projectDir = process.env.PROTOBASE_PROJECT;
16
- const config = await withDevRelay(await loadDevConfig(projectDir, JSON.parse(process.env.PROTOBASE_EXTENSIONS ?? "[]")), projectDir, process.env.PROTOBASE_DEV_URL);
17
+ const loaded = await loadDevConfig(projectDir, JSON.parse(process.env.PROTOBASE_EXTENSIONS ?? "[]"));
18
+ const relayViews = loaded.realtime?.relay ? configExports(await projectResources(loaded)).views.map((view) => view.toModel()) : [];
19
+ const config = await withDevRelay(loaded, projectDir, process.env.PROTOBASE_DEV_URL, relayViews);
17
20
  const database = devDatabase(projectDir);
18
21
  const { db } = database;
19
22
  const project = await buildProject(config, database);
@@ -1,4 +1,4 @@
1
- import { relayPresencePath } from "@protobase/server";
1
+ import { relayClientEvents, relayPresencePath, typingResources } from "@protobase/server";
2
2
  //#region src/relay/app-entry.ts
3
3
  /** How long a person who closed their last socket still counts as present, so a phone that reconnects never goes offline. */
4
4
  const presenceGraceSeconds = 30;
@@ -11,13 +11,21 @@ const presenceEntry = (presence, appUrl, apiPath) => {
11
11
  grace_seconds: presenceGraceSeconds
12
12
  };
13
13
  };
14
- /** The app's entry in the relay's apps file: its id, its keys, the browser origin of its URL and, with presence, where its reports go. */
15
- const relayAppEntry = (relay, appUrl, apiPath) => ({
16
- id: relay.app,
17
- api_keys: [relay.apiKey],
18
- ticket_keys: [relay.ticketKey],
19
- origins: appUrl ? [new URL(appUrl).origin] : [],
20
- ...relay.presence && { presence: presenceEntry(relay.presence, appUrl, apiPath) }
21
- });
14
+ /**
15
+ * The app's entry in the relay's apps file: its id, its keys, the browser origin of its URL, the events its clients
16
+ * may send on each channel resource, typing included where a conversation page types, and, with presence, where its
17
+ * reports go.
18
+ */
19
+ const relayAppEntry = (relay, { url, apiPath, views }) => {
20
+ const clientEvents = relayClientEvents(relay.channels, typingResources(views));
21
+ return {
22
+ id: relay.app,
23
+ api_keys: [relay.apiKey],
24
+ ticket_keys: [relay.ticketKey],
25
+ origins: url ? [new URL(url).origin] : [],
26
+ ...clientEvents && { client_events: clientEvents },
27
+ ...relay.presence && { presence: presenceEntry(relay.presence, url, apiPath) }
28
+ };
29
+ };
22
30
  //#endregion
23
31
  export { relayAppEntry };
@@ -1,9 +1,10 @@
1
1
  //#region src/relay/register.ts
2
2
  const registerRelay = (program) => {
3
- program.command("relay").description("The realtime relay the app hands its connections to (realtime.relay)").command("app").description("Print the app's entry for the relay's apps file, from realtime.relay and url").action(async () => {
4
- const [{ checkRelayOptions }, { loadSourceConfig }, { loadNearestEnvFile }, { relayAppEntry }] = await Promise.all([
3
+ program.command("relay").description("The realtime relay the app hands its connections to (realtime.relay)").command("app").description("Print the app's entry for the relay's apps file, from realtime.relay, url and the views").action(async () => {
4
+ const [{ checkRelayOptions, configExports }, { loadSourceConfig }, { projectResources }, { loadNearestEnvFile }, { relayAppEntry }] = await Promise.all([
5
5
  import("@protobase/server"),
6
6
  import("../config/source-config.js"),
7
+ import("../config/project-parts.js"),
7
8
  import("../dev/env.js"),
8
9
  import("./app-entry.js")
9
10
  ]);
@@ -11,7 +12,12 @@ const registerRelay = (program) => {
11
12
  const config = await loadSourceConfig(process.cwd(), { command: "tool" });
12
13
  if (!config.realtime?.relay) throw new Error("The config has no realtime.relay");
13
14
  const url = config.url ?? process.env.PROTOBASE_URL;
14
- process.stdout.write(`${JSON.stringify(relayAppEntry(checkRelayOptions(config.realtime.relay), url, config.apiPath), null, 2)}\n`);
15
+ const views = configExports(await projectResources(config)).views.map((view) => view.toModel());
16
+ process.stdout.write(`${JSON.stringify(relayAppEntry(checkRelayOptions(config.realtime.relay), {
17
+ url,
18
+ apiPath: config.apiPath,
19
+ views
20
+ }), null, 2)}\n`);
15
21
  });
16
22
  };
17
23
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.123.0",
3
+ "version": "0.123.2",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.123.0",
47
- "@protobase/layout": "0.123.0",
48
- "@protobase/query": "0.123.0",
49
- "@protobase/schema": "0.123.0",
50
- "@protobase/server": "0.123.0",
51
- "@protobase/ui": "0.123.0",
52
- "@protobase/workflows": "0.123.0",
46
+ "@protobase/config": "0.123.2",
47
+ "@protobase/layout": "0.123.2",
48
+ "@protobase/query": "0.123.2",
49
+ "@protobase/schema": "0.123.2",
50
+ "@protobase/server": "0.123.2",
51
+ "@protobase/ui": "0.123.2",
52
+ "@protobase/workflows": "0.123.2",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -20,5 +20,5 @@ The changes of each record, comments on it, and pages that refresh as records ch
20
20
  - [Realtime relay](../reference/realtime-relay.md) (in development): Apps hand their realtime connections to a relay, so they and their database can sleep while people stay connected: the app issues connect tickets for signed-in people and visitors, keeps the relay's channel members in step with its members records, tells each channel's members of every change, and closes a session's sockets when it signs out or expires. `protobase dev` runs a relay for the app by itself.
21
21
  - [Relay presence](../reference/realtime-relay.md#presence) (in development): The relay reports who comes online, goes away and goes offline; the app keeps it in a resource of its own, raises that resource's events, so workflows can act when someone goes offline, and tells the people who share a conversation with them.
22
22
  - [Relay in pages](../reference/realtime-relay.md#pages) (in development): Pages follow the relay on one socket: open views stay current from its notices and read again once after a reconnect, conversations show who types, sidebar groups say "typing…" and count unread messages without reading per message, all by configuration; `client.relay` gives the same from code.
23
- - Relay client events (coming soon): Each channel resource declares in the config the events its clients may send each other, such as typing, with a schema, a size and a rate.
23
+ - [Relay client events](../reference/realtime-relay.md#client-events) (in development): Each channel resource declares in the config the events its clients may send each other, such as typing, with a schema, a size and a rate.
24
24
  - [Broadcasts](../reference/channels.md#broadcasts) (beta): Apps on a record send each other short-lived events, such as typing, which are never stored, as JSON or as bytes, such as a chunk of audio or a drawing stroke; the app's own code sends them too, from an API function, over HTTP or [from SQL](../reference/channels.md#from-sql) with `channels.send()`.
@@ -11,7 +11,7 @@ The page of one record, with its sections, related records, galleries, charts an
11
11
  - [Record pages that open another](../reference/ui-config.md#a-record-page-that-opens-another): A record's page opens another address built from its fields in its place, such as a workflow run opening its workflow's page with the run shown.
12
12
  - [Record page opens elsewhere](../reference/ui-config.md#open-elsewhere) (beta): A view can send its record's address to another page its fields name, such as a message opening in its conversation, so search results and links land where the record is read.
13
13
  - [Full-area record pages](../reference/ui-config.md#full-area-record-pages) (beta): A view draws its record pages with a component of its own that fills the area beside the sidebar and under the top bar, such as a chat channel, and links to the standard page.
14
- - [Conversation pages](../reference/ui-config.md#conversation-pages) (beta): A record's page is its conversation, configured with no component of your own: a header with its title, topic and details, its messages grouped by day and author with mentions and edits shown, and a box that sends one, opening on a New messages line at the reader's place, on the web and at mobile width. People react to its messages, edit and delete them, reply in threads beside the conversation and share files that show under their message, by pointer or touch, and start or join the record's call from its header, shown beside the messages, or above them at mobile width.
14
+ - [Conversation pages](../reference/ui-config.md#conversation-pages) (beta): A record's page is its conversation, configured with no component of your own: a header with its title, topic and details, its messages grouped by day and author with mentions and edits shown, and a box that sends one, opening on a New messages line at the reader's place, on the web and at mobile width. People react to its messages, edit and delete them, reply in threads beside the conversation and share files that show under their message, by pointer or touch, start or join the record's call from its header, shown beside the messages, or above them at mobile width, and see who else types, in the conversation and in a thread, with or without a realtime relay.
15
15
  - [Read view and edit](../reference/ui-config.md#read-view-and-edit): A record opens as a read-only fact sheet or a form, and Edit opens the form at its own address.
16
16
  - [Unsaved edits](../reference/ui-config.md#editing-a-record): Unsaved changes to a record stay in the browser and can be resumed, and leaving a form, a dialog or a comment with changes asks first.
17
17
  - [Record forms](../reference/ui-config.md#editing-a-record): Relations are picked from a list that narrows as you type, numbers are read as the browser's language writes them, and a refused save says under each field what is wrong.
@@ -678,7 +678,7 @@ Recounts a [time rollup](data-config.md#keeping-it-up-to-date)'s buckets from th
678
678
  protobase relay app
679
679
  ```
680
680
 
681
- Prints the app's entry for the apps file of the [realtime relay](realtime-relay.md), as JSON: its `id`, `api_keys` and `ticket_keys` from `realtime.relay`, and in `origins` the origin of the app's `url` (or `PROTOBASE_URL`); with [presence](realtime-relay.md#presence), `presence` with the app's presence endpoint at that `url`, the presence key and a `grace_seconds` of 30. Add the relay's limits and options to it there. It reads `protobase.config.ts` with `command: 'tool'` and the `.env` nearest the current directory.
681
+ Prints the app's entry for the apps file of the [realtime relay](realtime-relay.md), as JSON: its `id`, `api_keys` and `ticket_keys` from `realtime.relay`, and in `origins` the origin of the app's `url` (or `PROTOBASE_URL`); in `client_events` each channel resource's [client events](realtime-relay.md#client-events), with `typing` on those whose conversation page types; with [presence](realtime-relay.md#presence), `presence` with the app's presence endpoint at that `url`, the presence key and a `grace_seconds` of 30. Add the relay's limits and options to it there. It reads `protobase.config.ts` with `command: 'tool'` and the `.env` nearest the current directory.
682
682
 
683
683
  ## `auth migration`
684
684
 
@@ -493,7 +493,7 @@ In an app with the [realtime relay](realtime-relay.md#pages), a chat of your own
493
493
  | | |
494
494
  | --- | --- |
495
495
  | `TypingLine` | The line above the box saying who else types on `channel`, by the names `useMembers()` gives; it keeps its height while nobody does, so the box does not move. |
496
- | `useTypers(channel)` | The user ids of the others who type on the channel now, each until six seconds after the last they sent; empty without the relay or while it is down. |
496
+ | `useTypers(channel)` | The user ids of the others who type on the channel now, outside threads, each until six seconds after the last they sent; empty without the relay or while it is down. |
497
497
  | `useTypingSender(channel)` | `onText`, to call with the box's text as it changes, and `onSent`, once a message went: it sends `typing` events at most every three seconds, and that the reader stopped when they empty the box, send or leave. Nothing goes before the channel is joined. |
498
498
  | `useViewChannel(channel)` | Says the page shows the channel while it is drawn, so only its notices read the page again, and joins it when the connect ticket did not list it, such as a conversation the reader joined since. |
499
499
 
@@ -7,7 +7,7 @@ Hand the app's realtime connections to a relay, so the app and its database can
7
7
  The app can hand its realtime connections to a relay, the open source [protobase-realtime](https://github.com/PrototeamHQ/protobase-realtime) server: the relay holds everyone's WebSocket, and the app talks to it only when something changes, so a quiet app and its database sleep while people stay connected. The relay keeps no data and never reads the app's database: the app tells it who is in which channel, what changed and for whom, and which sign-in sessions ended. It works beside the app's own [channels](channels.md) and [live updates](live.md), which stay as they are.
8
8
 
9
9
  :::caution[In development]
10
- The app's side is built: tickets, membership, change notices, session ends and presence, and so are pages' side in `@protobase/client` and the admin app: [live updates, typing and unread marks](#pages). <gap>The config cannot declare the events clients send each other, such as typing, because declaring client events per channel resource is not implemented, so the relay's apps file declares them by hand.</gap>
10
+ The app's side is built: tickets, membership, change notices, session ends, presence and the [events clients send each other](#client-events), and so are pages' side in `@protobase/client` and the admin app: [live updates, typing and unread marks](#pages).
11
11
  :::
12
12
 
13
13
  ## Config
@@ -24,6 +24,7 @@ export default defineConfig(({ env }) => ({
24
24
  conversations: {
25
25
  members: { resource: 'conversation_members', channel: 'conversation_id', user: 'user_id' },
26
26
  mentions: 'mentions',
27
+ events: { ring: { schema: { type: 'object', properties: { call: { type: 'integer' } } }, maxBytes: 128, perSecond: 1, burst: 2 } },
27
28
  },
28
29
  rooms: {},
29
30
  },
@@ -41,6 +42,7 @@ export default defineConfig(({ env }) => ({
41
42
  | `channels` | The channel resources, by name. Each record of one is a channel, `<resource>/<key>`, named as its [record channel](channels.md) is; the resource needs a key of one field. |
42
43
  | `channels.<resource>.members` | Where the channel's members come from: a resource whose records each put one person in one channel, with its relation field to the channel resource (`channel`) and its field of the person's user id (`user`). Index both columns: tickets read by the user, notices by the channel. Without `members`, the channel is open: a channel of a public record, which tickets list when asked (see [Tickets](#tickets)). |
43
44
  | `channels.<resource>.mentions` | A field of the records noticed on the channel that lists the user ids they mention, an array or one id, which [notices](#notices) carry. |
45
+ | `channels.<resource>.events` | The [events](#client-events) the channel's members may send each other, by name, each with its payload's `schema`, its `maxBytes` and the rate one person may send it at, `perSecond` in bursts of `burst`. |
44
46
  | `presence` | Turns on [presence](#presence): the app's own resource it is kept in, its fields of the person's user id (`user`), the status (`status`) and when it began (`at`), and the bearer token of the relay's reports (`key`), at least 32 characters. |
45
47
 
46
48
  The relay needs the app's own [sign-in](auth.md), whose sessions its tickets name, with its store in the app's own database, as the `auth` config puts it: an auth store in another database is refused. A members resource's changes must be captured, so declare [`.live()`](live.md) on it; the relay hears of the changes of every resource whose changes are captured, such as a live one, that is a channel resource or has a relation field to one. [`protobase migration`](cli.md#migration) writes the trigger that ends a deleted session's sockets, in the `relay` schema, and the server checks it at start.
@@ -113,30 +115,30 @@ Each change of a person's presence is also published on `people` as a `presence_
113
115
 
114
116
  A person who shares no channel is published to no one. <gap>A page cannot show who of the others is online because reading presence in the pages is not implemented.</gap>
115
117
 
118
+ ## Client events
119
+
120
+ A channel resource's `events` say what its signed-in members may send each other on its channels through the relay, such as a call ringing; the relay refuses any other event there with `event_not_allowed`, and a payload outside its schema or size, or sent more often than its rate, likewise. A conversation page with `typing` declares `typing` on its resource itself (see [Pages](#pages)). Each event takes:
121
+
122
+ | Key | |
123
+ | --- | --- |
124
+ | `schema` | The payload's JSON schema, draft 2020-12 unless it names another; it may load no other document. |
125
+ | `maxBytes` | The payload's largest size in bytes, 1 to 65536. |
126
+ | `perSecond`, `burst` | How often one person may send it a second, over all their sockets, and how many at once: positive, `burst` a whole number. |
127
+
128
+ An event's name is 1 to 64 bytes and none of `heartbeat`, `interest`, `presence`, `client_event` and `phx_*`, which the relay keeps for itself; the server refuses to start otherwise. The relay checks the schemas when it reads its apps file. Visitors send nothing. A page sends one with [`client.relay.send`](#from-code), and the others hear it with `from`, the channel and the time the relay stamps on it. <gap>The config cannot declare direct events, which `client.relay.direct` sends to a person, because declaring direct client events is not implemented, so the relay's apps file declares them by hand.</gap>
129
+
116
130
  ## Pages
117
131
 
118
132
  With `realtime.relay`, the admin app follows the relay for someone signed in, on one socket per page, and `/meta` names the resources whose changes the relay notices:
119
133
 
120
134
  - **Live updates:** the lists, records and counts of those resources are read again as the relay notices their changes, new, edited and deleted records alike, instead of through [`/api/live`](live.md), which stays for the other `.live()` resources. While a [conversation page](ui-config.md#conversation-pages) is open, only its own channel's notices read it again; the notices of other channels only move the [unread marks](sidebar.md#typing-and-unread-from-the-relay). After the socket was down, everything shown is read again once.
121
- - **Typing:** a conversation page with `typing` says who else types, above its box, and tells the others while the reader types, as `typing` events on the record's channel. A sidebar group with [`typing`](sidebar.md#typing-and-unread-from-the-relay) says "typing…" beside a record someone types in, wherever the reader is.
135
+ - **Typing:** a conversation page with `typing` says who else types, above its box and in a thread's box, and tells the others while the reader types, as `typing` events on the record's relay channel. Without the relay, it goes over the record's own [channel](channels.md) instead. A sidebar group with [`typing`](sidebar.md#typing-and-unread-from-the-relay) says "typing…" beside a record someone types in, wherever the reader is.
122
136
  - **Unread:** a sidebar group with [`unread`](sidebar.md#typing-and-unread-from-the-relay) counts each conversation's unread messages once, then adds the relay's notices without reading.
123
137
  - **Presence:** the page tells the relay the person is away while it is hidden and online once it shows; a page that shows again, or a device back online, connects again at once.
124
138
 
125
- The relay refuses events the app did not declare, so declare typing in the relay's apps file, on each channel resource with typing:
126
-
127
- ```json
128
- "client_events": {
129
- "channels": {
130
- "conversations": {
131
- "events": {
132
- "typing": { "schema": { "type": "object", "properties": { "typing": { "type": "boolean" } }, "required": ["typing"] }, "max_bytes": 64, "per_second": 2, "burst": 4 }
133
- }
134
- }
135
- }
136
- }
137
- ```
139
+ A conversation page with `typing` declares the event on its resource's channels: `protobase relay app` prints it in the apps file entry, and the relay `protobase dev` runs takes it too. A page sends `{ typing, thread }`, `thread` the key of the thread's first message or null, at most 256 bytes, 2 a second in bursts of 4. A `typing` the resource declares in its own `events` takes its place.
138
140
 
139
- A conversation page's `typing` needs its resource among `channels`: the server refuses to start otherwise.
141
+ With the relay, a conversation page's `typing` needs its resource among `channels`: the server refuses to start otherwise.
140
142
 
141
143
  <gap>A page does not hear of a channel the person joined after it connected, such as a new direct message, until it opens that conversation or connects again, because telling a person's sockets of a new channel is not implemented.</gap> <gap>An unread count also counts the reader's own messages sent from another device or tab, until they open the conversation, because notices do not name who made the change.</gap>
142
144
 
@@ -155,7 +155,7 @@ view<typeof conversations>('conversations')
155
155
  .record({ conversation: { resource: 'messages', field: 'conversation_id', sender: 'author_id', time: 'sent_at', text: 'body', readPosition: { resource: 'read_positions', field: 'conversation_id', message: 'last_read_id' }, typing: true } })
156
156
  ```
157
157
 
158
- - `typing` says "typing…" after a record's title while someone else types in it, wherever the reader is in the app, for six seconds after the last they heard, and not while the relay is down. The open conversation's row leaves it out: the line above its box says who types.
158
+ - `typing` says "typing…" after a record's title while someone else types in it, wherever the reader is in the app, for six seconds after the last they heard, and not while the relay is down. The open conversation's row leaves it out: the line above its box says who types. <gap>A sidebar group's `typing` cannot say "typing…" in an app without the realtime relay because following every listed record's own channel is not implemented.</gap>
159
159
  - `unread` draws a record bold, with the count of the messages others wrote after the reader's read position. It is counted as the group shows, in two requests, the reader's read positions and one aggregate of the messages grouped by conversation in the database, and again after the relay reconnects. In between, each new message the relay notices on a conversation adds one without reading anything; the open conversation counts none, and opening one clears its count.
160
160
 
161
161
  Both mark the group's own records over a `marks` hook's, so a direct message's row can still name its person.
@@ -846,7 +846,7 @@ view<typeof channels>('channels').record({
846
846
  | `thread` | Replies in a thread under a message, in a panel beside the conversation: `{ field, count, last }`. |
847
847
  | `attachments` | [Files](#files-in-messages) a message carries, kept in a resource of their own: `{ resource, field, file, width, height }`. |
848
848
  | `call` | The record's [call](calls.md), by the name of the [API function](../guides/api-functions.md) that admits people to it. |
849
- | `typing` | `true`: a line above the box says who else types, by their names among the organization's members, and the others hear while the reader types, through the app's [realtime relay](realtime-relay.md#pages); the record's resource is one of its channel resources. |
849
+ | `typing` | `true`: a line above the box says who else types, by their names among the organization's members, and the others hear while the reader types, each shown until six seconds after the last they sent or until they send or empty the box; a thread's panel says who types in that thread alone. It works with or without a relay: through the app's [realtime relay](realtime-relay.md#pages) when it has one, whose channel resources then include the record's resource, and otherwise over the record's own [channel](channels.md), which only those who may read the record join. |
850
850
 
851
851
  The header shows the record's title, which the top bar repeats at mobile width and so shows there only with `members`, the subtitle, the call with `call`, and *Details*, a link to the record's standard page at `?standard=true`, with its sections, Edit and Delete. The latest 50 messages show oldest first, with *Load earlier messages* at the top for more. A day divider opens each day, and one person's messages sent within five minutes of each other show under their name once. A message resource with [`.live()`](live.md) shows new, changed and deleted messages as they happen. Every read goes through the reader's own access: a message they may not read never shows, and a reader who may not read the messages, a field each one needs or the fields of `thread` gets the standard page. The box shows for a reader who may create messages.
852
852