Skip to content

Commit 404579c

Browse files
Edwin ChanEdwin Chan
authored andcommitted
Remove staged content animations
1 parent f82adc7 commit 404579c

12 files changed

Lines changed: 11 additions & 261 deletions

File tree

CENTRAL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Stack: Next.js, NextAuth (Google + dev bypass), Prisma, KaTeX for math, Lucide i
3333

3434
### Recently landed
3535

36+
- **Immediate content rendering** — removed the global `AnimeRouteEffects` stagger, analytics card/bar entrance pass, trend-chart drawing animation, page fade, smooth scrolling, FTW result-row fade, and floating confetti motion. Routes and analytics now render at their final state immediately. Anime.js remains only for the shared math loading indicator and typewriter caret; ordinary hover/focus and functional feedback transitions remain (sources: `app/layout.tsx`, `app/admin/analytics/page.tsx`, `app/admin/sets/[id]/analytics/page.tsx`, `app/admin/analytics/trend-chart.tsx`, `app/globals.css`).
3637
- **Consistent page exits and sidebar state** — page headers and completion states use the shared `PageBackLink` control with one explicit `Back to …` label, one canonical 44 px control size, and a logical parent destination. The Classes landing page now includes its missing `Back to Dashboard` control, and nested class pages link directly back to `/classes`. Detail pages no longer present competing arrow buttons for both Dashboard and their parent collection. Sidebar activation now selects one most-specific segment-aware route, so the signed-in user's `/users/<username>` page highlights only **My Profile**, while another user's profile highlights **Users**. Active links expose `aria-current="page"`; no schema or deploy change is required (sources: `app/page-back-link.tsx`, `lib/sidebar-navigation.ts`, `app/site-sidebar-nav.tsx`).
3738
- **Uniform Students and Leaderboard rows** — the dense Students and Leaderboard tables opt out of the global alternating cream row background. Ordinary rows now share one neutral surface; top-three Leaderboard emphasis and row hover feedback remain intact (sources: `app/admin/students/page.tsx`, `app/globals.css`).
3839
- **Invisible KaTeX overflow chrome** — inline and display statement math keep local horizontal scrolling for long expressions, but their browser scrollbars are hidden so short formulas no longer render grey pill-shaped “sliders” underneath (source: `app/globals.css`).
@@ -49,7 +50,7 @@ Stack: Next.js, NextAuth (Google + dev bypass), Prisma, KaTeX for math, Lucide i
4950
- **Expanded LaTeX statement support** — KaTeX is upgraded to `0.17.x`, the official `mhchem` extension enables `\ce{...}`, and `lib/latex-compat.ts` converts document wrappers plus `tabular`, `tabular*`, `tabularx`, and `longtable` into safe KaTeX-compatible arrays, including standard optional position arguments such as `[t]`. A production sweep of all published 1985-1998 AJHSME sets found and covered six affected expressions in 1987 Q8/Q23, 1989 Q14/Q22, 1990 Q9, and 1991 Q6. Safe MathLive notation aliases map to KaTeX primitives; editor/HTML commands remain unsupported. Rendering keeps `trust: false`, `maxSize: 50`, and `maxExpand: 1000`. See `docs/latex-support.md`.
5051
- **Legacy LaTeX currency compatibility** — imported contest statements using full-LaTeX `\textdollar` or invalid currency sequences such as `\54` now render through bounded aliases in `lib/latex-compat.ts`; escaped row breaks remain unchanged.
5152
- **Escape-aware LaTeX parsing and safe aliases**`LatexStatement` now tokenizes escaped dollar signs, multiline delimiters, image tokens, and matching bare environments without regex delimiter collisions. This fixes HTML imports such as 1996 AJHSME question 18 (`<math>\$2000</math>`). Conservative aliases cover common blackboard/bold, paired-delimiter, calculus, and basic SI-unit notation; legacy `eqnarray`/`flalign`/`multline` displays are downgraded safely. Security remains `trust: false`, `globalGroup: false`, fresh macros per expression, bounded size/expansion, and inert non-math HTML.
52-
- **Anime.js animation pass** — the shared `MathCurveLoader` now drives SVG path drawing, rotation, and dot pulses with Anime.js v4 instead of CSS keyframes, `AnimeRouteEffects` adds reduced-motion-aware route reveal animations for key panels/rows/actions, and analytics surfaces use `AnalyticsMotion` plus animated `TrendChart` path/dots for growing bars and drawn charts. `TypewriterGreeting` keeps the existing typed/deleted text state machine and only animates the caret, avoiding per-character text tween flicker. Dependency: `animejs` in `package.json`.
53+
- **Focused Anime.js usage** — the shared `MathCurveLoader` drives SVG path drawing, rotation, and dot pulses with Anime.js v4, while `TypewriterGreeting` uses it only for caret motion. Decorative route, analytics, and chart entrance animations were subsequently removed to keep content immediate. Dependency: `animejs` in `package.json`.
5354
- **Per-set analytics access** — admins can open `/admin/sets/[id]/analytics` directly from the student-facing problem set header and the admin set editor; the editor delete action uses full-size topbar button sizing while the list keeps compact row actions.
5455
- **Problem-set writeups**`/problem-sets/[slug]/writeups` lets signed-in users post LaTeX/HTML solution notes with up to four images, then sort by latest/top and upvote/downvote posts. Authors can delete their own writeups with confirmation; admins can delete any writeup. `/writeups` is the sidebar directory for latest/top writeups and problem-set search. Persistence uses new `Writeup`, `WriteupImage`, and `WriteupVote` Prisma models plus `lib/writeup-images.ts`; image bytes are stored through the existing storage layer and streamed via `/api/files/[id]`.
5556
- **Class announcements** — teachers/admins post title/body announcements from `/classes` to one or more classes. `Announcement` persists the message with an implicit class relation; `POST /api/admin/announcements` enforces `admin:users` and teacher ownership. Dashboard loads targeted announcements fresh on page render and pins them above the hero.

DBSMO/Projects/dbsmo/Components.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
date: 2026-06-26
3-
updated: 2026-07-19
3+
updated: 2026-07-26
44
type: components
55
tags: [project, architecture, components, ui, dbsmo]
66
ai-first: true
@@ -15,9 +15,8 @@ This note maps important [[dbsmo]] UI/components to their source files and usage
1515

1616
## Global Shell
1717

18-
- `RootLayout` in `app/layout.tsx`: imports KaTeX CSS/global CSS, configures Inter and Shantell Sans CSS variables, sets metadata/viewport, injects an early theme script from `localStorage`, renders `SiteSidebar`, optional mobile nav toggle, `AnimeRouteEffects`, and `.site-content`.
18+
- `RootLayout` in `app/layout.tsx`: imports KaTeX CSS/global CSS, configures Inter and Shantell Sans CSS variables, sets metadata/viewport, injects an early theme script from `localStorage`, and renders `SiteSidebar`, the optional mobile nav toggle, `.site-content`, and `AppFooter`.
1919
- The two final hand-drawn override sections in `app/globals.css` define paper/ink tokens, graph-paper surfaces, asymmetric squircle card/control corners, marker accents, dark-mode equivalents, and route-specific coverage. Shared functional surfaces use native borders because `border-image` produced unclipped rectangular frames around squircles; `border-shape` remains limited to bounded empty states and the landing orbit. Dark structural borders use lower-opacity ink tokens, and search inputs show a single cyan border only while focused. Global wavy eyebrow/title underlines are intentionally disabled. Shantell Sans is scoped to headings, compact controls, and tabular display text; long-form content, inputs, and math stay in Inter. `app/page.tsx` supplies the decorative math-sketch spans used by the public sign-in composition. The route audit covers all primary non-game surfaces; FTW and Playground are excluded. See [[Common Tasks]] and `docs/visual-system.md`.
20-
- `AnimeRouteEffects` in `app/anime-route-effects.tsx`: client-only Anime.js v4 route reveal pass for visible page panels, rows, cards, and action controls; it reruns on pathname changes and exits for `prefers-reduced-motion`.
2120
- `SiteSidebar` in `app/site-sidebar.tsx`: server component that loads session/user and builds sidebar links based on raw admin role plus `hasPermission(...)`. It renders the Lucide Sigma/DBSMO wordmark, `SiteSidebarNav`, and `GlobalMobileNavScrim`. At desktop widths `app/globals.css` keeps it at 64 px until hover or keyboard focus expands it to 240 px and reveals labels; at mobile widths it remains the existing off-canvas sheet. Browser metadata and the public landing brand use the matching `public/dbsmo-mark.svg` asset.
2221
- `SiteSidebarNav` in `app/site-sidebar-nav.tsx`: client nav that maps link icon names to lucide icons and marks active links by pathname prefix.
2322
- `GlobalMobileNavToggle` and `GlobalMobileNavScrim` in `app/global-mobile-nav.tsx`: mobile sidebar controls used by the root shell/sidebar. Mobile sheet sizing is fixed in `app/globals.css` so hover/focus/focus-within states keep the same top padding and do not shift the nav grid during taps.
@@ -75,8 +74,8 @@ This note maps important [[dbsmo]] UI/components to their source files and usage
7574

