Skip to content

Instantly share code, notes, and snippets.

@belisarius222
Last active August 24, 2020 16:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save belisarius222/7c36c61ed7455c5056ef114daa062d1f to your computer and use it in GitHub Desktop.
Save belisarius222/7c36c61ed7455c5056ef114daa062d1f to your computer and use it in GitHub Desktop.
hark: notification types
|%
:: $hark: general-purpose notification
::
:: Arguably .link should be a $beam, not a path, but $path is a bit
:: more general and can easily encode a beam. The idea is that each
:: notification should be able to point to the part of the system
:: that generated it, so that if the user clicks the link, they will
:: be taken to the relevant part of an application.
::
:: The link could refer to just the application that generated the
:: notification, a Clay file that this notification is intended to
:: highlight (e.g. recently added), or a particular screen or
:: datastream within an application (e.g. a chat channel).
::
+$ hark
$: title=@t
body=@t
link=path
==
:: $notifications: ordered-map of $hark's
::
+$ notifications (mop @da hark)
--
@tacryt-socryp
Copy link

I agree with Liam, but prefer the even more specific [app=term rid=resource pax=path]

@liam-fitzgerald
Copy link

I agree with Liam, but prefer the even more specific [app=term rid=resource pax=path]

I prefer [app=term =path] because it doesn't make assumptions about the structure of an apps state. Additionally, it allows us to scry for these resources without doing path mangling on the frontend.

@matildepark
Copy link

Is there any way to mark these as read?

@belisarius222
Copy link
Author

belisarius222 commented Aug 24, 2020 via email

@tacryt-socryp
Copy link

The view app does not store any state in graph-store. I think we should mirror the archiving pattern in graph-store and move them out of the unread list upon having been viewed. This way the “unread number” is always calculated based on the length of the unread message list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment