tylerbwong / stack

An Android app for browsing Stack Overflow and other Stack Exchange sites.
https://stack.tylerbwong.me
GNU General Public License v3.0
522 stars 36 forks source link

Inbox access (not notifications) #137

Open Vampire opened 1 year ago

Vampire commented 1 year ago

I'm aware of #120. This issue is about actively looking into the inbox. When authenticating, I have the app permission to access the inbox, but I don't see any way to access the inbox.

It would be nice if there were a way to display the inbox actively.

tylerbwong commented 1 year ago

Luckily for you, it's already been added in da1b10f71237847f8bf0d17a7db4dda6d9e2f88a! Just figuring out some last minute things with not being able to mark read/unread from the API.

tylerbwong commented 1 year ago

This actually brings up a good question that I would like anyone who has feedback to chime in about! I'll pin this issue and we can talk about surfacing the inbox more in-depth here.

As I said in the above message, the Stack Exchange API does not provide a way for client apps to mark an item as read/unread. It does however send state down with each inbox item in an isUnread boolean. That being said, how would folks like the app to handle read/unread state. Off the top of my head there are a few options:

  1. Render inbox items as read/unread as well as have an unread indicator in the bottom bar icon, but do nothing else.
  2. Handle marking items as read/unread locally on the app. This means that the read/unread state will go out of sync with the website and it will be reset on logout, or clearing app data.
  3. Completely ignore read/unread state for inbox items and do not render them any differently as well as do not show any unread indicator.

Would love to hear people's thoughts!

Vampire commented 1 year ago

Three more options:

Make them add an API to handle it properly and use it. That's my favorite of course. :-D I wonder that there is no API, the official apps had that functionality, didn't they?

Use whatever api call the official web page also uses it possible.

Have the unread state not as boolean, but tri-state:

tylerbwong commented 1 year ago

Make them add an API to handle it properly and use it. That's my favorite of course. :-D I wonder that there is no API, the official apps had that functionality, didn't they?

Yea the official apps actually had a set of mobile exclusive APIs under mobile.stackexchange.com that were eventually sunsetted and do not work anymore. Was pretty bummed when I found out they weren't available.

Use whatever api call the official web page also uses it possible.

I actually dug into this a little bit and found that the site hits https://stackoverflow.com/topbar/mark-inbox-as-unread with the payload:

inboxId: ...
relatedPostId: ...
fkey: ...

but I was not able to get it working as I'm sure there are other parameters/headers I'm missing in the request.

The last option is interesting! It does make things a little more complicated and I'm sure people will wonder why it has to be that way though...but that is unavoidable and we'll get that with a lot of the options I mentioned as well.