gitoria
All repositories: gitoria
6.0 KB
// components/repo.hl — THE REPO LAYOUT LEVEL (gitoria#22, D-CHAIN): the one level every repo page stands in:// shell (main.hl) → repo (this) → page (readme via index.hl, code, branch, commit, pulls, releases, tickets, settings).// It holds the repo head (name, description, "All repositories") and the tab nav (Readme · Code · Pull requests · Releases ·// Tickets · Settings) with aria-current = 'page' on the active tab, and the `slot` the page renders into. hl:web keeps a// standing level's DOM nodes when you navigate between pages of the SAME chain, so a tab click replaces only the slot —// not the head, not the nav. EVERY repo page declares `parent './repo.hl'` (never main.hl): a page under another chain// would be a full reload.// The repo comes from the request's host (`host = null`, hybriel#74). A MISSING repo: only "No such repository" + its link// (the page is still constructed, but every page renders nothing without a repo; a missing repo with NO slot made the browser's boot hang now and then, see reports/G2-hydrate.md). The main address (no slug): no head at all, just the slot (the repo list).// THE ACTIVE TAB comes from the route (`route = null`: the standing level is given the new route on every navigation):// '/' readme · /code* /branch* /commit* code · /pulls · /releases · /tickets · /settings.// The "Add code" help (gitoria#7, gitoria#20) is the page's own: components/addcode.hl, in code/branch/commit.parent './main.hl'import { publicUrl, slugOfHost, px, orgOrigin } from '../lib/util.hl'import { slugOfRequest, orepoOfPath, orgBySlug } from '../lib/orgs.hl'import { orgFor } from '../lib/repos.hl'import { userIdOfSession } from '../lib/users.hl'import { forwardOf } from '../lib/forwards.hl'import { repoAt } from '../lib/repos.hl'import { tabOfPath } from '../lib/repos-helpers.hl'host = nullsession = nullroute = nullslot = null// inside an organization (<org>.<host>/<repo>/…) the repo is the path's first segment; the organization's own root has no repo headorepo = route != null ? orepoOfPath(host, route.path) : ''onOrgRoot = slugOfHost(host) != '' && orepo == '' && orgFor(slugOfHost(host), userIdOfSession(session)) != nullslug = onOrgRoot ? '' : slugOfRequest(host, orepo)pre = px(slug)homeHref = pre == '' ? '/' : precodeHref = pre + '/code'pullsHref = pre + '/pulls'releasesHref = pre + '/releases'ticketsHref = pre + '/tickets'settingsHref = pre + '/settings'inOrg = orepo != ''orgHref = inOrg ? orgOrigin(slugOfHost(host)) + '/' : ''orgName = slugOfHost(host)repo = repoAt(slug, session)onMain = slug == ''showHead = slug != ''hasRepo = repo != nullwasMoved = slug != '' && repoAt(slug, session) == null && forwardOf(slug) != nullnotMoved = !wasMovedisMissing = slug != '' && repo == nulltab = route != null ? tabOfPath(orepo == '' ? route.path : route.path.slice(orepo.length + 1)) : ''// the active tab's aria-current: 'page', else null — NOTE Hybriel renders null as aria-current="" (empty = false for ARIA),// repro .scratch/repro-null-attr; styles.hl matches [aria-current=page]curReadme = tab == 'readme' ? 'page' : nullcurCode = tab == 'code' ? 'page' : nullcurPulls = tab == 'pulls' ? 'page' : nullcurReleases = tab == 'releases' ? 'page' : nullcurTickets = tab == 'tickets' ? 'page' : nullcurSettings = tab == 'settings' ? 'page' : nullmainHref = publicUrl + '/'View {repoPage {if (showHead) {repoHead {if (hasRepo) {h1 { id = "reponame" repo.slug }if (repo.isPrivate) { span { id = "repoprivate" class = "muted" "Private" } }if (repo.described) { p { id = "repodescription" repo.description } }if (inOrg) { p { class = "muted" "Organization: " a { id = "toorg" href = orgHref orgName } } }p { class = "muted" "All repositories: " a { id = "toall" href = mainHref "gitoria" } }repoNav { id = "reponav"a { id = "navhome" href = homeHref "aria-current" = curReadme "Readme" }a { id = "navcode" href = codeHref "aria-current" = curCode "Code" }a { id = "navpulls" href = pullsHref "aria-current" = curPulls "Pull requests" }a { id = "navreleases" href = releasesHref "aria-current" = curReleases "Releases" }a { id = "navtickets" href = ticketsHref "aria-current" = curTickets "Tickets" }a { id = "navsettings" href = settingsHref "aria-current" = curSettings "Settings" }}}if (isMissing) {if (wasMoved) { h1 { id = "missing" "Moved" } }if (notMoved) { h1 { id = "missing" "No such repository" } }p { class = "muted" "Nobody has created this address yet. " a { id = "toall" href = mainHref "All repositories" } }}}}slot}}Style {repoPage {display = 'grid'gap = '1rem'minWidth = '0'// Direct-child universal selectors have no bare language form.'> *' {margin = '0'}}repoHead {display = 'grid'gap = '.75rem'minWidth = '0'// Direct-child universal selectors have no bare language form.'> *' {margin = '0'}h1 {fontSize = '1.4rem'}}repoNav {display = 'grid'gridTemplateColumns = 'repeat(3, minmax(0, 1fr))'gap = '.15rem'minWidth = '0'a {display = 'inline-flex'alignItems = 'center'justifyContent = 'center'minWidth = '2.75rem'minHeight = '2.75rem'padding = '0 .25rem'textAlign = 'center'fontWeight = '600'color = 'var(--color-text)'borderRadius = 'var(--radius-small)'boxSizing = 'border-box'borderBottom = '2px solid transparent' // functional: reserve the active tab underline space.hover {textDecoration = 'none'color = 'var(--color-text-strong)'background = 'var(--color-surface)'}}// Attribute-value conditions have no bare language form.'a[aria-current=page]' {fontWeight = '700'color = 'var(--color-text-strong)'background = 'var(--color-surface)'borderBottomColor = 'var(--color-accent)' // functional: identify the active tab.}@media {minWidth = '60rem'display = 'flex'flexWrap = 'wrap'gap = '.15rem .25rem'marginInline = '-.75rem'a {padding = '0 .75rem'}}}}
Branches
- f1-broken-json
- f2-api-bugs
- gp-gate-ports
- heap-revert
- hl25-records
- ident-chooser-selector
- mainmain branch
- p51-public-pr-reads
- records-1112
- s25-no-session-on-login-error
- v59
- w52-person-approval
- w52b-approval-followup
- w52c-header-phone
- w53-pulls-speed-pr
- w54-repo-rename-pr
- w55-rename-org
- w56-owner-members
- w62-pr-close
- w63-force-push
- w64-org-slash
Latest commits
- cb634512log: 2026-11-08 keyed lists livemre
- 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
- 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
- b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
- 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre
- f5f0fb7blog: 2026-11-08 day50/#29 live, H25 correction, V52 startedmre
- dc77fb95main: offline note from __hlOnline, tick removed (#29)mre
- 37a86d93tests/reviews: seeded fake hook's DNS failures are not server errors (flaky gate)mre
- 07ab845bvendor: Hybriel set-day50 (run() leak fix #335)mre
- 71b2fa4blog: hybriel#335mre
- bd94cc7elog: #25 cause found (run() leak)mre
- 565cb508log: H25 round 1mre
- 90a0af84log: H25 startedmre
- 87bd53b8mission H25mre
- 71a746cflog: day48 livemre
- bf568e14log: V48 mergedmre
- 09955dedMerge v48: Hybriel set-day48, theme layouts ce4a0bamre
- f2a2b0cevendor: Hybriel set-day48, theme layouts ce4a0bamre
- 5d0834e7log: Apollo model rulemre
- fe8e5bd5log: #25 sample, V48 missionmre