gitoria
All repositories: gitoria
4.6 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}}
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
- a81abdc9gitoria#34: org page via function route, member-reachable orgs, selects, reportmre
- 17f031f0gitoria#34: private repos, organizations, members, move tool, gatemre
- 71b69343gitoria#23: the sidebar's Repositories link was a 404 after any in-page navigation (static menu re-evaluated publicUrl in the browser); the menu is an instance property now; gate taps it after a tab, folder, filemre
- 90b4f728gitoria#25: restore the homepage cache and the parsed-blocks cache (they store data under immutable keys, no HTML); the page key, the framework readme key and the textHash key stay removedmre
- a487248cgitoria#25: remove every cache that hid the page build (page key, Markdown render key, homepage cache, parsed-blocks cache) and the gate that only tested themmre
- 12f2f4fegitoria: re-vendor Hybriel set-day27b, a startup fault in on Error exits 1mre
- c21c084egitoria: write the standby service out in full so the boot gate can read the main servicemre
- e307d69agitoria: say what is per process during the hand-overmre
- f0cbe6a6gitoria: standby service on port 45014 and a deploy that hands over through it without a gapmre
- 727cd083gitoria#25: README: vendor notes for Hybriel c1b1010f and the page cachemre
- 61b72dedgitoria#25: re-vendor Hybriel master c1b1010f (W149 page cache), key the repo Readme page by slug and main commit, extend the readme-cache gatemre
- 5b0b4b9ereadme-cache gate: use the security gate's ports when no own ports are givenmre
- bc8f20d9gitoria#25: re-vendor Hybriel c09538bb with the W141 render cache, cache the homepage per commit, add the readme-cache gatemre
- 9feebbd3Re-vendor Hybriel to ded47c13 (W145: Firefox start script fix)mre
- 28ed41e5gitoria#24: one sign-in comes from hl:web batch 20, the /session/share workaround is gonemre
- 3b2669e4gs: drop the unbuildable legacy check, fix pwa fetchmre
- 2a2fdd77gs: C2 check before cookie experimentsmre
- 76e0587aWIP gs 2mre
- a80da7bdWIP gs: security gate for lazy sessions, g24 browser checksmre
- 23fb05d8re-vendor Hybriel aaa39e69 (hl:web batch 20: login emit and Sessions.mint, tab follows a login, signed-in session cookie wins among duplicates and is re-issued with the Domain, W85 faster render, lazy sessions)mre