@soffits/dsh-card-board 0.8.0 → 0.9.1
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.
- package/CHANGELOG.md +14 -0
- package/README.md +22 -4
- package/client.js +547 -225
- package/examples/boards/home/cards/chores.json +46 -3
- package/examples/boards/home/cards/weather.json +2 -1
- package/locale/en.json +6 -2
- package/locale/fr.json +6 -2
- package/locale/zh.json +6 -2
- package/package.json +1 -1
- package/src/presses.js +3 -1
- package/src/schema.js +51 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.1
|
|
4
|
+
|
|
5
|
+
- Select-all on a board no longer picks up chrome: summary chips, the day line, tiles, icons, new and just-now marks join the non-selectable parts; titles, notes and numbers still copy.
|
|
6
|
+
|
|
7
|
+
## 0.9.0
|
|
8
|
+
|
|
9
|
+
- A card opens: tap it (or its open button) and it shows in DSH's own dialog with the whole list, a taller chart, all its buttons and its optional `detail` (`text`, `facts`, `chart`, `history`). Keyed rows with a `detail` open the same way. The URL follows (`?board=…&card=…&row=…`), so a link opens the page with the card open, and Back closes it.
|
|
10
|
+
- Rows and stat items take a `link`: tapping goes there (an http(s) URL in a new tab, a path of this app in place).
|
|
11
|
+
- Charts show the value and date of the point under the pointer, on hover and on tap.
|
|
12
|
+
- Cards and rows answer hover and press in DSH's colours; a row's buttons show on hover with a mouse and stay visible on touch. A changed card settles, numbers ease to new values, rows a list opens fade in; nothing moves with reduced motion.
|
|
13
|
+
- A list row shows a checkbox only when it has a `done` action, and ticking it presses that action; decorative checkboxes are gone. A row's steps sit with its other buttons.
|
|
14
|
+
- A step press counts as done once recorded, since sending it is the whole job.
|
|
15
|
+
- Chrome (heads, tags, axes, legends, strips, buttons) isn't selectable; titles, notes and numbers are.
|
|
16
|
+
|
|
3
17
|
## 0.8.0
|
|
4
18
|
|
|
5
19
|
- Cards keep their own height: the board packs them like masonry (no card stretches to match a neighbour), and fills gaps with shorter cards.
|
package/README.md
CHANGED
|
@@ -107,6 +107,7 @@ A card:
|
|
|
107
107
|
| `link` | An `http(s)` URL or a `/path` the title row links to. |
|
|
108
108
|
| `stat` | Headline numbers above a chart or rows (beside a chart when the card is wide): the same shape as a `stat` card's `data`. |
|
|
109
109
|
| `actions` | Buttons on the card; see [Actions](#actions). |
|
|
110
|
+
| `detail` | More to show when the card is opened; see [Opening a card](#opening-a-card). |
|
|
110
111
|
| `data` | Depends on the type, below. |
|
|
111
112
|
|
|
112
113
|
Unknown fields are errors, so a typo fails when the file is written instead of quietly not showing. A card that doesn't parse or fails the schema shows as a small error card with the reason; the rest of the board is unaffected.
|
|
@@ -221,9 +222,9 @@ Each bar has a single `value` or named `values`; with `values` and no `stacked`,
|
|
|
221
222
|
}
|
|
222
223
|
```
|
|
223
224
|
|
|
224
|
-
`
|
|
225
|
+
A row with a `done` action shows a checkbox, and ticking it presses that action (the row's separate done button then goes); `checked: true` shows it ticked. A row without a `done` action shows no checkbox. `progress` draws a ring above the rows, with its `label` and an optional `sub`.
|
|
225
226
|
|
|
226
|
-
Rows (of lists and status cards) may also have an `icon` and a `tone` (a tile before the row), a `key` (a stable id, so the page can tell which row changed) and `active: { from, to }`: during that window the row is highlighted and says "now", earlier the same day it says "from 18:00". The page decides when, so nobody has to rewrite the file at noon. A row's `date` shows relative to today ("tomorrow", "in 3 days") and moves on by itself.
|
|
227
|
+
Rows (of lists and status cards) may also have an `icon` and a `tone` (a tile before the row), a `key` (a stable id, so the page can tell which row changed) and `active: { from, to }`: during that window the row is highlighted and says "now", earlier the same day it says "from 18:00". The page decides when, so nobody has to rewrite the file at noon. A row's `date` shows relative to today ("tomorrow", "in 3 days") and moves on by itself. A row may have a `link` (an `http(s)` URL, opened in a new tab, or a `/path` of this app, opened in place): tapping the row goes there. A keyed row may have a `detail` (below): tapping it opens it. Stat items take a `link` too.
|
|
227
228
|
|
|
228
229
|
### timeline
|
|
229
230
|
|
|
@@ -256,6 +257,23 @@ The [examples](examples/boards/home) folder has a complete board with one card o
|
|
|
256
257
|
|
|
257
258
|
Nothing to write for these. Each card has a content version (a hash of the card without `updatedAt`, so rewriting the same data changes nothing), and each keyed row its own. The server remembers, per person, which versions they have seen, so a dot marks what changed since they last looked, on any device. A card or row that changes while the page is open gets a short wash and "just now" first (only the dot with reduced motion).
|
|
258
259
|
|
|
260
|
+
### Opening a card
|
|
261
|
+
|
|
262
|
+
Tapping a card (anywhere that isn't one of its buttons, links or rows that open themselves), or its open button, opens it over the page in DSH's own dialog: the whole list, a taller chart, all its buttons, and its `detail` when it has one. Rows open the same way, with just that row, its `detail` and its buttons. The URL follows (`?board=home&card=chores`, `&row=<key>` for a row), so a link opens the board page with the card open, and Back closes it.
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
"detail": {
|
|
266
|
+
"text": "Three books, due at the branch on Elm Street.",
|
|
267
|
+
"facts": [{ "label": "Renewals left", "value": 1 }, { "label": "Fine per day", "value": "0.25 EUR" }],
|
|
268
|
+
"chart": { "type": "bar", "data": { "bars": [{ "x": "2026-02", "value": 4 }, { "x": "2026-03", "value": 3 }] } },
|
|
269
|
+
"history": [{ "at": "2026-02-20T15:10:00+01:00", "text": "Borrowed" }]
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Every part is optional: `text`, `facts` (label and value, up to 24), `chart` (a `line` or `bar` card's `data`) and `history` (newest first, up to 100). A row needs a `key` to carry a `detail`.
|
|
274
|
+
|
|
275
|
+
On a chart, hovering or tapping shows the value and date of the point under the pointer. Cards and rows answer a hover and a press; a row's buttons show on hover with a mouse and are always there on touch. A card that changes settles into place, numbers ease to their new value and rows that a list opens fade in; nothing moves with reduced motion. Buttons, tags, axes and other chrome aren't selectable; titles, notes and numbers are.
|
|
276
|
+
|
|
259
277
|
## Actions
|
|
260
278
|
|
|
261
279
|
A card, a list row or a status row can carry up to six buttons:
|
|
@@ -272,7 +290,7 @@ A card, a list row or a status row can carry up to six buttons:
|
|
|
272
290
|
```
|
|
273
291
|
|
|
274
292
|
- `chat` opens a new conversation (or the session named in `payload.session`) with a draft that quotes the card or row and carries its ids as JSON, after `payload.prompt` if you gave one. Nothing is sent until the person sends it, so the message comes from them like any other. Every card also has a chat button in its corner without declaring one ("Chat about this"); when the board names an `assistant` the buttons say who they ask ("Ask Robin"). A `label` and `payload.prompt` can be text in several languages.
|
|
275
|
-
- `step` is a suggested next step the assistant starts on one tap: the label says the step plainly ("Renew the books online") and the tap is the person's go-ahead for exactly that. The press is recorded on the server like `done`, then the page sends the step (`payload.prompt` when it needs more words than the label, never more than it authorises; otherwise the label) with the card or row into a new session (or `payload.session`) as the person, with no draft to confirm, and the button links to that session. At most 3 steps per card or row; add one only where the data has a clear next step. The label (up to 80 characters) is required.
|
|
293
|
+
- `step` is a suggested next step the assistant starts on one tap (on a row it sits with the row's other buttons, "Start" for instance): the label says the step plainly ("Renew the books online") and the tap is the person's go-ahead for exactly that. The press is recorded on the server like `done`, then the page sends the step (`payload.prompt` when it needs more words than the label, never more than it authorises; otherwise the label) with the card or row into a new session (or `payload.session`) as the person, with no draft to confirm, and the button links to that session. At most 3 steps per card or row; add one only where the data has a clear next step. The label (up to 80 characters) is required.
|
|
276
294
|
- `done`, `snooze` and `event` are pressed on the server. A snooze without `payload.until` asks: in 3 hours, tomorrow at 9:00, or a time.
|
|
277
295
|
- `link` opens `payload.url`.
|
|
278
296
|
|
|
@@ -295,7 +313,7 @@ The plugin doesn't act on a press itself. It checks that the person may see the
|
|
|
295
313
|
|
|
296
314
|
It's appended to the action log, emitted in-process as the Cordis event `card-board/action`, and published on channel `ui.action.<kind>` through [dsh-cron-jobs](https://github.com/soffits/dsh-cron-jobs) when that's installed, so a job subscribed to `ui.action.done` can mark the thing done wherever it lives. `person` is `owner` on a single-person DSH.
|
|
297
315
|
|
|
298
|
-
The button shows the press as pending until the card file is written again, then done. If nothing rewrites the card within `actionTimeoutSeconds`, it says nothing picked the press up. So a handler should rewrite the card when it has acted, even if only `updatedAt` changes.
|
|
316
|
+
The button shows the press as pending until the card file is written again, then done (a step is done once recorded, since sending it is the whole job). If nothing rewrites the card within `actionTimeoutSeconds`, it says nothing picked the press up. So a handler should rewrite the card when it has acted, even if only `updatedAt` changes.
|
|
299
317
|
|
|
300
318
|
The buttons come from [`@soffits/dsh-ui-actions`](https://github.com/soffits/dsh-ui-actions), a separate plugin the board uses when it is installed (`dsh plugin --profile web add @soffits/dsh-ui-actions`; DSH 0.2.2-rc.1 or later). Without it cards show no buttons. A chat button opens a new conversation with the card or row attached to the message box as a small card, and the person writes beside it; a chat button's words ("Ask", "Chat about this") and the done and snooze buttons' words come from that plugin, in the person's language. On a phone the buttons are at least 40 px, and a snooze picker opens as a sheet at the bottom of the screen.
|
|
301
319
|
|