Skip to content

fix(demo): sync the extension demo data with the Dart demo - #11

Merged
CsPS0 merged 2 commits into
mainfrom
claude/sweet-fermat-d02b3e
Nov 18, 2026
Merged

CsPS0 merged 2 commits into
mainfrom
claude/sweet-fermat-d02b3e

Conversation

@CsPS0

@CsPS0 CsPS0 commented Nov 18, 2026

Copy link
Copy Markdown
Owner

What changed

  • Extension demo data (extension/shared/kreta_api.js): the DEMO_* data now mirrors lib/api/demo_data.dart, the reference copy that the website previews also show. That covers the grades, subjects, class averages, timetable rooms and topics, messages with their attachments (Visegrad_programterv.pdf, Szuloi_nyilatkozat.docx, Versenykiiras_2026.pdf), ellenőrző notes, absences, homework, exams and teachers. Dates are relative to now or to the school year, the same way the Dart demo works them out.
  • Drift guard: fixtures/demo/demo_summary.json is generated from the Dart demo. test/demo_sync_test.dart and extension/test/demo_sync.test.mjs both reduce their copy to the same summary and compare it with the fixture. Running the Dart test with PALA_UPDATE_DEMO_FIXTURE=1 regenerates the fixture after an intended change.
  • DemoData.getAverages() is now worked out from the demo grades with GradeRules and rounded to two decimals. Its hand-typed values disagreed with the grades (Matematika 4.30 vs 4.52); a new test in test/demo_data_test.dart checks they agree.

Why

The two demo copies had drifted apart: the app showed an overall average of 3.87 and the extension popup 3.32, with different grades and June-dated messages. AGENTS.md rule 7 says both copies must match. Both now show 3.87.

For reviewers

  • Questionnaires stay in the extension demo only, because the Dart demo has none.
  • I tested that the drift check works: changing one Kémia grade in the JS copy made the node test fail on the overall average, the subject averages and the grades.
  • The extension hasn't been loaded in a browser; only the data changed, in field shapes the dashboard already reads.

Checks

  • dart analyze --fatal-infos lib bin test: no issues
  • dart test: 173 passed
  • node --check extension/shared/kreta_api.js: OK
  • node --test extension/test/*.test.mjs: 50 passed

🤖 Generated with Claude Code

The extension's DEMO_* data had drifted from lib/api/demo_data.dart: the
popup showed a 3.32 overall average against the app's 3.87, with other
grades, subjects, June-dated messages, absences and homework. The extension
copy now mirrors the Dart one, including the message attachments and the
ellenőrző notes.

fixtures/demo/demo_summary.json is generated from the Dart demo, and both
test/demo_sync_test.dart and extension/test/demo_sync.test.mjs check their
copy against it, so the two can no longer drift apart unnoticed.

DemoData.getAverages() is now worked out from the demo grades instead of
hand-typed values that disagreed with them (Matematika 4.30 vs 4.52).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
pala Ignored Ignored Preview Nov 18, 2026 7:29pm UTC

Flutter 3.50.0 became the stable release after the last green run and
deprecates package:flutter/material.dart in favour of
package:material_ui. flutter analyze fails on those 38 infos, so every
PR's desktop app check fails regardless of its changes. Pin the version
that last passed until the app moves to material_ui.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CsPS0
CsPS0 merged commit a823f97 into main Nov 18, 2026
6 checks passed
@CsPS0
CsPS0 deleted the claude/sweet-fermat-d02b3e branch November 18, 2026 20:05
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