Skip to content

chore: remove Habit models, fix docs, add calendar task editing - #47

Merged
WalkmanOfWar merged 20 commits into
mainfrom
fix/cleanup-calendar-edit
May 28, 2026
Merged

chore: remove Habit models, fix docs, add calendar task editing#47
WalkmanOfWar merged 20 commits into
mainfrom
fix/cleanup-calendar-edit

Conversation

@WalkmanOfWar

@WalkmanOfWar WalkmanOfWar commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Usunięto modele Habit i HabitCompletion ze schematu Prismy i bazy danych
  • CLAUDE.md: oznaczono email reminders i PWA jako [x] (były gotowe, tylko nieoznaczone)
  • README.md: usunięto przestarzały wpis crona habit-reminders
  • Kalendarz: pobieranie kategorii; przycisk Edytuj w bocznym panelu szczegółów zadania; TaskModal z pełną edycją

Test plan

  • Kliknij zadanie w kalendarzu → panel boczny → przycisk "Edytuj" otwiera modal
  • Zapisz zmianę → kafelek w kalendarzu się aktualizuje
  • Schema Prismy nie ma już modeli Habit/HabitCompletion

🤖 Generated with Claude Code

WalkmanOfWar and others added 20 commits May 26, 2026 11:21
Faza 3 — Szybkie wygrane:
- Interleaving: checkbox "Przeplataj tematy" w modal egzaminu; planner
  domyślnie blokowy (A→A→B→B), z opcją przeplatania (A→B→C→A→B→C);
  odznaka Shuffle w exam-card; pole interleaved w schemacie Prisma
- Technika Feynmana: po ocenie ≥ 3/5 modal oceny przechodzi do kroku 2
  (wyjaśnienie tematu własnymi słowami), AI ocenia i daje feedback;
  nowe pole reflection w StudySession; endpoint /reflect/route.ts
- Deep Work: przełącznik 🍅 25/5 ↔ 🧠 90/20 w timerze Pomodoro;
  powiadomienie przeglądarki po zakończeniu 90-minutowej pracy
- Sleep Consolidation: nowy cron 21:30 UTC wysyłający push z listą
  przerobionych dziś tematów; dodany do vercel.json

Faza 4 — Analityka nauki:
- /api/stats/flashcards: retencja (% Good+Easy 30d), liczba dojrzałych
  kart, aktywność powtórek (14d), statystyki per talia
- /api/stats/confidence: mapa pewności per egzamin i temat
- /stats/page.tsx: sekcja "Fiszki analityka" (KPI, wykres słupkowy
  aktywności, tabela talii) + sekcja "Mapa pewności" (kolorowe kwadraty
  per sesja per temat)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- prisma: drop Habit + HabitCompletion models and User relation; db push applied
- CLAUDE.md: mark email reminders and PWA as completed [x]
- README.md: remove stale habit-reminders cron entry
- calendar: fetch categories; add "Edytuj" button in detail sheet;
  wire up TaskModal so tasks can be edited directly from the calendar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Empty string from TaskModal when no category selected was passed to the
API instead of null, causing P2003 foreign key constraint error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
deadline = end of work. A task due at 16:30 taking 30 min now shows
15:30–16:30 instead of 16:30–17:00. Clip logic prevents blocks from
going above the visible grid for very early deadlines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Only tasks with explicit estimatedMinutes extend backward from deadline.
Tasks with no duration get a 1-slot forward marker at the deadline slot,
so a midnight task (clamped to 22:00) shows at 22:00, not 21:30.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…clamp to 22:00

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
API routes:
- All Prisma handlers wrapped in try/catch with Polish error messages
- HTTP status codes extracted to named constants (HTTP_UNAUTHORIZED etc.)
- serverError() helper added per route file
- findOwnedTask/Exam/Deck/Card helpers extracted to remove auth duplication
- Explicit Promise<NextResponse> return types on all handlers

Named constants (magic number extraction):
- lib/fsrs.ts: MS_PER_DAY, MS_PER_MINUTE, AGAIN/HARD/GOOD_DELAY_MS,
  EASY_GRADUATE_MULTIPLIER, HARD_PENALTY_FALLBACK
- lib/study-planner.ts: MS_PER_DAY, NOON_HOUR, DAYS_BUFFER_BEFORE_EXAM
- app/calendar/page.tsx: MS_PER_DAY, MONTH_GRID_CELLS, DEFAULT_DROP_HOUR,
  MAX_RECURRENCE_EXPANSIONS, MONTH_CELL_MAX_VISIBLE, UNSCHEDULED_SIDEBAR_LIMIT
- app/api/exams/[id]/sessions/route.ts: MS_PER_DAY, DEFAULT_REVIEW_INTERVAL_DAYS

Type annotations:
- lib/utils.ts: explicit return types on cn(), daysBetween()
- lib/google-calendar.ts: Promise<calendar_v3.Calendar> return type

Minor: renamed single-letter locals (r→row, s→subtask, r→retrievabilityScore)

Fix: fsrs.ts AGAIN/HARD/GOOD_DELAY_MS — remove invalid `as const` on expressions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
setVapidDetails() moved inside getWebPush() helper so it runs at
call-time, not at module load — fixes next build failing on /api/cron/reminders.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@WalkmanOfWar
WalkmanOfWar merged commit 34b76d0 into main May 28, 2026
1 check passed
@WalkmanOfWar
WalkmanOfWar deleted the fix/cleanup-calendar-edit branch May 28, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant