tickets
All repositories: gitoria
3.0 KB
// components/inbox.hl — `/inbox` (ticket #20): the tickets ASSIGNED TO YOU, in two lists: pending and// review, across all projects. Personal: needs a login. Live: a ticket assigned to you, or moving into// or out of those states, appears / disappears without a reload.parent './main.hl'import { inboxRows } from '../lib/tickets.hl'import { siteName } from '../project.hl'import { userOfSession } from '../lib/users.hl'session = nullmyId = userOfSession(session) != null ? userOfSession(session).id : ''loggedIn = myId != ''loggedOut = myId == ''box = inboxRows(userOfSession(session))pending = box.pendingreview = box.reviewnoPending = pending.length == 0noReview = review.length == 0__title = siteName + ' | inbox'View {ticketBoard {h1 { id = "heading" "Inbox" }if (loggedOut) { p { id = "loginhint" class = "hint" "Log in with ident (top right) to see the tickets assigned to you." } }if (loggedIn) {section { id = "reviewbox"h2 { "Review" }if (noReview) { p { id = "reviewempty" class = "empty" "Nothing is waiting for your review." } }ol { id = "review" class = "tickets"for (row of review) {li {ticketState { class = row.stateSlug row.state }a { class = "subject" href = row.href ticketRef { row.ref } row.subject }ticketMeta {a { href = row.projectHref row.projectTitle }time { row.updated }}}}}}section { id = "pendingbox"h2 { "Pending" }if (noPending) { p { id = "pendingempty" class = "empty" "Nothing is pending for you." } }ol { id = "pending" class = "tickets"for (row of pending) {li {ticketState { class = row.stateSlug row.state }a { class = "subject" href = row.href ticketRef { row.ref } row.subject }ticketMeta {a { href = row.projectHref row.projectTitle }time { row.updated }}}}}}}}}// a row goes to the top of its list if it is assigned to me and in that state, and out of both otherwiseplace = (row) => {p = []r = []if (row.assigneeId == myId && row.state == 'pending') { p.push(row) }if (row.assigneeId == myId && row.state == 'review') { r.push(row) }for (x of pending) { if (x.id != row.id) { p.push(x) } }for (x of review) { if (x.id != row.id) { r.push(x) } }pending = preview = rnoPending = p.length == 0noReview = r.length == 0}on client ticketCreated(row) { place(row) }on client ticketEvent(ticketId, ev, row) { place(row) }on client signedIn(tag, info) {b = emit server myInbox()if (b != null && b.pending != null) {pending = b.pendingreview = b.reviewnoPending = b.pending.length == 0noReview = b.review.length == 0myId = b.meloggedIn = trueloggedOut = false}}on client signedOut(tag) {myId = ''loggedIn = falseloggedOut = true}on server myInbox(session) {u = userOfSession(session)if (u == null) { return { error = 'log in first' } }b = inboxRows(u)return { pending = b.pending review = b.review me = u.id }}
Branches
Latest commits
- b6277497report MT-mobile, LOGmre
- 6709398blist paging: the newest rows come first (the sorted array was not used); filter rows hide their scrollbar; gate checks the ordermre
- 31736a80gate: member-name check fails on the old row layout toomre
- e03ae537gate: the phone checks run on without the Show more button (so old code reports every failed check)mre
- adf7f132gate: 390 px checks for the mobile audit fixes (row number, filters, field widths, Edit, member names, relation taps, paging)mre
- 28e9c938ticket list: draw the newest 50 rows and a Show more button (500 rows were a 2-4 s first paint, 740 KB, a 90 000 px phone page)mre
- ccebb0c7mobile: ticket number stays on one line, filter chips one scrolling row, fields full width under their caption, Edit/action buttons, member names whole, 44 px relation linksmre
- f2dc7741gate: the phone toolbar is two even rows (E2)mre
- 20f7c33async components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
- d74a5482sync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre
- 9d02c540sync components.hybriel 6b0936a: the 'edited' foldable drops the theme's border and marginmre
- 22751914sync components.hybriel 8d79ff7: bubble hugs its content, quiet 'edited' label; gate checksmre
- c8452453sync components 9a: shared Icon (icons/icons.hl), md-editor toolbar icons + single focus ring (components f4-icons ba96735)mre
- 52ba11e8sync-components: copy icons/icons.hl + README (F4); testsmre
- 138d198dmd-editor.hl: verbatim copy of components f3-mdvalue (an older text handed back is kept)mre
- 18d2df60md-editor.hl: verbatim copy of components f3-mdvalue (an outside value change is shown by the editor)mre
- f6764bedreports/H1-hydrate.mdmre
- 1bbbf0edtests/browser.mjs: wait for hydration before clicking the login button on / (device B)mre
- 6f503cfctests/cdp.mjs: HL_CPU_THROTTLE=<rate> optional CPU throttling for gate runsmre
- e17e2855re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre