@soffits/dsh-notify-inbox 0.8.1 → 0.9.0
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 +4 -0
- package/README.md +1 -0
- package/client.js +8 -3
- package/index.js +3 -0
- package/package.json +1 -1
- package/src/routes.js +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
- `quiet`: people whose bell shows a soft grey dot when something is new, never a red count, so their inbox invites rather than nags. The summary says which (`badge`: `count` or `dot`).
|
|
6
|
+
|
|
3
7
|
## 0.8.1
|
|
4
8
|
|
|
5
9
|
- 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.
|
package/README.md
CHANGED
|
@@ -43,6 +43,7 @@ Restart `dsh web`. The inbox appears in the sidebar. Then set `dataDir` in a pro
|
|
|
43
43
|
| `summaryHours` | `12` | How long the summary line is shown after it was written. |
|
|
44
44
|
| `replyCwd` | host default | The folder of the new session a reply opens when the ask names no session, or the one it names is gone (below). |
|
|
45
45
|
| `replyPreset` | host default | The agent preset of that new session. |
|
|
46
|
+
| `quiet` | none | People (person ids) whose bell never shows a count: a soft grey dot says something is new instead of a red number, for someone who wants their inbox to invite rather than nag. |
|
|
46
47
|
|
|
47
48
|
**Who sees what.** With a mapping, every request is checked on the server: a person sees, marks and presses only their own inbox, and a request without a verified identity sees nothing. The identity comes from any plugin that provides a `requestIdentity` service (`current()` → `{ provider, issuer, id, name } | null`), such as [dsh-oidc](https://github.com/soffits/dsh-oidc) 0.3.0-alpha.9 or later. Without a mapping (a DSH only you use), you see every folder.
|
|
48
49
|
|
package/client.js
CHANGED
|
@@ -92,6 +92,7 @@ window.__ModuleLoader__.load({
|
|
|
92
92
|
.nib-empty{padding:48px 20px;text-align:center;color:var(--dsw-alias-label-tertiary)}
|
|
93
93
|
.nib-error{color:var(--dsw-alias-state-error-primary)}
|
|
94
94
|
.nib-more{display:flex;justify-content:center}
|
|
95
|
+
.nib-dot{position:absolute;top:-2px;right:-3px;width:7px;height:7px;border-radius:50%;background:var(--dsw-alias-label-tertiary);pointer-events:none}
|
|
95
96
|
.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}
|
|
96
97
|
.nib-bell{position:relative;display:inline-flex}
|
|
97
98
|
@media (width<=640px){.nib-content{padding-inline:12px}.nib-heading{padding-top:16px}.nib-item{padding:8px 6px}.nib-line{gap:10px}}
|
|
@@ -100,7 +101,7 @@ window.__ModuleLoader__.load({
|
|
|
100
101
|
|
|
101
102
|
// ---- shared state: the counts and a version that bumps when anything changes ----
|
|
102
103
|
|
|
103
|
-
const shared = { unread: 0, version: 0, linked: null, ui: null, kit: null, summary: null, openSession: () => {} }
|
|
104
|
+
const shared = { unread: 0, badge: 'count', version: 0, linked: null, ui: null, kit: null, summary: null, openSession: () => {} }
|
|
104
105
|
const listeners = new Set()
|
|
105
106
|
const emit = () => { for (const listener of listeners) listener() }
|
|
106
107
|
const subscribe = listener => { listeners.add(listener); return () => listeners.delete(listener) }
|
|
@@ -120,10 +121,11 @@ window.__ModuleLoader__.load({
|
|
|
120
121
|
async function refreshSummary() {
|
|
121
122
|
try {
|
|
122
123
|
const summary = await call('summary')
|
|
123
|
-
const key = JSON.stringify([summary.unread, summary.latest, summary.total, summary.groups, summary.line])
|
|
124
|
+
const key = JSON.stringify([summary.unread, summary.badge, summary.latest, summary.total, summary.groups, summary.line])
|
|
124
125
|
if (key !== lastSummary) {
|
|
125
126
|
lastSummary = key
|
|
126
127
|
shared.unread = summary.unread
|
|
128
|
+
shared.badge = summary.badge === 'dot' ? 'dot' : 'count'
|
|
127
129
|
shared.summary = summary
|
|
128
130
|
shared.version += 1
|
|
129
131
|
emit()
|
|
@@ -501,9 +503,12 @@ window.__ModuleLoader__.load({
|
|
|
501
503
|
|
|
502
504
|
function SidebarIcon({ size }) {
|
|
503
505
|
const unread = useShared(s => s.unread)
|
|
506
|
+
const badge = useShared(s => s.badge)
|
|
504
507
|
return h('span', { className: 'nib-bell' },
|
|
505
508
|
h(BellGlyph, { size }),
|
|
506
|
-
unread > 0 &&
|
|
509
|
+
unread > 0 && (badge === 'dot'
|
|
510
|
+
? h('span', { className: 'nib-dot' })
|
|
511
|
+
: h('span', { className: 'nib-badge' }, unread > 99 ? '99+' : String(unread))))
|
|
507
512
|
}
|
|
508
513
|
|
|
509
514
|
return {
|
package/index.js
CHANGED
|
@@ -52,6 +52,8 @@ export const Config = z.object({
|
|
|
52
52
|
.description('The folder of the new session a reply opens when the item names no conversation, or the one it names is gone or archived. Empty means the host default. A leading ~/ means the home folder.'),
|
|
53
53
|
replyPreset: z.string().default('')
|
|
54
54
|
.description('The agent preset of that new session. Empty means the host default.'),
|
|
55
|
+
quiet: z.array(z.string()).default([])
|
|
56
|
+
.description('People (person ids) whose bell never shows a count: a soft dot says something is new, so their inbox invites rather than nags.'),
|
|
55
57
|
})
|
|
56
58
|
|
|
57
59
|
/**
|
|
@@ -175,6 +177,7 @@ export function apply(ctx, config) {
|
|
|
175
177
|
reply,
|
|
176
178
|
domains: domainMap(config.domains ?? {}),
|
|
177
179
|
summaryHours: config.summaryHours ?? 12,
|
|
180
|
+
quiet: config.quiet ?? [],
|
|
178
181
|
})
|
|
179
182
|
for (const route of routes) ctx.connection.fetch.register(route)
|
|
180
183
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soffits/dsh-notify-inbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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
|
@@ -74,7 +74,8 @@ async function body(request) {
|
|
|
74
74
|
* @param {Record<string, { icon: string, tone?: string }>} options.domains - the domain map (src/domains.js)
|
|
75
75
|
* @param {number} options.summaryHours - how long a summary line is shown
|
|
76
76
|
*/
|
|
77
|
-
export function createRoutes({ store, people, push, actions, identity, serviceWorker, strings = async () => ({}), reply, changes, domains, summaryHours }) {
|
|
77
|
+
export function createRoutes({ store, people, push, actions, identity, serviceWorker, strings = async () => ({}), reply, changes, domains, summaryHours, quiet = [] }) {
|
|
78
|
+
const hushed = new Set(quiet.map(person => String(person).trim().toLowerCase()))
|
|
78
79
|
/** Who is asking, as the inbox folders they may read; undefined with the response to send instead. */
|
|
79
80
|
async function caller() {
|
|
80
81
|
const viewer = await viewerOf(people, identity())
|
|
@@ -110,7 +111,8 @@ export function createRoutes({ store, people, push, actions, identity, serviceWo
|
|
|
110
111
|
const [{ items, bad }, line] = await Promise.all([itemsOf(who), store.summaryLine(who.folders, summaryHours)])
|
|
111
112
|
const { groups, unread } = countItems(items)
|
|
112
113
|
const latest = items.reduce((newest, item) => (newest === null || item.time > newest ? item.time : newest), null)
|
|
113
|
-
|
|
114
|
+
const badge = who.person !== null && who.person !== undefined && hushed.has(who.person.toLowerCase()) ? 'dot' : 'count'
|
|
115
|
+
return json(200, { mode: who.mode, person: who.person, unread, badge, groups, total: items.length, latest, line, domains, problems: { badLines: bad } })
|
|
114
116
|
})
|
|
115
117
|
|
|
116
118
|
const list = handle(async (request, who) => {
|