samuelclay / NewsBlur

NewsBlur is a personal news reader that brings people together to talk about the world. A new sound of an old instrument.
http://www.newsblur.com
MIT License
6.91k stars 1k forks source link

Mac/iPad: dashboard #1899

Open Dejal opened 1 month ago

Dejal commented 1 month ago

@samuelclay wrote in a comment in #1247:

I've been using the macOS app a ton and it's been a great experience. One change I'd like to see is to match the up-to-date experience from the web. We have a configurable dashboard on the web that has real-time updated "widgets". Could we make a new "Dashboard" top level folder, same as on the web, with the story titles in groups matching the web? I publish those lists on /reader/feeds/:

"dashboard_rivers": [
    {
        "river_id": "river:",
        "river_side": "left",
        "river_order": 0
    },
    {
        "river_id": "river:infrequent",
        "river_side": "left",
        "river_order": 1
    },
    {
        "river_id": "river:global",
        "river_side": "left",
        "river_order": 2
    }
],

They should show 5 stories in the standard story titles format, and they should reload every 5 minutes (add a random 1-5 minutes per request so they don't all refresh together at once, some people can have dozens of rivers). I'd like to see this on both iPad and macOS, so I can leave the screen open and watch the news come in.

Bonus points for left vs right lists. And extra bonus points for single column, double column, and two horizontal columns (left "column" on top row, right "column" on bottom row).

I like this idea. Just the three river feeds, or are the What's New and NewsBlur Stats etc panes available too, to fully replicate the experience? It'd be a nice feature either way.

samuelclay commented 1 month ago

We don't have APIs for what's new and statistics, so let's start with the rivers. Check dashboard_rivers_view.js for details on which feeds to pull and what to hide.

Dejal commented 1 month ago

When the macOS/iOS app calls /reader/feeds, there is no dashboard_rivers data, due to using the flat=true parameter. Changing that does include it, but breaks loading, so can you include it for when flat=true?

Also, it'd be nice to be able to customize the dashboard in the app; is there an API to change, add, or remove a feed in the dashboard? Being able to send back the JSON for the dashboard_rivers would be ideal, so I could implement moving feeds between sides, or reordering them.

By the way, I noticed some issues with the Dashboard on the web. Adding several feeds on the same row (in horizontal layout mode) can get unusably narrow; perhaps should limit that, though not unreasonable to let the user self-limit that. But changing the feed for a "widget" can result in the old feed appearing with the new title. I could add issues for those if they're not known issues.

samuelclay commented 3 weeks ago

Deployed dashboard_rivers on /reader/feeds?flat=true

samuelclay commented 3 weeks ago

To save dashboard rivers, POST to /reader/save_dashboard_river/ with the following form data:

You'll receive back a new dashboard_rivers that contains the entire set of rivers.

Note that river_id is slightly different for folders. Use river:<folder title> as the river_id for folders, otherwise it's feed:<feed_id>, and social/search/starred already have their prefix in their feed_id.

samuelclay commented 3 weeks ago

@sictiru You'll need these URLs and params, too. ☝️

Dejal commented 3 weeks ago

Thanks! I would have preferred a save endpoint that took the entire array of rivers, so I could implement moving feeds. With the single river save (and the web UI), you can only move a feed by changing an existing dashboard item's feed; if I had several feeds in the dashboard, and wanted to move one to the top, I'd have to do several changes. But a good start.

Dejal commented 3 weeks ago

Work on this is underway, but I'm out of time for this month, so I'll finish it next week. I've committed the current progress on the dejal-alpha branch, but don't bother playing with it yet; there isn't much to see currently.