@protobase/cli 0.121.5 → 0.121.6

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.121.5";
2
+ var version = "0.121.6";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.121.5",
3
+ "version": "0.121.6",
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.121.5",
47
- "@protobase/layout": "0.121.5",
48
- "@protobase/query": "0.121.5",
49
- "@protobase/schema": "0.121.5",
50
- "@protobase/server": "0.121.5",
51
- "@protobase/ui": "0.121.5",
52
- "@protobase/workflows": "0.121.5",
46
+ "@protobase/config": "0.121.6",
47
+ "@protobase/layout": "0.121.6",
48
+ "@protobase/query": "0.121.6",
49
+ "@protobase/schema": "0.121.6",
50
+ "@protobase/server": "0.121.6",
51
+ "@protobase/ui": "0.121.6",
52
+ "@protobase/workflows": "0.121.6",
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",
@@ -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.
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 and reply in threads beside the conversation, by pointer or touch.
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.
@@ -775,7 +775,7 @@ The standard record page, with the layout's sections, the related records, Edit
775
775
  ### Conversation pages
776
776
 
777
777
  :::caution[Beta]
778
- A conversation page shows each message's text with its mentions and keeps line breaks, without markdown; it has no replies in threads, reactions, editing, deleting, files or calls yet.
778
+ A conversation page shows each message's text with its mentions and keeps line breaks, without markdown; it has no files or calls yet, and a deleted message leaves no trace in its place.
779
779
  :::
780
780
 
781
781
  `.record({ conversation })` makes the record page the record's conversation, for a record that holds one, such as a chat channel, a direct message or a support case, with no component of the app's own. It fills the content area as a [full-area record page](#full-area-record-pages) does, on the web and at mobile width: a header row, the messages that point at the record, and a box that sends one, which stays in view while the messages scroll above it.
@@ -793,6 +793,16 @@ view<typeof channels>('channels').record({
793
793
  subtitle: 'topic',
794
794
  readPosition: { resource: 'read_positions', field: 'channel_id', message: 'last_read_id' },
795
795
  placeholder: 'Message the channel',
796
+ edit: true,
797
+ delete: { unless: 'reply_count > 0' },
798
+ reactions: {
799
+ resource: 'reactions',
800
+ field: 'message_id',
801
+ user: 'user_id',
802
+ emoji: 'emoji',
803
+ labels: { thumbs_up: { symbol: '👍', name: 'Thumbs up' }, heart: { symbol: '❤️', name: 'Heart' } },
804
+ },
805
+ thread: { field: 'thread_id', count: 'reply_count', last: 'last_reply_at' },
796
806
  },
797
807
  })
798
808
  ```
@@ -811,11 +821,26 @@ view<typeof channels>('channels').record({
811
821
  | `readPosition` | Where each reader's read position is kept: `{ resource, field, message }`. |
812
822
  | `placeholder` | The hint in the empty box. |
813
823
  | `empty` | What the conversation says while it has no messages. |
824
+ | `edit` | `true`: a message's author changes its text and mentions in place, as the message resource's update access allows. |
825
+ | `delete` | `true`: anyone the message resource's delete access allows deletes a message, after confirming; or `{ unless }`, a condition on the message's own fields that keeps it, such as `reply_count > 0`. |
826
+ | `reactions` | Emoji reactions under each message: `{ resource, field, user, emoji, labels }`. |
827
+ | `thread` | Replies in a thread under a message, in a panel beside the conversation: `{ field, count, last }`. |
814
828
 
815
- The header shows the record's title, which the top bar repeats at mobile width and so shows there only with `members`, the subtitle, 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 or a field each one needs gets the standard page. The box shows for a reader who may create messages.
829
+ The header shows the record's title, which the top bar repeats at mobile width and so shows there only with `members`, the subtitle, 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.
816
830
 
817
831
  With `readPosition`, the conversation opens on a *New messages* line above the first message someone else wrote since the reader's position, and moves the position to the newest message whenever they read to the end. The read position resource keeps one record per reader and record: its `.author()` is the reader, `field` is a relation to the record and `message` an integer field holding the key of the newest message read, so the message resource's key is one integer column that grows as messages arrive. The page reads and writes only the reader's own position. Without `readPosition`, there is no line and nothing is written.
818
832
 
833
+ #### Reactions, edits, deletes and threads
834
+
835
+ With `reactions`, `edit`, `delete` or `thread`, people act on the messages where they read them. With a pointer, a bar over a message's corner shows while they point at it or move into it with the keyboard: an emoji they have not reacted with yet, *Reply in thread*, *Edit* and *Delete*. On a touch screen, a tap or a long-press of half a second opens the same actions in a sheet from the bottom at mobile width, with every emoji and *Copy text*; a tap while the reader types only lowers the keyboard, and a button that only a keyboard or screen reader reaches opens the sheet too. The message's own links and buttons keep their tap and click. Each action shows only where the reader's access allows it, and the server checks every write again: a refused one changes nothing and shows the server's reason.
836
+
837
+ - **Reactions**: `resource` keeps one record per person, message and emoji: `field` is its filterable relation to the message, `user` the text field of the user id of the person who reacted, set by the server, such as its `.author()`, and `emoji` an enum field whose values, in their order, are the emoji offered. `labels` gives each value its `symbol` and its `name`, which a screen reader reads. Under a message, one chip per emoji shows how many reacted, naming them on hover: pressing your own takes it back, and another's adds yours. The reactions of a page of messages are read together with it, and with [`.live()`](live.md) they change as people react.
838
+ - **Edit**: *Edit* turns the author's message into a box with its mentions kept: Enter saves, Shift+Enter starts a new line and Escape cancels.
839
+ - **Delete**: *Delete* asks before the message goes for everyone. A reader who may not read the fields `unless` reads gets no *Delete*.
840
+ - **Threads**: `field` is the filterable relation of the messages to themselves that holds a reply's first message, empty for a message of the conversation itself, `count` an integer field holding a first message's number of replies and `last` a date or timestamp field holding when its last reply came, both kept by the database, such as by a trigger. The conversation shows only messages outside threads; under a message with replies, a link names how many and when the last came. It and *Reply in thread* open the thread at `?thread=<key>`, so a link can open it too: in a panel beside the conversation, covering the screen at mobile width, with the first message, its replies and a box of its own that replies in the thread. An address naming a message of another conversation opens no thread there. A reply gets its first message's conversation from the box, so keep the two the same in the database, such as by a check in the trigger that counts the replies, as an API create can set them apart.
841
+
842
+ <gap>A conversation page cannot offer *Edit* when its `sender` is a relation because matching a related record to the reader is not implemented; a `sender` of user ids, such as the resource's `.author()`, gets it.</gap>
843
+
819
844
  <gap>A conversation page cannot open at a given message, such as a search result, because opening a conversation at a message is not implemented.</gap> <gap>A conversation page cannot show a message's markdown because rendering markdown together with mentions is not implemented.</gap>
820
845
 
821
846
  ### Focus pages