@soffits/dsh-card-board 0.13.0 → 0.14.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.14.1
4
+
5
+ The page's words are read from the locale files on each request instead of once, so a page updated in place gets its new words right away instead of showing raw keys until it is reloaded.
6
+
7
+ ## 0.14.0
8
+
9
+ A countdown can carry up to 24 steps (was 8), enough for a whole travel day from waking up to landing. The next step is still marked and the passed ones dimmed.
10
+
3
11
  ## 0.13.0
4
12
 
5
13
  A stat item can carry an `icon`: a big tinted tile beside its label and number, like a Home Assistant tile, coloured with `iconTone`, the item's `tone` or the card's. A stat block with icons lays its numbers out in an even grid, and on a phone, where two numbers share a row, each tile sits above its words so the numbers keep their width. A countdown's `data.icon` sits the same way before the big number. The tile is 48 px (44 above a chart or rows, 40–42 on a phone). Needs dsh-ui-kit 0.5.0 for `trophy`, `medal`, `weight` and the high and low thermometers.
package/README.md CHANGED
@@ -143,7 +143,7 @@ A chip with `to` (an ISO time) gets a ticking "in 1d 19h" after its text.
143
143
 
144
144
  ### countdown
145
145
 
146
- A big ticking number until `to`, and the stops on the way with the next one marked. After `to` it says "now"; after `expiresAt` the card hides itself, so whoever writes it needn't remove it on time.
146
+ A big ticking number until `to`, and the stops on the way (up to 24) with the next one marked and the passed ones dimmed. After `to` it says "now"; after `expiresAt` the card hides itself, so whoever writes it needn't remove it on time.
147
147
 
148
148
  ```json
149
149
  { "to": "2026-03-04T07:40:00+01:00", "label": "until the train leaves", "sub": "3 h 10 m, one change", "icon": "luggage",
package/client.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @soffits/dsh-card-board 0.13.0: built by scripts/build.mjs from src/client/. Do not edit. */
1
+ /* @soffits/dsh-card-board 0.14.1: built by scripts/build.mjs from src/client/. Do not edit. */
2
2
  window.__ModuleLoader__.load({
3
3
  id: "@soffits/dsh-card-board",
4
4
  factory: (require) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soffits/dsh-card-board",
3
- "version": "0.13.0",
3
+ "version": "0.14.1",
4
4
  "description": "A data-driven card board for DeepSeek Harness: scripts write small JSON cards, the Web UI shows each person the boards they may see.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/messages.js CHANGED
@@ -41,13 +41,12 @@ export function messagesFor(languages, tag) {
41
41
  }
42
42
 
43
43
  /**
44
+ * The words for a language, read from the folder on every request. DSH swaps a plugin's browser half as
45
+ * soon as its files change, before the host half is reloaded, so words kept from start would hand a
46
+ * freshly updated page the old table (raw keys for every new message).
44
47
  * @param {string} directory - the package's `locale` folder
45
48
  * @returns {(tag: string) => Promise<{ tag: string, messages: Record<string, string> }>}
46
49
  */
47
50
  export function createMessages(directory) {
48
- let languages
49
- return async tag => {
50
- languages ??= readLanguages(directory)
51
- return messagesFor(await languages, tag)
52
- }
51
+ return async tag => messagesFor(await readLanguages(directory), tag)
53
52
  }
package/src/schema.js CHANGED
@@ -24,6 +24,8 @@ export const INVERSE_KINDS = Object.freeze(['done', 'snooze', 'event'])
24
24
  export const UNDO_KIND = 'undo'
25
25
  /** Suggested steps per card or row: a few clear next moves, not a menu. */
26
26
  export const MAX_STEPS = 3
27
+ /** Stops on a countdown's track: a whole travel day is more than eight. */
28
+ export const MAX_COUNTDOWN_STEPS = 24
27
29
  export const ACTION_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$/
28
30
  /** Row keys: stable ids, so the page can tell which row changed. The same shape as action ids. */
29
31
  export const KEY_PATTERN = ACTION_ID_PATTERN
@@ -533,7 +535,7 @@ function countdownData(c, data, path) {
533
535
  if (c.dateTime(v, join(path, 'expiresAt')) && toOk && Date.parse(v) < Date.parse(data.to)) c.fail(join(path, 'expiresAt'), 'must not be before to')
534
536
  })
535
537
  c.optional(data, 'steps', steps => {
536
- if (!c.array(steps, join(path, 'steps'), { min: 1, max: 8 })) return
538
+ if (!c.array(steps, join(path, 'steps'), { min: 1, max: MAX_COUNTDOWN_STEPS })) return
537
539
  steps.forEach((step, i) => {
538
540
  const p = join(join(path, 'steps'), i)
539
541
  if (!c.object(step, p, ['at', 'label'], ['sub', 'zone'])) return