{"action":"closed","issue":{"url":"https://api.github.com/repos/ParabolInc/action/issues/306","repository_url":"https://api.github.com/repos/ParabolInc/action","labels_url":"https://api.github.com/repos/ParabolInc/action/issues/306/labels{/name}","comments_url":"https://api.github.com/repos/ParabolInc/action/issues/306/comments","events_url":"https://api.github.com/repos/ParabolInc/action/issues/306/events","html_url":"https://github.com/ParabolInc/action/issues/306","id":179852482,"number":306,"title":"Empty state vs. loading state","user":{"login":"mattkrick","id":5514175,"avatar_url":"https://avatars0.githubusercontent.com/u/5514175?v=4","gravatar_id":"","url":"https://api.github.com/users/mattkrick","html_url":"https://github.com/mattkrick","followers_url":"https://api.github.com/users/mattkrick/followers","following_url":"https://api.github.com/users/mattkrick/following{/other_user}","gists_url":"https://api.github.com/users/mattkrick/gists{/gist_id}","starred_url":"https://api.github.com/users/mattkrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattkrick/subscriptions","organizations_url":"https://api.github.com/users/mattkrick/orgs","repos_url":"https://api.github.com/users/mattkrick/repos","events_url":"https://api.github.com/users/mattkrick/events{/privacy}","received_events_url":"https://api.github.com/users/mattkrick/received_events","type":"User","site_admin":false},"labels":[{"id":302340937,"url":"https://api.github.com/repos/ParabolInc/action/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/ParabolInc/action/milestones/3","html_url":"https://github.com/ParabolInc/action/milestone/3","labels_url":"https://api.github.com/repos/ParabolInc/action/milestones/3/labels","id":1968096,"number":3,"title":"Snoozed","description":"Items not yet prioritized","creator":{"login":"jordanh","id":103000,"avatar_url":"https://avatars2.githubusercontent.com/u/103000?v=4","gravatar_id":"","url":"https://api.github.com/users/jordanh","html_url":"https://github.com/jordanh","followers_url":"https://api.github.com/users/jordanh/followers","following_url":"https://api.github.com/users/jordanh/following{/other_user}","gists_url":"https://api.github.com/users/jordanh/gists{/gist_id}","starred_url":"https://api.github.com/users/jordanh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jordanh/subscriptions","organizations_url":"https://api.github.com/users/jordanh/orgs","repos_url":"https://api.github.com/users/jordanh/repos","events_url":"https://api.github.com/users/jordanh/events{/privacy}","received_events_url":"https://api.github.com/users/jordanh/received_events","type":"User","site_admin":false},"open_issues":210,"closed_issues":68,"state":"open","created_at":"2016-08-28T14:32:59Z","updated_at":"2017-12-20T16:14:35Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-09-28T18:34:58Z","updated_at":"2017-12-20T16:14:35Z","closed_at":"2017-12-20T16:14:35Z","author_association":"OWNER","body":"Open discussion on how to handle the empty state before the subs load:\nLet's use the Action List as an example:\n\nWhen `actions.length === 0` We show a single item saying you don't have any items.\nThere are 2 scenarios where this happens:\n- The user doesn't have any actions\n- The user's actions haven't loaded yet\n\nThe latter is ugly, because that means it flashes the empty state & then begins loading the actions once they start coming in.\n\nThere are a few things we could do:\n- Show loading state (nothing?) until a query returns stating how many actions there are. if actions.length === 0, then show empty state. This is a little expensive since it's another hit to the DB & another round trip\n- Same as above, but have the subscription return the length from the server. This reduces the extra upstream message & extra query, but still hits the DB. This gets tricky because we tell GraphQL that the `actions` subscription will return a list of actions, so instead we'd send it through the pubsub using our custom protocol. maybe `add, remove, update, READY`. Then our subscriber listens for `payload.ready`.\n- wait for the socket to subscribe to the channel. This is cheap, but this will return before a doc does, so it essentially just shortens the duration of the flash.\n- do nothing\n- if actions.length === 0, show loading state for 2-3 seconds. not very robust, but very simple.\n- ???\n\n@jordanh @ackernaut thoughts? \n"}}
{"actor":{"display_login":"dan-f"}}