7675
- `AnalyticsOverviewPage` in `app/admin/analytics/page.tsx`: server route that builds analytics summary/trend/filter options.
7776
- `AnalyticsFilters` and local `SearchableSelect` in `app/admin/analytics/filters.tsx`: client filter bar that edits query params and supports searchable dropdowns/date range.
78-
- `AnalyticsMotion` in `app/admin/analytics/analytics-motion.tsx`: client Anime.js pass for analytics pages; meter fills, score distribution bars, daily activity bars, and accuracy cards animate on page/filter changes with reduced-motion exit.
79-
- `TrendChart` in `app/admin/analytics/trend-chart.tsx`: client SVG chart for attempts/completions/average percent trend; Anime.js draws the line path and pops the dots in when the chart data changes.
77+
- Analytics metrics in `app/admin/analytics/page.tsx` and `app/admin/sets/[id]/analytics/page.tsx` render directly at their final widths and values; there is no staggered entrance pass.
78+
- `TrendChart` in `app/admin/analytics/trend-chart.tsx`: client SVG chart for attempts/completions/average percent trend. It renders statically and retains pointer/focus hover details without delaying the line, area, or dots.
8079
- `AuditFilters` and local `SearchableSelect` in `app/admin/audit/audit-filters.tsx`: audit-log filtering UI.
8180
- `FeedbackTable` in `app/admin/feedback/feedback-table.tsx`: feedback list/table client.
8281
- `FeedbackActions` in `app/admin/feedback/feedback-actions.tsx`: feedback status/admin-note actions backed by admin feedback APIs.

