diff --git a/pkg/garden/app/hark-system-hook.hoon b/pkg/garden/app/hark-system-hook.hoon index de333cb5ed..fec10288e5 100644 --- a/pkg/garden/app/hark-system-hook.hoon +++ b/pkg/garden/app/hark-system-hook.hoon @@ -50,7 +50,7 @@ :: %commit ?. |(=(desk.diff %base) ~(has-docket de:cc desk.diff)) `this - =/ =action:hark ~(updated de:cc desk.diff) + =/ =action:hark ~(commit de:cc desk.diff) :_ this ~[(poke:ha:cc action)] :: @@ -118,6 +118,8 @@ ++ docket .^(docket:^docket %cx scry-path) ++ hash .^(@uv %cz (scry:io desk ~)) ++ place `place:hark`[q.byk.bowl /desk/[desk]] + ++ vat + .^(vat:hood %gx (scry:io %hood /kiln/vat/[desk]/noun)) ++ body |= [=path title=cord content=(unit cord)] ^- body:hark @@ -137,6 +139,15 @@ (rap 3 'version: ' (ver version:docket) ~) (rap 3 'hash: ' (scot %uv hash) ~) :: + ++ commit + ^- action:hark + ?:(=(1 ud.cass:vat) created updated) + :: + ++ created + ^- action:hark + :+ %add-note [/created place] + (body /desk/[desk] (title-prefix ' has been installed') ~) + :: ++ updated ^- action:hark :+ %add-note [/update place] diff --git a/pkg/garden/lib/hark/store.hoon b/pkg/garden/lib/hark/store.hoon index 22257ef038..86c2b2ab0a 100644 --- a/pkg/garden/lib/hark/store.hoon +++ b/pkg/garden/lib/hark/store.hoon @@ -23,6 +23,7 @@ %unread-count (unread-count +.upd) %saw-place (saw-place +.upd) %all-stats (all-stats +.upd) + %del-place (place +.upd) ::%read-note (index +.upd) ::%note-read (note-read +.upd) %archived (archived +.upd) diff --git a/pkg/grid/src/nav/notifications/BasicNotification.tsx b/pkg/grid/src/nav/notifications/BasicNotification.tsx index bbdd1713ff..8d03c68ce1 100644 --- a/pkg/grid/src/nav/notifications/BasicNotification.tsx +++ b/pkg/grid/src/nav/notifications/BasicNotification.tsx @@ -71,9 +71,11 @@ export const BasicNotification = ({ notification, lid }: BasicNotificationProps)

-
- -
+ {!('time' in lid) ? ( +
+ +
+ ) : null} {contents.length > 0 ? (
diff --git a/pkg/grid/src/state/hark.ts b/pkg/grid/src/state/hark.ts index 5c6f365555..46f6eacbc7 100644 --- a/pkg/grid/src/state/hark.ts +++ b/pkg/grid/src/state/hark.ts @@ -81,6 +81,10 @@ export const useHarkStore = createState( set(newState); }, archiveAll: async () => { + get().set((draft) => { + draft.unseen = {}; + draft.seen = {}; + }); await api.poke(archiveAll); }, archiveNote: async (bin, lid) => { @@ -189,6 +193,23 @@ function reduceHark(u: any) { delete draft.unseen[bin]; }); }); + } else if ('del-place' in u) { + const { path, desk } = u['del-place']; + const pathId = `${desk}${path}`; + const wipeBox = (t: Timebox) => { + Object.keys(t).forEach((bin) => { + if (bin.startsWith(pathId)) { + delete t[bin]; + } + }); + }; + set((draft) => { + wipeBox(draft.unseen); + wipeBox(draft.seen); + draft.archive.keys().forEach((key) => { + wipeBox(draft.archive.get(key)!); + }); + }); } }