Merge pull request 'feat: add pull-to-refresh button for all list views' (#64) from feature/pull-to-refresh into master
Build and Push / test (push) Has been cancelled
Build and Push / build (push) Has been cancelled

This commit was merged in pull request #64.
This commit is contained in:
2026-03-27 04:05:47 +00:00
3 changed files with 52 additions and 1 deletions
+4
View File
@@ -115,6 +115,10 @@ var basePage = template.Must(template.New("base").Parse(`<!DOCTYPE html>
<script src="/static/htmx.min.js"></script> <script src="/static/htmx.min.js"></script>
</head> </head>
<body> <body>
<header class="top-bar">
<span class="top-bar-title">Gitea Mobile</span>
<button class="refresh-btn" hx-get="" hx-target="#main-content" hx-swap="innerHTML" aria-label="Refresh">&#8635;</button>
</header>
<div class="content" id="main-content"> <div class="content" id="main-content">
{{.Content}} {{.Content}}
</div> </div>
+4
View File
@@ -13,6 +13,10 @@
<script src="/static/htmx.min.js"></script> <script src="/static/htmx.min.js"></script>
</head> </head>
<body> <body>
<header class="top-bar">
<span class="top-bar-title">Gitea Mobile</span>
<button class="refresh-btn" hx-get="" hx-target="#main-content" hx-swap="innerHTML" aria-label="Refresh">&#8635;</button>
</header>
<div class="content" id="main-content"> <div class="content" id="main-content">
{{template "content" .}} {{template "content" .}}
</div> </div>
+44 -1
View File
@@ -47,10 +47,53 @@ body {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
/* Top bar */
.top-bar {
position: sticky;
top: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--spacing-sm) var(--spacing-lg);
padding-top: max(var(--spacing-sm), env(safe-area-inset-top));
background: var(--bg-secondary);
border-bottom: 1px solid var(--border);
}
.top-bar-title {
font-size: var(--font-base);
font-weight: 600;
color: var(--text-primary);
}
.refresh-btn {
background: none;
border: none;
color: var(--text-secondary);
font-size: 1.4rem;
padding: var(--spacing-xs) var(--spacing-sm);
cursor: pointer;
-webkit-tap-highlight-color: transparent;
line-height: 1;
border-radius: var(--radius-sm);
transition: color 0.15s ease, background 0.15s ease;
}
.refresh-btn:active {
color: var(--accent-blue);
background: var(--bg-tertiary);
}
.refresh-btn.htmx-request {
animation: spin 0.6s linear infinite;
pointer-events: none;
}
/* Content area */ /* Content area */
.content { .content {
padding: var(--spacing-lg); padding: var(--spacing-lg);
padding-top: max(var(--spacing-lg), env(safe-area-inset-top)); padding-top: var(--spacing-lg);
max-width: 640px; max-width: 640px;
margin: 0 auto; margin: 0 auto;
} }