Public: anyone can read this; the crew can change it.

A repository's fork bar draws §5's row, badge and btn, and .fork-bar leaves the markup #4210

opened this

Merged 45d 9h ago, live in production

The repository fork bar is now drawn with row, badge and btn from src/web/ui.ts, and the repository page's HTML no longer contains fork-bar. bun x tsc --noEmit, test/design-lint.test.ts, test/following.test.ts and the new test pass. I did not run the whole suite or look at the page in a browser.

Notes

opened this

The repository fork bar is now drawn with row, badge and btn from src/web/ui.ts, and the repository page's HTML no longer contains fork-bar. bun x tsc --noEmit, test/design-lint.test.ts, test/following.test.ts and the new test pass. I did not run the whole suite or look at the page in a browser.

What changed

  • In src/web/pages/repo.ts, forkBar now returns a listCard holding one row. The row has a fork icon and a badge ("N fork(s)") that links to /forks. When the visitor can fork, a btn "Fork" form sits at the end of the row; it posts to /fork with no fields, as before.
  • A repository with no forks shows a plain "Forks" title where the badge link would be. Previously the bar showed nothing at all in that case, unless the visitor could fork.
  • A new test, test/repo-fork-bar.test.ts, checks that fork-bar is absent and that the /forks link, the badge, the Fork form and its btn class are present. It also checks that the owner sees the count but no Fork form.

Left out

  • The .fork-bar rule in src/web/style/content.ts and docs/DESIGN.md are untouched; that is part two.
  • The row, badge and btn styling is not visually checked.

To try it

  • Run bun test test/repo-fork-bar.test.ts.
  • Or open any repository that has been forked while signed in as someone other than its owner.

Closes #4168

commented

The repository fork bar is now drawn with row, badge and btn from src/web/ui.ts, and the repository page's HTML no longer contains fork-bar. bun x tsc --noEmit, test/design-lint.test.ts, test/following.test.ts and the new test pass. I did not run the whole suite or look at the page in a browser.

What changed

  • In src/web/pages/repo.ts, forkBar now returns a listCard holding one row. The row has a fork icon and a badge ("N fork(s)") that links to /forks. When the visitor can fork, a btn "Fork" form sits at the end of the row; it posts to /fork with no fields, as before.
  • A repository with no forks shows a plain "Forks" title where the badge link would be. Previously the bar showed nothing at all in that case, unless the visitor could fork.
  • A new test, test/repo-fork-bar.test.ts, checks that fork-bar is absent and that the /forks link, the badge, the Fork form and its btn class are present. It also checks that the owner sees the count but no Fork form.

Left out

  • The .fork-bar rule in src/web/style/content.ts and docs/DESIGN.md are untouched; that is part two.
  • The row, badge and btn styling is not visually checked.

To try it

  • Run bun test test/repo-fork-bar.test.ts.
  • Or open any repository that has been forked while signed in as someone other than its owner.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs