gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchday39cfe95440|||PR day39 re-vendor: Hybriel 51e921d7 (bin 6b481aa7), ids kebab-case since hybriel#256: quoted state rule and tests use jb-shuffle / jb-repeatmreday39/components/artists.hl

1.5 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 countText = thousands(artistTotal) + ' artists'
  16. on artistsLoad(first, wanted) {
  17. let start = first - 20
  18. if (start < 0) { start = 0 }
  19. r = emit server jbRows({ kind = 'artists' }, start, 100)
  20. chunk = r.rows
  21. chunkFrom = r.offset
  22. return null
  23. }
  24. on server artistsRememberScroll(top) {
  25. return rememberScroll('artists', top)
  26. }
  27. on artistsScrolled(top) {
  28. emit server artistsRememberScroll(top)
  29. return null
  30. }
  31. rememberTop = (top) => { emit artistsScrolled(top) }
  32. loadRange = (first, wanted) => { emit artistsLoad(first, wanted) }
  33. picked = (id, index) => { navigate('/artists/' + id) }
  34. View {
  35. jbScreen {
  36. jbCount { output { id = "count" countText } }
  37. VirtualList { itemCount = artistTotal rowHeight = 56 loaded = chunk loadedFrom = chunkFrom onRange = loadRange onPick = picked scrollTop = savedTop onScroll = rememberTop listLabel = "Artists" }
  38. }
  39. }

Branches

Latest commits

  • 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
  • a01f3aa8ui gate: back to the top before the sort checks (the screen reopens where it was left)mre
  • f7936c20Lists keep their scroll position across a reload (jukebox#20): per-list offsets in storage/ui.json, gate jb20mre
  • d67906devirtual-list and icons from components.hybriel e5b98ec (centerId, scrollTop, onScroll)mre
  • df7920ceRecords: R3 startedmre
  • 0549f038Mission 010: jb20 livemre
  • 273494e2STATUS rewrittenmre