jukebox
All repositories: gitoria
1.5 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 countText = thousands(artistTotal) + ' artists'on artistsLoad(first, wanted) {let start = first - 20if (start < 0) { start = 0 }r = emit server jbRows({ 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 listLabel = "Artists" }}}
Branches
Latest commits
- 8ed6da45|||PR README: media-player pin df9e7dfmre
- d5d45fc3|||PR media-player df9e7df (repeat-one fix), sync pin and SOURCEmre
- 89cdabb1Vendor Hybriel day41 (57054d9e): plugin dirs, set .somre
- 1fecd6a7Merge branch 'records-day39' into mainJukebox
- d6b3e068|||PR Records: day39 live (PR #2), mission 011 PR step, statusmre
- 5fa19e89Merge branch 'day39' into mainJukebox
- cfe95440|||PR day39 re-vendor: Hybriel 51e921d7 (bin 6b481aa7), ids kebab-case since hybriel#256: quoted state rule and tests use jb-shuffle / jb-repeatmre
- f3614c9bRe-vendor to Hybriel day39 (51e921d7, bin 6b481aa7)mre
- 9f5c6532Merge branch 'status-22-pr' into mainJukebox
- 5838d6c7|||PR STATUS: #22 pending decision, PR-only rulemre
- 29d2029cRecords: PR-only rule (Kunibert)mre
- adacb0abRecords: neutral ticket rule, #22 decision recordedmre
- b2d6f121Records: #308 hold liftedmre
- 7ab67533Records: day39 on hold (hybriel#308)mre
- 22f21739Records: note rebase before mergemre
- f7368ea3Records: mission 011 day39, waits for lisbethmre
- 9515d2cdRecords: jb20 livemre
- 019f6601ui gate: comment names the open bug components#27 (workaround, not fixed)mre
- 277a2722README: provenance linemre
- 4169ca6aREADME: sync pinmre