Cobalt/examples/hn/README.md at main · BandarLabs/Cobalt · GitHub
//blob/show" data-turbo-transient="true" />
Skip to content
Type / to search
Sign in<br>Sign upAppearance settings
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading. Please reload this page.
BandarLabs
Cobalt
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star<br>45
FilesExpand file tree
main
/README.md
Copy path
Blame<br>More file actions
Blame<br>More file actions
Latest commit
History<br>History<br>History
60 lines (47 loc) · 2.45 KB
main
/README.md
Copy path
Top
File metadata and controls<br>Preview
Code
Blame
60 lines (47 loc) · 2.45 KB
Raw<br>Copy raw file<br>Download raw file
OutlineEdit and raw actions
Hacker News
Hacker News, on a panel with no scrollbar and no keyboard.
Four tabs along the bottom (Top, New, Ask, Show) and a comment thread behind<br>every story. Nothing animates, nothing scrolls, and nothing moves under a<br>finger that is already reaching for it.
The stories<br>A thread
Captured from a Kobo Clara BW over Wi-Fi with kobo shot --device.
Why Algolia rather than the official API
Hacker News' own Firebase API returns one item per request. A story with four<br>hundred replies is four hundred and one requests, which on a device whose radio<br>is the largest single draw on the battery would flatten a charge. Algolia's<br>items/:id returns the entire thread, nested, in<br>one. That single fact is the reason this application is possible at all.
What happens to a thread that does not fit
The transport carries half a megabyte and a busy thread is comfortably more. A<br>real one measured while writing this was 734 KB for 925 comments. Algolia<br>ignores Range, so the trick that lets Gutenbird read a novel in pieces does<br>not work here: asking for the second half returns the whole document again and<br>the ceiling rejects it.
So the request comes back TaskError::TooLarge. Rather than showing a dead<br>end, this asks a different question: search_by_date over that story's<br>comments, thirty at a time, which is bounded by construction. The nesting is<br>gone in that answer, so the screen says the nesting is gone.
Running it
# onto a reader over Wi-Fi">kobo run --sim --app hn # in the browser simulator<br>kobo deploy --device ip> # onto a reader over Wi-Fi
Built with the Cobalt SDK, which<br>installs on a Kobo with one<br>command over USB. The other apps:<br>Launcher ·<br>Audiobook Studio ·<br>Gutenbird ·<br>RSS Reader ·<br>Daily Brief ·<br>AI Chat ·<br>Coding Agents Sidekick ·<br>Terminal ·<br>UI Components Showcase ·<br>Settings ·<br>Todo ·<br>Tic-tac-toe ·<br>Magnet Sensor
You can’t perform that action at this time.