DBSMO/Projects/dbsmo/File Map.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This is a folder/file guide for [[dbsmo]], verified with CodeGraph and `rg --fil
2525

2626
## `app/` Routes and UI
2727

28-
- `app/layout.tsx`, `app/anime-route-effects.tsx` - root layout, Inter font, KaTeX CSS, theme bootstrap script, sidebar shell, mobile nav toggle, route-level Anime.js reveal effects, and global body wrapper (sources: named files).
28+
- `app/layout.tsx` - root layout, Inter/Shantell Sans fonts, KaTeX CSS, theme bootstrap script, sidebar shell, mobile nav toggle, global body wrapper, and footer. Route content renders immediately without a global entrance-animation component (source: named file).
2929
- `app/globals.css` - dominant styling for app shells and components (source: `app/globals.css`).
3030
- `app/page.tsx`, `app/login/page.tsx`, `app/dashboard/page.tsx` - landing/login/dashboard surfaces (sources: named files).
3131
- `app/site-sidebar.tsx`, `app/site-sidebar-nav.tsx`, `app/global-mobile-nav.tsx` - authenticated sidebar links and mobile nav behavior (sources: named files).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Session updates from the CodeGraph/Second Brain indexing pass onward:
4646
- Added problem-set writeups with LaTeX/HTML text, image uploads, latest/top sorting, and upvote/downvote voting. Writeups are reachable from the set header beside the bookmark action and remain accessible regardless of submission status.
4747
- Added owner/admin writeup deletion with an in-card confirmation step, plus a sidebar Writeups page for browsing latest/top writeups and searching by problem set.
4848
- Added class announcements: teachers/admins can post messages to one or more classes, and students see targeted messages pinned at the top of the dashboard on page load.
49-
- Switched the shared math curve loader, route-level UI reveals, and analytics chart/bar motion to Anime.js v4 while keeping reduced-motion fallbacks; stabilized the dashboard typewriter by removing the per-character text tween that caused flicker.
49+
- Kept Anime.js only for the shared math loading indicator and dashboard caret, while removing delayed route reveals, staggered analytics cards/bars, animated chart drawing, page fades, and floating background motion so content appears immediately.
5050
- Fixed mobile problem-set task cards/sidebar tap layout/dashboard account controls, added the `/classes` Announcements subtab with existing-message deletion, and normalized literal `null` display names.
5151
- Added direct per-set Analytics buttons on both the student-facing set header for admins and the admin set editor, and made the set-editor Delete button match the other topbar action sizing.
5252
- Fixed the mobile sidebar tap/focus jump by keeping the opened sheet geometry stable when nav items receive focus.

app/admin/analytics/analytics-motion.tsx

Lines changed: 0 additions & 75 deletions
This file was deleted.

app/admin/analytics/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { Prisma } from "@prisma/client";
44
import { getServerSession } from "next-auth/next";
55
import { redirect } from "next/navigation";
66
import { AnalyticsFilters } from "./filters";
7-
import { AnalyticsMotion } from "./analytics-motion";
87
import { TrendChart, type TrendPoint } from "./trend-chart";
98
import { prisma } from "@/lib/db";
109
import { authOptions } from "@/lib/auth";
@@ -516,7 +515,6 @@ export default async function AnalyticsOverviewPage({
516515
<span className="bg-spark bg-spark-two" />
517516
</div>
518517
<div className="page-frame analytics-frame">
519-
<AnalyticsMotion />
520518
<header className="topbar standalone">
521519
<div>
522520
<p className="eyebrow">Admin</p>

app/admin/analytics/trend-chart.tsx

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

3-
import { animate, stagger } from "animejs";
4-
import { useEffect, useMemo, useRef, useState } from "react";
3+
import { useMemo, useRef, useState } from "react";
54

65
type TrendPoint = {
76
label: string;
@@ -85,55 +84,6 @@ export function TrendChart({ data }: { data: TrendPoint[] }) {
8584
const hovered = hover !== null ? points[hover] : null;
8685
const tooltipPct = hovered ? Math.max(0, Math.min(100, ((hovered.x - PAD_L) / PLOT_W) * 100)) : 0;
8786

88-
useEffect(() => {
89-
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
90-
return;
91-
}
92-
93-
const root = wrapRef.current;
94-
const line = root?.querySelector<SVGPathElement>(".trend-line");
95-
const area = root?.querySelector<SVGPathElement>(".trend-area");
96-
const dots = root ? Array.from(root.querySelectorAll<SVGCircleElement>(".trend-dot")) : [];
97-
98-
if (!line) {
99-
return;
100-
}
101-
102-
const length = line.getTotalLength();
103-
line.style.strokeDasharray = `${length}`;
104-
line.style.strokeDashoffset = `${length}`;
105-
106-
const lineAnimation = animate(line, {
107-
strokeDashoffset: 0,
108-
duration: 980,
109-
ease: "outCubic",
110-
});
111-
const areaAnimation = area
112-
? animate(area, {
113-
opacity: [{ from: 0, to: 1 }],
114-
duration: 720,
115-
delay: 240,
116-
ease: "outQuad",
117-
})
118-
: null;
119-
const dotAnimation =
120-
dots.length > 0
121-
? animate(dots, {
122-
opacity: [{ from: 0, to: 1 }],
123-
scale: [{ from: 0.55, to: 1 }],
124-
duration: 420,
125-
delay: stagger(32, { start: 320 }),
126-
ease: "outBack(1.5)",
127-
})
128-
: null;
129-
130-
return () => {
131-
lineAnimation.revert();
132-
areaAnimation?.revert();
133-
dotAnimation?.revert();
134-
};
135-
}, [linePath]);
136-
13787
return (
13888
<div className="trend-chart-wrap" ref={wrapRef}>
13989
<svg

app/admin/sets/[id]/analytics/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { prisma } from "@/lib/db";
66
import { authOptions } from "@/lib/auth";
77
import { computeScoreBuckets, accuracyLevel } from "@/lib/analytics";
88
import { hasPermission } from "@/lib/permissions";
9-
import { AnalyticsMotion } from "@/app/admin/analytics/analytics-motion";
109
import { PageBackLink } from "@/app/page-back-link";
1110

1211
export const dynamic = "force-dynamic";
@@ -64,7 +63,6 @@ export default async function SetAnalyticsPage({ params }: Props) {
6463
<span className="bg-band bg-band-two" />
6564
</div>
6665
<div className="page-frame analytics-frame">
67-
<AnalyticsMotion />
6866
<header className="topbar standalone">
6967
<div>
7068
<p className="eyebrow">Analytics</p>

app/anime-route-effects.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)