jukebox
All repositories: gitoria
1.7 KB
// components/artists.hl — `/artists`: every artist, by name, with the cover of one of their albums; a tap opens the artist.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 = 'Artists · Jukebox'// where the list was left (lib/remember.hl); the first rows are the ones around that placeNumber savedTop = lastScroll('artists')Number firstRow = startRowFor(savedTop)Hybrid firstRows = rowsFor({ kind = 'artists' }, firstRow, 100)Number artistTotal = firstRows.totalHybrid chunk = firstRows.rowsNumber chunkFrom = firstRows.offsetString listResetKey = 'artists'String countText = thousands(artistTotal) + ' artists'on artistsLoad(first, wanted) {let start = first - 20if (start < 0) { start = 0 }r = emit server artistsRows({ kind = 'artists' }, start, 100)chunk = r.rowschunkFrom = r.offsetreturn null}on server artistsRememberScroll(top) {return rememberScroll('artists', top)}on artistsScrolled(top) {emit server artistsRememberScroll(top)return null}rememberTop = (top) => { emit artistsScrolled(top) }loadRange = (first, wanted) => { emit artistsLoad(first, wanted) }picked = (id, index) => { navigate('/artists/' + id) }View {jbScreen {jbCount { output { id = "count" countText } }VirtualList { itemCount = artistTotal rowHeight = 56 loaded = chunk loadedFrom = chunkFrom onRange = loadRange onPick = picked scrollTop = savedTop onScroll = rememberTop resetKey = listResetKey listLabel = "Artists" }}}// This screen owns its row request across the server boundary.on server artistsRows(Hybrid ctx, Number offset, Number limit) {return rowsFor(ctx, offset, limit)}
Branches
Latest commits
- 6f0f7862|||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
- 10f8a8c8Merge branch 'code-order' into mainJukebox
- 204fc828Merge branch 'day72' into mainJukebox
- 8e8d0e2b|||PR Records: PROCEDURES.md, missions 016-019, GO 2026-11-23mre
- 95f5faae|||PR jukebox#7 Drop needless let declarationsmre
- 33072bb5|||PR Record day72 gates and Chrome proofmre