+
{props.children}
diff --git a/src/index.css b/src/index.css
index a6c6d86..db98bae 100644
--- a/src/index.css
+++ b/src/index.css
@@ -333,6 +333,13 @@
instead of the viewport, which on mobile is taller than the page. */
--app-viewport: calc(100dvh - env(safe-area-inset-top));
+ /* The UA paints the caret, the text-selection handles, the keyboard and
+ the overscroll canvas from this — and `light dark` in the meta tag makes
+ it follow the OS, not the app. A dark app on a light phone then drew a
+ black caret on a black field, and the strip revealed by overscrolling
+ came back white. Pinning it per theme keeps that chrome in the theme. */
+ color-scheme: light;
+
/* --accent-light / --accent-light-fg are set inline by preferences-context
when the user picks an accent color; the fallback here is the neutral
default for everyone else. */
@@ -369,6 +376,7 @@
/* --accent-dark / --accent-dark-fg are set inline by preferences-context —
a separate, lighter-lightness variant of the same picked hue so it stays
legible against this theme's near-black background. */
+ color-scheme: dark;
--ui-accent: var(--accent-dark, 0 0% 92%);
--background: 0 0% 4%;
--foreground: 0 0% 98%;
@@ -402,7 +410,11 @@
}
html {
- @apply scroll-smooth;
+ @apply scroll-smooth bg-background;
+ /* The canvas behind the page — what an overscroll bounce or a keyboard
+ teardown reveals below the last element — is painted from `html`, not
+ from `body`. Without this it falls back to the UA's white. */
+ overscroll-behavior-y: none;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@@ -440,6 +452,32 @@
pointer-events: none;
}
+ /* Form controls inherit `color` from Tailwind's preflight, but the caret and
+ the selection highlight do not follow it, and a field that overrides its
+ own background (the Çelebi composer is transparent on a card) could end up
+ with a caret the same color as what is behind it. Naming all three keeps a
+ focused field readable in either theme. */
+ input,
+ textarea,
+ select {
+ color: hsl(var(--foreground));
+ caret-color: hsl(var(--primary));
+ -webkit-text-fill-color: currentColor;
+ }
+
+ /* `-webkit-text-fill-color` inherits as a resolved color, so without this the
+ field's own fill would repaint the placeholder in the text color. */
+ input::placeholder,
+ textarea::placeholder {
+ -webkit-text-fill-color: currentColor;
+ }
+
+ input::selection,
+ textarea::selection {
+ background: hsl(var(--primary) / 0.3);
+ color: hsl(var(--foreground));
+ }
+
/* Keep scrolling available while removing native scrollbar chrome globally. */
* {
-ms-overflow-style: none;
diff --git a/src/pages/class-detail-page.tsx b/src/pages/class-detail-page.tsx
index ee2a913..4040aa5 100644
--- a/src/pages/class-detail-page.tsx
+++ b/src/pages/class-detail-page.tsx
@@ -1,4 +1,4 @@
-import { For, Show, Suspense, createMemo, createResource, createSignal } from "solid-js";
+import { For, Show, Suspense, createEffect, createMemo, createResource, createSignal } from "solid-js";
import { Link, useLocation, useNavigate, useParams } from "@tanstack/solid-router";
import type { ColumnDef } from "@tanstack/solid-table";
import {
@@ -16,7 +16,7 @@ import {
import { getCourses } from "@/api/courses";
import { getTerms } from "@/api/terms";
import { getLimits } from "@/api/limits";
-import { ApiError, formatApiError, type BlueprintSkip, type ClassCourse, type ClassMember } from "@/api/client";
+import { ApiError, formatApiError, type BlueprintSkip, type ClassCourse, type ClassGroup, type ClassMember } from "@/api/client";
import { BlueprintSkippedReport } from "@/components/classes/blueprint-skipped-report";
import { RouteGuard } from "@/components/layout/route-guard";
import { Alert } from "@/components/ui/alert";
@@ -79,11 +79,32 @@ function ClassDetailContent() {
const [members, { refetch: refetchMembers }] = createResource(id, async (classId) => (await getClassMembers(classId, { limit: 200 })).items);
const [classCourses, { refetch: refetchCourses }] = createResource(id, async (classId) => (await getClassCourses(classId, { limit: 50 })).items);
+ // The last class the page actually loaded. A refetch that fails leaves the
+ // resource in an error state, and reading it there throws; holding the last
+ // good value lets the page stay up and keeps the error screen for the case
+ // it is meant for — a first load that never produced a class.
+ const [loadedClass, setLoadedClass] = createSignal
();
+ createEffect(() => {
+ if (cls.state === "ready") setLoadedClass(cls());
+ });
+
const termName = (tid: string | null) => terms.latest?.find((term) => term.id === tid)?.name ?? (tid || t("terms.unassigned"));
const courseTitle = (courseId: string) => courses.latest?.find((course) => course.id === courseId)?.title ?? courseId;
const memberUserIds = () => (members.latest ?? []).map((row) => row.user.id);
const attachedCourseIds = () => (classCourses.latest ?? []).map((row) => row.course);
+ // Refreshing the tables after a successful write is not part of the write:
+ // a failed refetch used to be reported as if the save itself had failed, so
+ // the row appeared and an error banner appeared with it. The resource keeps
+ // its previous value and the next load picks the change up.
+ const refresh = async (run: () => unknown) => {
+ try {
+ await run();
+ } catch {
+ // Stale rows are better than telling the user a save failed.
+ }
+ };
+
const wrap = async (fn: () => Promise, successKey?: string) => {
setError("");
setPending(true);
@@ -105,7 +126,7 @@ function ClassDetailContent() {
setPending(true);
try {
const result = await postClassBlueprintApply(id());
- await refetchCourses();
+ await refresh(refetchCourses);
setSkipped(result.skipped);
if (result.skipped.length === 0) setFlash(t("classBlueprints.applied"));
} catch (err) {
@@ -184,10 +205,18 @@ function ClassDetailContent() {
]);
return (
- }>
-
- {(c) => (
+ // Only a load that never produced a class becomes the error screen. A
+ // refetch that fails after a save still has the class in hand, and
+ // replacing the whole page there read as if the save had failed.
+ }>
+ {formatApiError(cls.error)}
+
+ }
+ >
+ {(c) => (
{t("classGroups.title")}
@@ -269,7 +298,7 @@ function ClassDetailContent() {
{/* Edit class */}
-