~gitpocket/gitpocket

1

fix(web): fit every page to phone widths

commit
9cfd8cc56441646fef2b51ceb5357a46d78c9ee7 browse tree
parent
289561768541a261f75b2f304ae6fb03133dd142
author
obscurejames <354576047+obscurejames@users.noreply.github.com>
signature
Signed by: ~james SHA256:KlzJ0P0gvJcnOYpaxD5yCUw52ImHttTKRjVAEnnYnKg
date
2026-11-13 16:29 UTC

4 files changed, +18 −8

Dockerfile modified

@@ -6,10 +6,13 @@ COPY . .
66 RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /gitpocket .
77
88 FROM alpine:3.22
9-RUN apk add --no-cache git gnupg openssh-keygen ca-certificates
9+ARG UID=65532 GID=65532
10+RUN apk add --no-cache git gnupg openssh-keygen ca-certificates && \
11+ (getent group "$GID" || addgroup -g "$GID" git) && \
12+ adduser -D -H -h /srv/gitpocket -s /sbin/nologin -u "$UID" -G "$(getent group "$GID" | cut -d: -f1)" git
1013 COPY --from=build /gitpocket /usr/local/bin/gitpocket
1114 ENV HOME=/tmp GOMEMLIMIT=192MiB
12-USER 65532:65532
15+USER $UID:$GID
1316 EXPOSE 3200
1417 ENTRYPOINT ["/usr/local/bin/gitpocket", "-root", "/srv/gitpocket"]
1518 CMD ["serve", "-listen", ":3200"]

deploy/compose.yaml modified

@@ -2,7 +2,11 @@ name: gitpocket
22
33 services:
44 gitpocket:
5- build: ..
5+ build:
6+ context: ..
7+ args:
8+ UID: "${GITPOCKET_UID:?set GITPOCKET_UID}"
9+ GID: "${GITPOCKET_GID:?set GITPOCKET_GID}"
610 image: gitpocket
711 container_name: gitpocket
812 command: ["serve", "-listen", ":3200", "-host", "${GITPOCKET_HOST:?set GITPOCKET_HOST}", "-proxy", "172.31.255.1/32"]

forge/extra.go modified

@@ -604,7 +604,7 @@ func (s *Server) activity(owner User, year int) heatView {
604604 view.Total += n
605605 }
606606 var b strings.Builder
607- fmt.Fprintf(&b, `<div class="heat" style="--weeks:%d"><div class="months">`, weeks)
607+ fmt.Fprintf(&b, `<div class="heatwrap"><div class="heat" style="--weeks:%d"><div class="months">`, weeks)
608608 lastMonth := -1
609609 for w := 0; w < weeks; w++ {
610610 d := start.AddDate(0, 0, 7*w)
@@ -643,7 +643,7 @@ func (s *Server) activity(owner User, year int) heatView {
643643 }
644644 fmt.Fprintf(&b, `<span class="c h%d%s" data-tip="%s" aria-label="%s" tabindex="0"></span>`, level, edge, tip, tip)
645645 }
646- b.WriteString(`</div></div>`)
646+ b.WriteString(`</div></div></div>`)
647647 view.Grid = template.HTML(b.String())
648648 return view
649649 }

web/static/style.css modified

@@ -44,7 +44,8 @@ nav.subtabs a:hover,nav.tabs a:hover{text-decoration:none;color:var(--fg)}
4444 .repohead{margin-top:-1rem}
4545 .repohead h2{padding:.4rem 0 .3rem;font-size:1.9rem}
4646 .tabbar{background:var(--bar)}
47-nav.tabs{display:flex}
47+nav.tabs{display:flex;overflow-x:auto;scrollbar-width:none}
48+nav.tabs a{white-space:nowrap}
4849 nav.tabs a{padding:.25rem .9rem}
4950 nav.tabs a.active{background:var(--bg);color:var(--fg)}
5051 .repohead .desc{margin:0 0 .4rem;color:var(--muted)}
@@ -120,7 +121,8 @@ dl.meta dd{margin:0;overflow-wrap:anywhere}
120121 .readme code,.readme pre{font-size:13.5px}
121122 .readme p{margin:.6rem 0}
122123 .readme img{max-width:100%}
123-.readme table{border-collapse:collapse}
124+.readme table{border-collapse:collapse;display:block;max-width:100%;overflow-x:auto}
125+.readme{overflow-wrap:break-word}
124126 .readme td,.readme th{border:1px solid var(--line);padding:.2rem .5rem}
125127 .readme code{background:var(--code);padding:.05rem .25rem}
126128 .readme pre code{padding:0;background:none}
@@ -136,7 +138,7 @@ table.tree .size{color:var(--muted);text-align:right}
136138 table.tree .last{max-width:30rem;overflow:hidden;text-overflow:ellipsis;width:100%}
137139 table.tree .when{text-align:right}
138140 table.refs td,table.keys td{padding:.3rem 1rem .3rem 0;border-bottom:1px solid var(--line)}
139-.code{margin:0 -1rem;line-height:1.45;min-height:70vh}
141+.code{margin:0 -1rem;line-height:1.45;min-height:70vh;overflow-x:auto}
140142 .code .chroma .lntable{width:auto;min-width:0}
141143 .code .chroma .lntd:last-child{border-right:1px solid var(--bar);min-width:calc(80ch + 1rem);padding-right:1rem;width:auto}
142144 table.blob{width:100%}
@@ -531,3 +533,4 @@ nav.site .bell .badge{position:absolute;top:-.35rem;left:.85rem;min-width:1rem;p
531533 fieldset.links{border:0;padding:0;margin:0 0 .8rem;display:flex;flex-direction:column;gap:.35rem;min-width:0}
532534 fieldset.links legend{padding:0;margin-bottom:.25rem}
533535 @media(max-width:700px){.inboxpanel{position:fixed;top:3.2rem;left:1rem;right:1rem;width:auto;max-width:none}}
536+@media(max-width:800px){.btn{white-space:nowrap}.dashhead{flex-wrap:wrap;row-gap:.4rem}.dashhead h3{white-space:nowrap}.columns.pullbody,.columns.browse,.dash:has(>section+section){grid-template-columns:minmax(0,1fr)}nav.tabs a{padding:.25rem .6rem}table.tree .last,table.tree .mode{display:none}table.tree td.name{white-space:normal;overflow-wrap:anywhere}main a,.crumbs{overflow-wrap:anywhere;min-width:0}.userhead{flex-wrap:wrap;gap:.2rem 1rem}.userhead nav.tabs.small{margin-bottom:0;max-width:100%}.titlerow{flex-wrap:wrap;gap:.3rem .8rem}.titlerow .btn{white-space:nowrap}.columns.user,.columns.orgbody{grid-template-columns:minmax(0,1fr)}.heatwrap{overflow-x:auto;direction:rtl;padding-bottom:2.4rem;margin-bottom:-2.4rem}.heatwrap>.heat{direction:ltr;min-width:620px}.heat .c:hover::after,.heat .c:focus::after{bottom:auto;top:calc(100% + 6px)}}