Subscribe to hashtags, and Public pill for hashtags

Tasks

  • ssb-threads: hashtagCount(hashtag, cb)
    • new async muxrpc which delivers a number. Internally this can do a db query very similar to hashtagSummary, but using count() instead of batch()
  • ssb-threads: hashtagSummary to accept an array of hashtags
    • There's opts.hashtag: string, maybe we could add opts.hashtags: Array<string>
    • hashtags.ts file has an operator() method. This should now receive either string or Array<string>
    • getMessagesByHashtag receivers either string of Array<string>. In the case of array, it should stream over the whole level, using gte: null, lte: undefined and using pull.filter() to match our array of hashtags
  • frontend: Search screen header details for a hashtag
    • when a hashtag #example is set on the Search, we should show a "Header" where there is left-aligned a text element "N posts" and a right-aligned "Subscribe" button (similar to "Follow" button, it gets toggled as "Unsubscribe"). Calls ssb.threads.hashtagCount to display the number
  • backend: dbUtils hashtagsSubscribed
    • new method which accumulates a Set (or array) of hashtags subscribed to. Internally this is similar to preferredReactions
    • "subscribe" messages add to this Set
    • "unsubscribe" messages remove from this Set
  • frontend: new "Hashtags" pill on the Public tab that will call ssb.threads.hashtagSummary() with an array of subscribed hashtags
  • frontend: empty state when you select Hashtags pill but don't subscribe to any yet
  • ssb-threads: hashtagUpdates
  • frontend: flip ToggleButton visuals
  • Test on Desktop
  • Test on Android
  • Test on iOS

Notes:

  • "Subscribe" is an SSB message where msg.value.content is
    • {type:'channel', channel: hashtag, subscribed: true}
    • where hashtag should NOT have #
  • "Unsubscribe" is an SSB message where msg.value.content is
    • {type:'channel', channel: hashtag, subscribed: false}
    • where hashtag shoudl NOT have #
  • Manyverse terminology for this concept is "Hashtag", not "Channel". Let's not use the word channel anywhere user-facing

Future tasks

  • Unsubscribe/manage from many hashtags. Assume the user has 100+ hashtags subscribed to
  • Explore new/trending hashtags
Edited by staltz