@soffits/dsh-notify-inbox 0.1.1 → 0.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.2
4
+
5
+ - The buttons chunk registers as a chunk of the package (`{ id, chunk }`), so a page that got the plugin while it was open loads the buttons instead of failing with "loaded without registering"; a failed load is retried next time and never hides the list.
6
+ - A press that gets handled shows as handled without reloading the page.
7
+
3
8
  ## 0.1.1
4
9
 
5
10
  - Buttons come from the shared action bar (`client.actions.js`, the same one the card board uses), so both pages look and behave alike; buttons without a label get the shared words.
package/client.actions.js CHANGED
@@ -254,6 +254,4 @@ function createActions({ React, ctx, locale = 'en', press }) {
254
254
  return { ActionBar, ActionButton, Icon, startChat, chatText, t }
255
255
  }
256
256
 
257
- if (typeof window !== 'undefined' && window.__ModuleLoader__) {
258
- window.__ModuleLoader__.load({ id: `${OWNER}/client.actions.js`, factory: () => ({ createActions, chatText }) })
259
- }
257
+ window.__ModuleLoader__.load({ id: OWNER, chunk: 'client.actions.js', factory: () => ({ createActions, chatText }) })
package/client.js CHANGED
@@ -163,7 +163,7 @@ window.__ModuleLoader__.load({
163
163
  try {
164
164
  const summary = await call('summary')
165
165
  shared.pollSeconds = summary.pollSeconds || 30
166
- const key = `${summary.unread}|${summary.latest}|${summary.total}`
166
+ const key = `${summary.unread}|${summary.latest}|${summary.total}|${summary.handled}`
167
167
  if (key !== lastSummary) {
168
168
  lastSummary = key
169
169
  shared.unread = summary.unread
@@ -206,7 +206,7 @@ window.__ModuleLoader__.load({
206
206
  // ---- the buttons: the shared action bar (client.actions.js, also used by the card board) ----
207
207
 
208
208
  let actionsModule
209
- const loadActions = () => (actionsModule ??= require.async('./client.actions.js'))
209
+ const loadActions = () => (actionsModule ??= require.async('./client.actions.js').catch(error => { actionsModule = undefined; throw error }))
210
210
 
211
211
  /** The server's view of each button's last press: pending, done or unhandled. */
212
212
  function pressStates(item) {
@@ -371,7 +371,7 @@ window.__ModuleLoader__.load({
371
371
  const [ui, setUi] = useState(null)
372
372
  useEffect(() => {
373
373
  let live = true
374
- makeActions(t('time.locale')).then(made => { if (live) setUi(made) }, reason => { if (live) setError(reason.message) })
374
+ makeActions(t('time.locale')).then(made => { if (live) setUi(made) }, reason => { console.warn('notify-inbox: buttons unavailable', reason) })
375
375
  return () => { live = false }
376
376
  }, [])
377
377
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soffits/dsh-notify-inbox",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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",
package/src/routes.js CHANGED
@@ -89,7 +89,8 @@ export function createRoutes({ store, people, push, actions, identity, serviceWo
89
89
  const summary = handle(async (_request, who) => {
90
90
  const { items, bad } = await store.view(who.folders)
91
91
  const unread = items.filter(item => !item.read).length
92
- return json(200, { mode: who.mode, person: who.person, unread, total: items.length, latest: items[0]?.time ?? null, problems: { badLines: bad }, pollSeconds })
92
+ const handled = items.reduce((sum, item) => sum + item.handled.length, 0)
93
+ return json(200, { mode: who.mode, person: who.person, unread, total: items.length, handled, latest: items[0]?.time ?? null, problems: { badLines: bad }, pollSeconds })
93
94
  })
94
95
 
95
96
  const list = handle(async (request, who) => {