summaryrefslogtreecommitdiff
path: root/cgithub/views
AgeCommit message (Collapse)Author
2026-09-04Split the page shell out of the repository layoutJoe Mou
layout.eta was two things at once: the HTML shell every page needs and the repository chrome around it. owner.eta, being the one page that is not about a repository, could use neither and carried its own copy of the shell, which had drifted -- its footer named no build commit and did not link to the original page on GitHub. The shell moves to views/layouts/base.eta, taking its title and any deferred scripts as layout data, and the chrome to views/layouts/repo.eta, a layout over it that adds the clone commands, nav, search box, and the "/" shortcut that focuses it. Repository pages point at repo.eta and render as before; owner.eta uses base.eta directly and so gains the footer it was missing. Templates now live in more than one directory, so scripts/build.ts walks views/ recursively and keys each template by its path underneath it. Names crossing a directory are written from the views root ("/layouts/base.eta"), the one form both Eta's filesystem resolver and the precompiled resolver in worker.ts agree on; siblings stay relative. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ba5p88cWtCq42vf3uweweL
2026-09-03Clean up renderer, redirects, and build commitJoe Mou
2026-09-03Link blobs to their history and backJoe Mou
Nothing in a commits payload says whether the path it lists is a file or a directory: currentBlobPath, despite the name, is only the path filter, and is set for a directory just the same. GitHub's own UI cannot tell either, and points its browse button at /blob/<oid>/<path> so that the redirect resolves a file to its blob. We do the same, and the blob route already turns that redirect into one of our own tree URLs. Breadcrumbs now stay in the view they were clicked from, so walking up from a history lands in the history of each parent directory rather than in its listing. The last crumb remains the page you are already on. A path with no commits now says so rather than rendering an empty page. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7pRKdmTvNDgT4ZXrwkbH8
2026-09-03Anchor blob lines so #L fragments workJoe Mou
Wrap each rendered line in a <span id="Ln">, for both syntax-highlighted and plain-text blobs, and shade the line a fragment targets.
2026-09-03Render repository wikisJoe Mou
Wikis are one of the last parts of GitHub still served as plain Rails HTML, with no embedded JSON to read, so this scrapes the markup: a page and any older revision of it, the _Sidebar and _Footer a wiki can define, and the page index. Every page is already in the sidebar of every page, since the "Show N more pages" button only unhides the rest, so linking the whole wiki costs no second request. Routes mirror GitHub's and resolve in its order, so an underscore name reserved for its own actions (_pages, _history, _new, _edit) can never be mistaken for a page; the ones we don't serve fall through to the usual redirect. A slug reaches us decoded and has to be encoded again rather than interpolated the way a ref is, or a page named C# would truncate at the fragment. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013rQG1io1i4GJQW5RFcXNGd
2026-08-27Display PDF blobsJoe Mou
GitHub renders a PDF with a viewer of its own and so ships no content for one, leaving the blob view with nothing to show. Its raw bytes come as application/octet-stream, which browsers download rather than display, so serve them from a new embed route that retypes them and point an <object> at that. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BErPR92xppzGFXkPqXPYj2
2026-08-13Scroll on / search shortcutJoe Mou
2026-08-12Handle blobs GitHub cannot previewJoe Mou
Binary files with no preview (a .ttf, say) have no rawLines, no colorizedLines and no richText, so the blob view's final branch threw on a null textLines and the page 500ed. Offer the raw file instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11Read the About box and latest release from JSONJoe Mou
GitHub rebuilt the repository sidebar, so the selectors parseRepoInfo used matched nothing and the About box rendered empty. Everything but the latest release is in the page's embedded payload as sidebarAbout; the latest release is only in the _sidebar JSON already fetched for languages, so it arrives with that fragment and is moved beside the release count.
2026-08-11Keep the ref picker on the current view and pathJoe Mou
2026-08-11Mitigate placeholder layout shiftJoe Mou
2026-08-11Redirect to GitHub with a meta refreshJoe Mou
A browser extension redirects github.com to cgithub with declarative net requests. Its rules match our HTTP redirects back to github.com too, so those bounce straight back here and loop forever. A meta refresh makes cgithub the initiator origin instead, which the extension's rules can exclude, and its delay leaves a page the user can stop on. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11Show the build's commit in the page footerJoe Mou
Workers can't shell out at request time, so the commit has to be baked in before wrangler bundles the sources. compile-views.ts grows a second job and becomes scripts/build.ts: alongside the precompiled views it writes src/commit.generated.ts with `git describe --tags --always --dirty`, which yields a bare short hash until the repo is tagged and marks builds made from an unclean working copy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11Abbreviate commit hashes in branch pickerJoe Mou
2026-08-11Link repo header and add a "View original" linkJoe Mou
The owner/name header in the layout now links to the owner page and the repository root. tryRender passes the request's path and query through as githubUrl — our URLs mirror GitHub's, so the same path is the page we scraped — and the footer links there with rel="noreferrer", matching the no-referrer policy used on redirects to github.com. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11Add language percentages to repo pagesJoe Mou
GitHub no longer server-renders the repository sidebar; its React UI lazily fetches /:owner/:repo/_sidebar as JSON, which carries the language breakdown (name, percentage, color). getGitHubLanguages() uses that endpoint, and a new /api/:owner/:repo/languages fragment route renders the bar and legend the same way refs and latest-commit already work, so repo page loads still cost a single scrape. The latest-commit placeholder loader in refs.js is generalized over .placeholder[data-src] so both placeholders share it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-22Add async branch/tag dropdown and latest-commit barJoe Mou
Adds two lazily-fetched UI pieces to match vanilla GitHub while keeping initial page loads plain server-rendered HTML: a branch/tag selector (native <dialog>, CSS anchor-positioned to its button, light-dismissed via closedby="any") and a latest-commit bar above the file listing. Both are populated by new /api/:owner/:repo/refs/:type and /api/:owner/:repo/latest-commit/:branch/:path routes; the latter calls GitHub's own /latest-commit JSON endpoint (the same one the React UI uses) rather than scraping the full commit history page.
2026-07-15Replace null overview files with HTML commentsJoe Mou
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15Owner page nav menu and layout restructureJoe Mou
Add a menu bar of profile tab links, split the org repository list from pinned repos, and restructure the owner template to match repo pages. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15Add organization support to owner pagesJoe Mou
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15Remove watchers, no longer rendered by GitHubJoe Mou
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-15User profile pagesJoe Mou
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-05-27Basic keyboard shortcut handlingJoe Mou
2026-05-27Pull request indexJoe Mou
2026-05-27Add repo-scoped search support for issues and PRsJoe Mou
We do not support hybrid issue/PR search. Any searches on the issues endpoint will redirect to an explicit issue-only search.
2026-03-16Add viewport meta tag for mobileJoe Mou
2026-02-21Release assetsJoe Mou
Also fix release content parsing.
2026-02-21Add latest release detailsJoe Mou
By Gemini
2026-02-21Release stylingJoe Mou
2026-02-21Add single release detail pages and refactor templatesJoe Mou
Refactored releases display into reusable partial template (_release.eta) and added support for viewing individual releases at /:owner/:repo/releases/tag/:tag with navigation back to all releases. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11Add GitHub releases supportJoe Mou
Scrapes releases page HTML to display version tags, publish dates, and changelog content. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-03Better formatting for long URLsJoe Mou
2026-01-28Commits listJoe Mou
2026-01-28Image supportJoe Mou
2026-01-28Syntax highlightingJoe Mou
Sometimes GitHub returns colorizedLines and sometimes it returns a terser stylingDirectives, which needs to be applied to rawLines.
2026-01-28Render Markdown blobsJoe Mou
2026-01-27List issuesJoe Mou
2026-01-27Split branch and path bread crumbs into separate sectionJoe Mou
2026-01-27Propagate GitHub HTTP errorsJoe Mou
Render `error.eta` on HTTP error from GitHub. Implemented with Gemini.
2026-01-26Show releasesJoe Mou
2026-01-26Append / to directories in tree listingsJoe Mou
2026-01-26git clone commandsJoe Mou
2026-01-26Overview (README) in treesJoe Mou
2026-01-25StylingJoe Mou
2026-01-25Use Phosphor IconsJoe Mou
2026-01-25Repository page with infoJoe Mou
2026-01-23Refactor template layoutJoe Mou
2026-01-23Add blob view for displaying file contentsJoe Mou
2026-01-23Simple web server for viewing treesJoe Mou