Skip to content

v0.2.0: one package for Gitea 1.27.x and 28.x, GitHub styling for 28's new UI - #3

Merged
mechiland merged 3 commits into
mainfrom
gitea-28
Oct 12, 2026
Merged

mechiland merged 3 commits into
mainfrom
gitea-28

Conversation

@mechiland

Copy link
Copy Markdown
Owner

Problem

Gitea dropped the "1." prefix: 28.0.0 (2026-09-29) and 28.1.0 (2026-10-06). v0.1.2 does not work on 28:

  • repo/view_list.tmpl calls $entry.GetSubJumpablePathName (28: takes arguments, call $.GetSubJumpablePathName $entry) and repo/view_file.tmpl calls .Repository.CanEnableEditor (28: CanContentChange). The repository home and every file page fail mid-render (HTTP 200, truncated page).
  • repo/wiki/view.tmpl uses $.CloneButtonShowHTTPS (removed); the navbar overrides miss 28's impersonation banner and the always-rendered stopwatch popup.
  • 28 renamed or restructured markup the CSS targets (profile sidebar, commit header, .web-banner-* → .site-banner-*, .ui.dropzone → .dropzone, release header, notifications toolbar, Actions sidebar, deploy keys) and adds UI the theme had never seen (toasts per level, repo switcher, job queue, artifact preview, diff file filter, audit log, deploy tokens).

Fix

One package for both majors (gitea-theme-github-0.2.0-gitea1.27-28):

  • Where 1.27.3 and 28.1.0 differ, a template starts with {{$gitea1 := StringUtils.HasPrefix AppVer "1."}} and branches only there. Non-github themes keep each version's upstream bytes; base/head_navbar.tmpl carries both upstream navbars.
  • base/head_impersonate_banner.tmpl (28.1.0 verbatim) ships because html/template rejects a reference to an undefined template even in a branch that never runs (verified on 1.27.3).
  • The package can be installed before upgrading Gitea from 1.27 to 28 and kept afterwards.

28 styled to Primer, 1.27 unchanged, with each version's own functions kept:

  • Changed markup: profile sidebar, commit header and its "N files changed +a −d" row (github.com's current commit page has the same row), site banner, dropzone, diff kebab, feed excerpt, release header, notifications toolbar, Actions sidebar (one sticky pane instead of two sticky menus), deploy key / token panels, wiki view class.
  • 28-only UI: toasts per level (Primer Toast), site and impersonation banners (flash-full), quick repo switcher on the AppHeader repo crumb (SelectPanel, as on github.com; the repo-header copy is hidden), job queue (Actions PageLayout + DataTable), artifact preview (NavList file tree), diff file filter + extension menu, audit log, deploy tokens (Box rows, Blankslate), "Mark this page as read", Audit Log nav icon.

Footer shows the Gitea version again ([other] SHOW_FOOTER_VERSION still controls it); only the timing span stays hidden.

Budget 300 → 340 KB per file (gate 335 KB); theme-github-auto.css is 304 KB.

Checks

  • npm run lint passes (PERF-2 / PERF-3 included); build.mjs --strict passes; page-scope 0 leaks.
  • Render check, 1.27.3 and 28.1.0: 105 routes × signed in (github-auto) and anonymous (gitea-auto) = 420 renders, all complete, no template errors in either server log.
  • Non-github themes: anonymous HTML of every route with vs. without the templates differs only by the documented hidden "N Commits" link, on both versions.
  • 1.27 regression: full-page screenshots of 99 signed-in routes before and after, pixel-diffed. The only differences are live data (relative times, admin stats, charts, an animated GIF, admin config JSON key order) and test data added during the check (stopwatch events on one issue).
  • 28: light, dark and 390px screenshots of every changed surface; stopwatch popup including a real-time push, impersonation and site banners, toasts via /devtest.
  • Large diff (334k elements, signed in): class change on a diff cell ~24 ms on both versions (v0.1.2: 25 ms).
  • Not seen with real data: the diff-line-truncated label (lines over 5000 characters) and a bot account's label. Both are plain Primer Labels.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

mechiland and others added 3 commits October 12, 2026 17:49
The site footer hid the version span next to "Powered by Gitea" (FG2-028).
With one package for two Gitea majors the running version matters, so it
is shown again; Gitea's [other] SHOW_FOOTER_VERSION still controls it and
admins get the link to the site configuration. Only the page / template
timing span (the one with <strong>) stays hidden.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gitea dropped the "1." prefix: 28.0.0 (2026-09-29), 28.1.0 (2026-10-06).
v0.1.2's templates break on 28: repo/view_list.tmpl and repo/view_file.tmpl
call methods 28 removed (GetSubJumpablePathName without args,
Repository.CanEnableEditor) and the pages fail mid-render.

Templates: where 1.27.3 and 28.1.0 differ, a template starts with
`{{$gitea1 := StringUtils.HasPrefix AppVer "1."}}` and branches only there,
so non-github themes keep each version's upstream bytes (anonymous HTML of
every route with vs. without the templates differs only by the hidden
"N Commits" link). base/head_navbar.tmpl carries both upstream navbars;
custom/gh_head_navbar.tmpl gains 28's impersonation banner, the always
rendered stopwatch popup and the quick repo switcher on the repo crumb.
base/head_impersonate_banner.tmpl (28.1.0 verbatim) ships because
html/template rejects a reference to an undefined template even in a
branch that never runs.

CSS for 28's changed markup, next to the 1.27 selectors: profile sidebar
(segment + flex-divided-list), commit header and its "N files changed"
row, .site-banner-*, .dropzone without .ui, diff kebab, feed excerpt,
release header, notifications toolbar, Actions sidebar (second
"Management" menu: one sticky pane instead of two sticky menus), deploy
key/token panels, wiki `view` class (kept by the template).

28-only UI in Primer style: toasts per level, flash-full site and
impersonation banners, repo switcher (AppHeader crumb, SelectPanel),
job queue (Actions PageLayout, DataTable), artifact preview file tree,
diff file filter + extension menu, audit log filter row and table,
deploy tokens, "Mark this page as read", Audit Log nav icon.

Budget: 300 → 340 KB per file (gate 335); auto is 304 KB.
Package: gitea-theme-github-<v>-gitea1.27-28.

Checked on 1.27.3 and 28.1.0: 420 renders (105 routes, signed in and
anonymous), no template errors; light, dark, 390px; 1.27 pixel-diffed
against a pre-change capture of 99 routes (only live data differs);
334k-element diff: ~24 ms per class change on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mechiland
mechiland merged commit afafb07 into main Oct 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant