@soffits/dsh-notify-inbox 0.8.0 → 0.8.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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.1
4
+
5
+ - A link to an item from another page of the app (`/?notify-inbox=<id>`, pushed in place) opens it; before, only a page load or a push did.
6
+ - `@deepseek-ai/schemastery` is a peer dependency, so an update never moves a private copy out from under the plugin.
7
+
3
8
  ## 0.8.0
4
9
 
5
10
  - A reply never dead-ends: when the ask names no session, or the one it names is gone, archived, can't be loaded or was a finished helper, it opens a new top-level session with the whole ask quoted in and the session that asked named, so someone can act on it. New options `replyCwd` and `replyPreset` say where that session starts. Every ask has a reply box now, not only those that name a session.
package/README.md CHANGED
@@ -95,6 +95,7 @@ What waits on the person's answer (a decision, a pick, a small step for someone
95
95
  - An ask that is a question lists its `options`; the writer gives each its own button (a `done` whose payload carries the answer), so a press answers it. One that is a task has a plain done.
96
96
  - A press on an ask's buttons is an action event like any other (`source.record` is the ask's id), for whatever keeps the list to act on.
97
97
  - Without `asks.json` nothing changes: notifications keep the group they were filed with.
98
+ - `/?notify-inbox=<id>` opens the inbox on one item, an ask (`todo:1a2b...`) or a notification: from a push, on a page load, or from a link on another page of the app that moves there in place (a card's row, for example).
98
99
 
99
100
  A line `{"v": 1, "type": "handled", "record": "<id>", "press": "<press id>", "action": "done", "result": "done", "time": "..."}` tells the inbox that a press on that record was dealt with (`result: "snoozed"` with `until` shows when it comes back). Bad lines are skipped and counted.
100
101
 
package/client.js CHANGED
@@ -601,14 +601,19 @@ window.__ModuleLoader__.load({
601
601
  }, 100)
602
602
  }
603
603
  ctx.effect(() => {
604
- const params = new URLSearchParams(location.search)
605
- if (params.has(LINK_PARAM)) {
604
+ // A link to an item opens it, at page load and when another page of the app links here in place
605
+ // (it pushes the URL and fires popstate, as DSH's own links do).
606
+ const followLink = () => {
607
+ const params = new URLSearchParams(location.search)
608
+ if (!params.has(LINK_PARAM)) return
606
609
  const id = params.get(LINK_PARAM)
607
610
  params.delete(LINK_PARAM)
608
611
  const query = params.toString()
609
612
  history.replaceState(history.state, '', `${location.pathname}${query ? `?${query}` : ''}${location.hash}`)
610
613
  openLinked(id)
611
614
  }
615
+ followLink()
616
+ window.addEventListener('popstate', followLink)
612
617
  const onMessage = event => {
613
618
  if (event.data?.type !== 'notify-inbox/open') return
614
619
  try {
@@ -619,7 +624,10 @@ window.__ModuleLoader__.load({
619
624
  }
620
625
  navigator.serviceWorker?.addEventListener('message', onMessage)
621
626
  navigator.serviceWorker?.startMessages?.()
622
- return () => navigator.serviceWorker?.removeEventListener('message', onMessage)
627
+ return () => {
628
+ window.removeEventListener('popstate', followLink)
629
+ navigator.serviceWorker?.removeEventListener('message', onMessage)
630
+ }
623
631
  }, 'notify-inbox: links')
624
632
  },
625
633
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soffits/dsh-notify-inbox",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "A notification inbox for DeepSeek Harness: each person sees their own notifications with read and unread, gets Web Push on their phone or browser, and can act on them.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -62,11 +62,14 @@
62
62
  "check": "for f in index.js client.js src/*.js test/*.js; do node --check \"$f\" || exit 1; done",
63
63
  "test": "node --test test/*.test.js"
64
64
  },
65
- "dependencies": {
66
- "@deepseek-ai/schemastery": "3.18.5"
67
- },
68
65
  "engines": {
69
66
  "node": ">=22",
70
67
  "dsh": ">=0.2.2-rc.1 <0.3.0-0"
68
+ },
69
+ "peerDependencies": {
70
+ "@deepseek-ai/schemastery": "^3.18.5"
71
+ },
72
+ "devDependencies": {
73
+ "@deepseek-ai/schemastery": "3.18.5"
71
74
  }
72
75
  }