Commit 8192c6f
feat(history): mirror detail page + rich day cards + review hardening (#64)
* feat(history): mirror day-detail cards + routed detail page at /mirror/$id
- DayDetailCard renders mirror reflections as rich rows: context badge,
time, story-reframe headline, highlight-phrase pull quote, transcript
snippet, plus a "Show more →" link for backend-backed entries
- New MirrorDetailSheet at /mirror/$id shows the full mirror: Story
reframe, Validation, Inferred meaning, Transcript, with Confirm /
Forget actions for pending reviews; sidebar carries date, time, context,
status, and mood tags
- Route lives at /mirror/$id (not /history/mirror/$id) because TanStack's
matcher picks /history/$tab over the more specific /history/mirror/$id
when both sit under _app/history
- Distinguish "Loading…" (captures slice not yet hydrated) from "couldn't
find that mirror" (genuinely missing)
- backend-snapshot: validation flows from MirrorEntryRow into the snapshot
(optional on the type so incremental captures.patch writes are unaffected)
* fix(history): rename day-card section "Mirrors" → "Reflections"
"Mirror" is the agent name; "reflection" is the student-facing capture.
The list heading is user-facing copy, so match the noun the user owns.
* chore(demo): land demo reflections in the current week, hide redundant status line
- Shift all seed timestamps forward 182 days so demo data lands in
the 2026-04 to 2026-05 window (was 2025-07 to 2025-11). Demo-a's
8 reflections are then re-spread across May 18–30 so the calendar's
default 'this week' view shows reflection markers on multiple days
- Day detail card: drop the literal `status: confirmed` text — review
state is already implicit (Confirm/Forget appear only when pending),
and the detail page surfaces the status badge explicitly
* feat(history): make day-card reflections clickable, drop per-card chrome
- Each reflection card is now itself a link to /mirror/$id (when
backend-backed); no separate "Show more" button
- Drop the per-card "Reflection" label — the section heading already says
"Reflections", repeating it on every row is noise
- Drop Confirm/Forget buttons + status text from the card; reviews live
on the detail page where there's room for the full context
- Generic non-ask captures keep their text-only render with the kind
label removed for the same reason
* chore(history): drop dead review/sync code; calendar mood icon goes white when selected
DayDetailCard:
- Remove CaptureActions component, reviewCapture / retryCaptureSync
handlers, patchReviewCapture, syncLine helper, and their state. All
unused now that the day card is a passive list of clickable cards.
CalendarPane:
- Mood Smile icon flips to text-white when its day cell is selected,
matching the reflection/event icons that already do.
* fix(seed): scope per-student wipes by student_id explicitly
resetSeedStudent ran unqualified DELETEs and relied on the RLS policy
to scope them to the current student. The seed CLI typically runs as
neondb_owner which has BYPASSRLS, so those DELETEs wiped every
student's rows on each iteration — only the last student's seed
survived. Same problem made the 'existing count' check see other
students' rows and skip them on subsequent runs.
Fix: filter every reset DELETE by studentId, and filter the existing
count query the same way. Correct under both RLS-enforced and
BYPASSRLS roles.
* fix(history): darken disgust mood color #9CC36E → #5E9135 for stronger contrast
* feat(history): use mood shape images instead of smile icons
Replace the single lucide Smile icon (color-tinted per emotion) with
the existing 3D-style shape art from `mood-shapes.ts`:
- Calendar cell mood markers render the shape image (sphere / teardrop
/ octahedron / cube / torus / capsule / egg / halfcube / disk)
- Day-detail card "Moods" list shows the shape next to the emotion name
in place of the small colored dot
Drop the local MOOD_HEX color maps in both files — the shape SVG owns
its own palette via EMOTIONS, so duplicated hex constants were stale
and prone to drift.
---------
Co-authored-by: Reza Ilmi <reza.ilmi@gt.tech.gov.sg>1 parent 28587bd commit 8192c6f
7 files changed
Lines changed: 664 additions & 320 deletions
File tree
- src
- components/student-space/sheets
- db
- lib/student-space
- routes
- test/ablation/fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 19 | | |
31 | 20 | | |
32 | 21 | | |
| |||
271 | 260 | | |
272 | 261 | | |
273 | 262 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
283 | 278 | | |
284 | 279 | | |
285 | 280 | | |
| |||
0 commit comments