gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchrecords-1124d78f0cc86|||PR records 2026-11-24: inbox-thread rule, "Not playing" confirmed and closedmrerecords-1124d/components/artists.hl

1.7 KB

  1. // components/artists.hl — `/artists`: every artist, by name, with the cover of one of their albums; a tap opens the artist.
  2. parent './main.hl'
  3. import { navigate } from 'hl:web'
  4. import VirtualList from './virtual-list/virtual-list.hl'
  5. import { rowsFor, thousands } from '../lib/rows.hl'
  6. import { lastScroll, rememberScroll, startRowFor } from '../lib/remember.hl'
  7. __title = 'Artists · Jukebox'
  8. // where the list was left (lib/remember.hl); the first rows are the ones around that place
  9. Number savedTop = lastScroll('artists')
  10. Number firstRow = startRowFor(savedTop)
  11. Hybrid firstRows = rowsFor({ kind = 'artists' }, firstRow, 100)
  12. Number artistTotal = firstRows.total
  13. Hybrid chunk = firstRows.rows
  14. Number chunkFrom = firstRows.offset
  15. String listResetKey = 'artists'
  16. String countText = thousands(artistTotal) + ' artists'
  17. on artistsLoad(first, wanted) {
  18. let start = first - 20
  19. if (start < 0) { start = 0 }
  20. r = emit server artistsRows({ kind = 'artists' }, start, 100)
  21. chunk = r.rows
  22. chunkFrom = r.offset
  23. return null
  24. }
  25. on server artistsRememberScroll(top) {
  26. return rememberScroll('artists', top)
  27. }
  28. on artistsScrolled(top) {
  29. emit server artistsRememberScroll(top)
  30. return null
  31. }
  32. rememberTop = (top) => { emit artistsScrolled(top) }
  33. loadRange = (first, wanted) => { emit artistsLoad(first, wanted) }
  34. picked = (id, index) => { navigate('/artists/' + id) }
  35. View {
  36. jbScreen {
  37. jbCount { output { id = "count" countText } }
  38. VirtualList { itemCount = artistTotal rowHeight = 56 loaded = chunk loadedFrom = chunkFrom onRange = loadRange onPick = picked scrollTop = savedTop onScroll = rememberTop resetKey = listResetKey listLabel = "Artists" }
  39. }
  40. }
  41. // This screen owns its row request across the server boundary.
  42. on server artistsRows(Hybrid ctx, Number offset, Number limit) {
  43. return rowsFor(ctx, offset, limit)
  44. }

Branches

Latest commits

  • 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
  • 10f8a8c8Merge branch 'code-order' into mainJukebox