@soffits/dsh-notify-inbox 0.1.2 → 0.1.3

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,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.3
4
+
5
+ - The buttons chunk keeps its names inside its own scope, so it loads next to another plugin's copy on the same page (DSH runs chunks as classic scripts in one global scope).
6
+ - Touch targets are at least 40 px on phones and touch screens.
7
+ - A notification you open under Unread stays on screen instead of vanishing as it turns read.
8
+
3
9
  ## 0.1.2
4
10
 
5
11
  - 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.
package/client.actions.js CHANGED
@@ -18,6 +18,7 @@
18
18
  * UI's own workspace service (so the person sends it themselves, signed in as
19
19
  * themselves), and link opens the URL.
20
20
  */
21
+ (() => {
21
22
  const OWNER = '@soffits/dsh-notify-inbox'
22
23
 
23
24
  const WORDS = {
@@ -255,3 +256,4 @@ function createActions({ React, ctx, locale = 'en', press }) {
255
256
  }
256
257
 
257
258
  window.__ModuleLoader__.load({ id: OWNER, chunk: 'client.actions.js', factory: () => ({ createActions, chatText }) })
259
+ })()
package/client.js CHANGED
@@ -13,7 +13,7 @@ window.__ModuleLoader__.load({
13
13
  factory(require) {
14
14
  const React = require('react')
15
15
  const h = React.createElement
16
- const { useState, useEffect, useCallback, useSyncExternalStore } = React
16
+ const { useState, useEffect, useCallback, useRef, useSyncExternalStore } = React
17
17
 
18
18
  const NS = 'dsh-notify-inbox'
19
19
  const PANEL = 'dsh-notify-inbox'
@@ -137,6 +137,7 @@ window.__ModuleLoader__.load({
137
137
  .nib-more{margin:12px auto 0;display:flex}
138
138
  .nib-icon{position:relative;display:inline-flex}
139
139
  .nib-badge{position:absolute;top:-5px;right:-8px;min-width:14px;height:14px;padding:0 3px;box-sizing:border-box;border-radius:7px;background:var(--dsw-alias-state-error-primary);color:#fff;font-size:9px;font-weight:600;line-height:14px;text-align:center;pointer-events:none}
140
+ @media (width<=640px),(pointer:coarse){.nib-btn,.nib-tab,.nib-page .ua-btn{min-height:40px;min-width:40px}.nib-tab{padding-inline:14px}.nib-tabs{border-radius:12px}}
140
141
  @media (width<=640px){.nib-content{padding-inline:12px}.nib-head{padding-top:16px}.nib-body{margin-left:0}.nib-item{padding:10px 8px}}
141
142
  `
142
143
 
@@ -368,6 +369,8 @@ window.__ModuleLoader__.load({
368
369
  const [more, setMore] = useState(false)
369
370
  const [error, setError] = useState(null)
370
371
  const [open, setOpen] = useState(() => shared.linked)
372
+ const openRef = useRef(open)
373
+ openRef.current = open
371
374
  const [ui, setUi] = useState(null)
372
375
  useEffect(() => {
373
376
  let live = true
@@ -381,7 +384,15 @@ window.__ModuleLoader__.load({
381
384
  if (filter === 'unread') params.set('unread', '1')
382
385
  if (append && items?.length) params.set('before', items[items.length - 1].id)
383
386
  const page = await call(`items?${params}`)
384
- setItems(previous => (append && previous ? [...previous, ...page.items] : page.items))
387
+ setItems(previous => {
388
+ if (append && previous) return [...previous, ...page.items]
389
+ // The open item stays where it was even when it no longer matches the filter (opening marks it read).
390
+ const kept = previous?.findIndex(row => row.id === openRef.current) ?? -1
391
+ if (kept < 0 || page.items.some(row => row.id === openRef.current)) return page.items
392
+ const next = [...page.items]
393
+ next.splice(Math.min(kept, next.length), 0, { ...previous[kept], read: true })
394
+ return next
395
+ })
385
396
  setMore(page.more)
386
397
  setError(null)
387
398
  } catch (reason) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soffits/dsh-notify-inbox",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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",