Repository navigation
feat(frontend): demo mode with labelled sample data; Chinese-first titles - #36
Open
LeoLin990405 wants to merge 1 commit into
Open
LeoLin990405 wants to merge 1 commit into
LeoLin990405 wants to merge 1 commit into
Conversation
… Chinese-first titles - ?demo=1 / VITE_DEMO=1 serves /api/* from src/demo/fixtures.json and replays a finished sample Live Court transcript over a fake EventSource. No backend needed. - fixtures.json is produced by frontend/scripts/build-demo-fixtures.mjs, which runs the real server routes in-process against examples/demo-state/ (throwaway HOME). - Regime data is real; tournament/matches/rankings are hand-written samples, all flagged demo:true / backend demo-fixture / 【示例数据】. Fixed DEMO banner; sidebar no longer claims 'ONLINE localhost:3001' in demo mode. Writes refused. - Page and nav titles Chinese-first with small English labels; solid title text instead of gradient clip; CJK SC font fallbacks; html lang=zh-CN.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A clearly labelled demo mode so the dashboard can be opened, screenshotted and recorded with no backend:
?demo=1(or build withVITE_DEMO=1) answers all/api/*GETs fromfrontend/src/demo/fixtures.json; Live Court replays a finished sample transcript over a fakeEventSource(one event every ~0.7 s, then stops).frontend/scripts/build-demo-fixtures.mjsruns the real server routes in-process againstexamples/demo-state/with a throwawayHOME, so payload shapes are whatever the server really returns (including the honest 503 "Database not available" for analytics/history, which have no sample DB).Honesty rules
regimes/data.demo-t-001, matchesdemo-m-*, Live Court transcript and rankings = hand-written samples:demo: true, backenddemo-fixture, judge providerdemo-fixture (no model), every line prefixed【示例数据】/[DEMO].● DEMO 示例 / 未连接 (fixtures)instead of the hardcoded● ONLINE localhost:3001.Small visual fixes
实时朝堂 LIVE COURT) with a small English label, matching the court theme; onetabs.tssource of truth.background-clipgradient (CJK glyphs rendered blurry/washed with it).<html lang="zh-CN">so browsers pick Simplified glyph variants.Observed, not changed
/api/stats/rankingsmarks every pairwise cellsignificant: true(CI collapses to a point when n=1). The UI does show "样本不足(1 < 5)", but the significance flag itself may deserve agames >= MIN_SAMPLEguard inengine/v5/stats.mjs.Checks
cd frontend && npx tsc -b && npx vite build✓npx vitest run✓ (11 files / 28 tests incl. newsrc/demo/__tests__/demoMode.test.ts)npx eslint .— 0 errors (6 pre-existing warnings)Try:
cd frontend && npm run dev→ http://localhost:5173/?demo=1