jukebox
All repositories: gitoria
1.7 KB
// components/albums.hl — `/albums`: every album, by name, with its cover; a tap opens the album.parent './main.hl'import { navigate } from 'hl:web'import VirtualList from './virtual-list/virtual-list.hl'import { rowsFor, thousands } from '../lib/rows.hl'import { lastScroll, rememberScroll, startRowFor } from '../lib/remember.hl'__title = 'Albums · Jukebox'// where the list was left (lib/remember.hl); the first rows are the ones around that placeNumber savedTop = lastScroll('albums')Number firstRow = startRowFor(savedTop)Hybrid firstRows = rowsFor({ kind = 'albums' }, firstRow, 100)Number albumTotal = firstRows.totalHybrid chunk = firstRows.rowsNumber chunkFrom = firstRows.offsetString listResetKey = 'albums'String countText = thousands(albumTotal) + ' albums'on albumsLoad(first, wanted) {let start = first - 20if (start < 0) { start = 0 }r = emit server albumsRows({ kind = 'albums' }, start, 100)chunk = r.rowschunkFrom = r.offsetreturn null}on server albumsRememberScroll(top) {return rememberScroll('albums', top)}on albumsScrolled(top) {emit server albumsRememberScroll(top)return null}rememberTop = (top) => { emit albumsScrolled(top) }loadRange = (first, wanted) => { emit albumsLoad(first, wanted) }picked = (id, index) => { navigate('/albums/' + id) }View {jbScreen {jbCount { output { id = "count" countText } }VirtualList { itemCount = albumTotal rowHeight = 56 loaded = chunk loadedFrom = chunkFrom onRange = loadRange onPick = picked scrollTop = savedTop onScroll = rememberTop resetKey = listResetKey listLabel = "Albums" }}}// This screen owns its row request across the server boundary.on server albumsRows(Hybrid ctx, Number offset, Number limit) {return rowsFor(ctx, offset, limit)}
Branches
Latest commits
- 0923398bMerge branch 'records-1124d' into mainJukebox
- 78f0cc86|||PR records 2026-11-24: inbox-thread rule, "Not playing" confirmed and closedmre
- c1b153c4Merge branch 'records-1124c' into mainJukebox
- d7b5e780|||PR Records 2026-11-24 (2): live day72, PR #19 merge, #10 newsmre
- 43b564dbMerge branch 'records-1124b' into mainJukebox
- fa86b08c|||PR Records 2026-11-24: LOG, STATUS, missions 020-023mre
- 0a2ae3daMerge remote-tracking branch 'origin/records-1123' into records-1124mre
- 9a48cfcaMerge branch 'vendor-theme' into mainJukebox
- 170d3735Merge branch 'code-order-2' into mainJukebox
- 3f1918a7|||PR Re-sync layouts theme 4099e64 with Segoe UI firstmre
- 2e7f6a43Vendor virtual-list 489afcf from components.hybrielmre
- 0ba85799Merge branch 'reset-classes' into mainJukebox
- 502eeed5jukebox#20: vendor virtual-list initial resetKey baseline fixmre
- 6d5ce287|||PR jukebox#9 Centralize songs table reads and writes in db.hlmre
- dcca21abjukebox#8 Move copies and queue logic into their topicsmre
- 3b76651cjukebox#20: update virtual-list README pin and resetKey optionsmre
- bc09e1e8|||PR jukebox#20: reset virtual lists through resetKey (partial validation)mre
- a3796dc5Records: live step waits for idlemre
- 3b158e16Records: merges of #9 and #11mre
- 27204167Merge main into records-1123mre