hark-store: add time field to %seen-index

This commit is contained in:
Liam Fitzgerald 2021-09-10 13:45:23 +10:00
parent ea47640344
commit cc3fe23ae4
3 changed files with 20 additions and 11 deletions

View File

@ -78,6 +78,8 @@
+* this .
ha ~(. +> bowl)
def ~(. (default-agent this %|) bowl)
io ~(. agentio bowl)
pass pass:io
::
++ on-init
=. current-timebox now.bowl
@ -90,12 +92,13 @@
!<(versioned-state old-vase)
=| cards=(list card)
|^ ^- (quip card _this)
?+ -.old !!
%8
?: ?=(%8 -.old)
=. -.state old
=. +.state inflate
:_(this (flop cards))
==
::
:_ this
(poke-our:pass %hark-graph-hook hark-graph-migrate+old-vase)^~
++ index-timebox
|= [time=(unit @da) =timebox:store out=_by-place]
^+ by-place
@ -312,7 +315,7 @@
::
++ unread-each
|= [=place:store =path]
=. poke-core (seen-index place)
=. poke-core (seen-index place ~)
=. poke-core (give %unread-each place path)
%+ jub-place place
|=(=stats:store stats(each (~(put in each.stats) path)))
@ -358,8 +361,7 @@
|= [=place:store inc=? count=@ud]
=. poke-core
(give %unread-count place inc count)
=. poke-core
(seen-index place)
=. poke-core (seen-index place ~)
=/ f
?: inc (cury add count)
(curr sub count)
@ -383,10 +385,10 @@
$(poke-core core, bins t.bins)
::
++ seen-index
|= =place:store
=. poke-core (give %seen-index place)
|= [=place:store time=(unit time)]
=. poke-core (give %seen-index place time)
%+ jub-place place
|=(=stats:store stats(last now.bowl))
|=(=stats:store stats(last (fall time now.bowl)))
::
++ seen
=. poke-core

View File

@ -20,13 +20,20 @@
%read-count (place +.upd)
%unread-each (read-each +.upd)
%unread-count (unread-count +.upd)
%seen-index (place +.upd)
%seen-index (seen-index +.upd)
%all-stats (all-stats +.upd)
::%read-note (index +.upd)
::%note-read (note-read +.upd)
%archive (archive +.upd)
==
::
++ seen-index
|= [p=^place t=(unit ^time)]
%- pairs
:~ place+(place p)
time+?~(t ~ (time u.t))
==
::
++ archive
|= [t=(unit @da) b=^bin]
%- pairs

View File

@ -97,7 +97,7 @@
:: %unread-each: Add .path to list of unreads for .place
[%unread-each =place =path]
:: %seen-index: Update last-updated for .place to now.bowl
[%seen-index =place]
[%seen-index =place time=(unit time)]
:: store actions
::
:: %archive: archive single notification