Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ permissions, and form values into the shared controls.
- **Segmented switch:** use `<nav class="theme-switch">` with links and `active` on the current one, as on the releases
and tags pages.
- **Empty state:** use `theme-empty` for a bordered "nothing here" box holding an icon, an `h2` or `h3`, and an optional
paragraph. `templates/user/profile_empty.tmpl` renders one from `Icon`, `Title`, and `Description`. Short inline
messages inside a list or menu stay plain text.
paragraph. `templates/user/profile_empty.tmpl` renders one from `Icon`, `Title`, and `Description`. Add
`theme-empty-compact` for the smaller, borderless block GitHub shows inside a list. Short inline messages inside a
list or menu stay plain text.
- **Label:** use Forgejo's native `ui basic label` for outline labels such as visibility or package type; do not build a
page-specific pill.
- **Select:** wrap a native `<select class="theme-select">` in `<span class="theme-select-wrap">`. The options stay in
Expand Down
20 changes: 20 additions & 0 deletions components/common/empty/empty.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,23 @@
padding: 32px 16px;
}
}

/* Inside a list GitHub's empty state is a compact block without its own border. */
.theme-empty-compact {
gap: 0;
min-height: 0;
padding: 32px !important;
border: 0;
}

.theme-empty-compact > .svg {
width: 24px;
height: 24px;
margin-bottom: 8px;
}

.theme-empty-compact h2,
.theme-empty-compact h3 {
margin: 0 !important;
line-height: 32.5px;
}
13 changes: 4 additions & 9 deletions public/assets/js/issue-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@
const issues = page.querySelector("#issue-list");
if (issues) new MutationObserver(decorateRows).observe(issues, { childList: true, subtree: true });
const empty = page.querySelector("#issue-list > .tw-text-center");
if (isPullList && empty && !input.value.trim()) {
const state = new URL(location.href).searchParams.get("state") || "open";
empty.querySelector("h3").textContent =
state === "open"
? "There aren’t any open pull requests."
: state === "closed"
? "There aren’t any closed pull requests."
: "There aren’t any pull requests.";
if (empty) {
empty.classList.add("theme-empty", "theme-empty-compact");
if (isPullList) empty.querySelector("h3").textContent = "No pull requests matched your search";
const icon = page.querySelector('[data-test-name="open-issue-count"] svg')?.cloneNode(true);
if (icon) {
icon.setAttribute("width", "24");
Expand All @@ -62,7 +57,7 @@
}
}
const filters = page.querySelector("#issue-filters");
if (filters && !isPullList) {
if (filters) {
for (const anchor of filters.querySelectorAll(".switch > a")) {
const text = [...anchor.childNodes].find(node => node.nodeType === Node.TEXT_NODE && node.textContent.trim());
const match = text?.textContent.trim().match(/^([\d.,\s]+)\s+(.+)$/);
Expand Down
2 changes: 0 additions & 2 deletions styles/components/issues/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ import issueList from "./issue_list";
import issueOverview from "./issue_overview";
import issueSidebar from "./issue_sidebar";
import issueTimeline from "./issue_timeline";
import pullList from "./pull_list";
import pullReview from "./pull_review";

export default cssCombine(
issue,
issueComment,
issueList,
issueOverview,
pullList,
issueConversation,
pullReview,
issueSidebar,
Expand Down
11 changes: 2 additions & 9 deletions styles/components/issues/issue_overview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { css, themeVars } from "@lutinglt/gitea-github-theme/core";

// The issue list and the pull request list share one layout.
export default css`
.github-issues {
:is(.github-issues, .github-pull-list) {
& .list-header-issues {
margin: 0 0 16px;
min-height: 32px;
Expand Down Expand Up @@ -131,14 +132,6 @@ export default css`
& .issue-title:hover {
color: ${themeVars.github.fgColor.accent};
}
& > .tw-text-center {
padding: 64px 24px;
}
& > .tw-text-center h3 {
font-size: 24px;
line-height: 32px;
font-weight: 600;
}
}
@media (max-width: 1011.98px) {
& .issue-list-toolbar {
Expand Down
256 changes: 0 additions & 256 deletions styles/components/issues/pull_list.ts

This file was deleted.

Loading
Loading