Responsive web UI improvements (archie)

Implements #1
This commit is contained in:
sam committed 2026-07-22 05:53:37 +10:00
1 parent 720b95b57a
commit ab1faa4c48
2 files changed
+54 -4

No files matched your search

+15 -4
View File
@@ -24,14 +24,17 @@
border-radius: 8px; padding: .9rem 1rem; }
section h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
color: var(--dim); margin: 0 0 .6rem; }
.cards { display: flex; gap: .6rem; flex-wrap: wrap; grid-column: 1 / -1;
.cards { display: flex; gap: .6rem; flex-wrap: wrap; grid-column: 1 / -1; max-width: 100%; }
section { min-height: 1.25rem; }
background: none; border: none; padding: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
padding: .55rem .9rem; min-width: 7.5rem; }
.card .n { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.card .l { color: var(--dim); font-size: .78rem; }
section .table-wrap { position: relative; overflow-x: auto; max-width: 100%; }
section .table-wrap table { min-width: 100%; margin-left: calc(1rem - minmax(0,1fr)); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { text-align: left; color: var(--dim); font-weight: 500; padding: .25rem .5rem .25rem 0; }
th { text-align: left; color: var(--dim); font-weight: 500; padding: .25rem .5rem .25rem 0; white-space: nowrap; }
td { padding: .3rem .5rem .3rem 0; border-top: 1px solid var(--line);
font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; }
@@ -43,8 +46,8 @@
tr.task { cursor: pointer; } tr.task:hover td { background: #1c242d; }
#feed { font-family: ui-monospace, monospace; font-size: .78rem; max-height: 30rem;
overflow-y: auto; display: flex; flex-direction: column-reverse; }
#feed div { padding: .12rem 0; border-top: 1px solid var(--line); white-space: nowrap;
overflow: hidden; text-overflow: ellipsis; }
#feed div { padding: .12rem 0; border-top: 1px solid var(--line); white-space: normal;
overflow: visible; text-overflow: unset; word-break: break-word; }
#feed .t { color: var(--dim); } #feed .k { color: var(--accent); }
#feed .k-parked, #feed .k-pr_rejected { color: var(--bad); }
#feed .k-pr_merged, #feed .k-outcome { color: var(--ok); }
@@ -54,6 +57,14 @@
vertical-align: middle; }
.muted { color: var(--dim); }
@media (max-width: 950px) { main { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
section, #timeline { padding: .6rem .8rem; }
header { padding: .75rem 1rem; }
.card { min-width: 4.5rem; }
table, .table-wrap { font-size: .8rem; }
th, td, #feed div { padding: .18rem .35rem; }
#feed { white-space: normal; overflow: visible; text-overflow: unset; word-break: break-word; }
}
</style>
</head>
<body>
+39
View File
@@ -128,6 +128,45 @@ func TestHandleIndex(t *testing.T) {
}
}
func TestIndexContainsViewportMeta(t *testing.T) {
srv := newTestServer(t)
req := httptest.NewRequest("GET", "/", nil)
w := httptest.NewRecorder()
srv.Handler().ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Fatalf("status = %d", w.Code)
}
body := w.Body.String()
if !strings.Contains(body, `<meta name="viewport" content="width=device-width, initial-scale=1">`) {
t.Error("viewport meta missing in rendered HTML")
}
}
func TestIndexHasResponsiveFeatures(t *testing.T) {
srv := newTestServer(t)
req := httptest.NewRequest("GET", "/", nil)
w := httptest.NewRecorder()
srv.Handler().ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Fatalf("status = %d", w.Code)
}
body := w.Body.String()
reqs := []struct{
name string
want string
}{
{"mobile-font-padding", "section { min-height: 1.25rem; }"},
{"table-wrap", "section .table-wrap { position: relative; overflow-x: auto;"},
{"feed-wraps", "white-space: normal"},
{"700px-breakpoint", "@media (max-width: 700px)"},
}
for _, r := range reqs {
if !strings.Contains(body, r.want) {
t.Errorf("missing responsive feature %q: %q", r.name, r.want)
}
}
}
func TestHandleSSEBacklogAndLive(t *testing.T) {
srv := newTestServer(t)
ctx := t.Context()