Skip to content

Repository: Matched GitHub's header, tab counters and repository buttons - #97

Merged
whereareiam merged 1 commit into
devfrom
feat/repo-header-github
Oct 22, 2026
Merged

whereareiam merged 1 commit into
devfrom
feat/repo-header-github

Conversation

@whereareiam

@whereareiam whereareiam commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What changes

The parts every repository page shares now match GitHub, signed in, measured at 1280, 1100, 1011, 900, 768, 600 and 400px. Each change goes through the theme's shared components, so organisation and profile pages pick them up too.

Area Before After (GitHub)
Global header Logo first; owner avatar in the breadcrumb; no search Transparent, outlined 32px menu button before the logo opening the navigation drawer on every width; plain "owner / repo" with a repository icon; a transparent 197px search field with a monospace / hint
Tab counters Forgejo's labels, 20px, weight 500, 6px after the label The counter's tab variant, 18px, semibold, 8px after the label (repository, organisation and profile tabs)
Watch, Fork, Star Two-part buttons with the count in a separate box; feed button One 28px control each with the count inside; Fork has a split menu for its forks and a new fork; no feed button
Branch and Add file buttons 13–14px, weight 400, 14px carets 14px, weight 500, 16px carets, GitHub's padding

Narrower screens

Width GitHub, and now this theme
1012px and up Full search field; page gutter 32px
Below 1012px The search becomes a 32px button before "+"; page gutter 16px
Below 768px The owner folds into a "…" menu before the slash; the tabs drop their icons and keep a 16px gutter; the header keeps only search and the inbox (the drawer has the dashboard links)
Below 600px The logo goes

GitHub hides tab icons once the tabs run out of room; Forgejo has more tabs, so this uses the mobile breakpoint instead of measuring.

Components touched:

  • components/common/button: small size uses GitHub's 4px gap; default buttons draw muted icons; a split control joins an action and its menu; an icon-only small menu trigger is a 28px square; Forgejo's native branch selector and Add file buttons are sized here.
  • components/common/dropdown: a Small option for the 28px trigger.
  • components/common/search: a Shortcut option shows a key hint and focuses the field from anywhere.
  • base/head_navbar_icons: the collapsed search button, shared by the desktop and mobile header.
  • The navigation drawer opens on desktop as well; its create and account sections stay in the header menus there.

Not matched: GitHub's repository switcher arrow, Copilot, and the avatar on the mobile header (Forgejo keeps the account in the drawer). The search searches repositories with Forgejo's translated "Search repos…" placeholder instead of opening GitHub's command palette. The page gutter breakpoint is fixed on the Code page; other repository pages still switch at 768px in their own container rules.

Before and after

Dark mode, in the dev preview. Each pair is before (top) and after (bottom).

Repository page, 1280px
Repository header before
Repository header after
Repository page, 900px
Repository header at 900px before
Repository header at 900px after
Phone, 400px: before after
Repository header at 400px before Repository header at 400px after
Organisation page, 1280px
Organisation header before
Organisation header after

Checks

  • bun vitest: 406 tests pass (the drawer, header geometry and phone breakpoint tests are updated); tsc -b and Prettier pass.
  • Compared positions, colours and hover states with GitHub's signed-in header at each width above; Star toggles through htmx, and the Watch, Fork and owner menus open.
  • bun lint could not run locally: the installed typescript-eslint does not support TypeScript 7.

🤖 Generated with Claude Code

@whereareiam whereareiam added the change Changed look, templates or compatibility label Oct 22, 2026
Measured against github.com (signed in) at 1280, 1011, 900, 768, 600 and
400px. These parts are shared by every repository page, and the changes go
through the theme's shared components instead of page-specific copies:

- Global header: one transparent, outlined menu button before the logo
  opens the existing navigation drawer on every width; the logo is a bare
  32px mark and is dropped below 600px; the repository breadcrumb shows a
  repository icon instead of the owner avatar and folds the owner into a
  "…" menu on narrow screens. A transparent 197px search field (the shared
  search component, with a new monospace shortcut hint) searches
  repositories from 1012px, "/" focuses it, and a search button from the
  shared header icons replaces it below 1012px. On mobile the header keeps
  only search and the inbox; the drawer holds the dashboard links.
- Tabs: repository, organisation and profile tabs use the counter's tab
  variant (18px, semibold), 8px after the label; tab icons drop on mobile
  and the tabs keep a 16px gutter.
- Watch, Fork and Star are single small controls with the count inside;
  Fork gets a split menu with forks and "Fork repository" through the
  shared dropdown, which gains a small size and a square icon-only
  trigger. The feed button is gone, as on GitHub.
- Buttons: the shared control gets GitHub's 4px gap and muted icons at the
  small size, and sizes the branch selector and Add file buttons (14px,
  weight 500, 16px carets).
- The Code page uses GitHub's gutter: 16px, and 32px from 1012px.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@whereareiam
whereareiam merged commit 6d8e3a7 into dev Oct 22, 2026
7 checks passed
@whereareiam whereareiam changed the title Repository: Match GitHub's header, tab counters and repository buttons Repository: Matched GitHub's header, tab counters and repository buttons Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change Changed look, templates or compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant