Add variant support to accuracy-viewer#67
Open
snomos wants to merge 3 commits into
Open
Conversation
Extend accuracy-viewer to support multiple report variants: - Auto-discover report-*.json files - Add variant selector dropdown (upper right corner) - Support ?variant=TAG URL parameter - Default to report.json when no variant specified - Update .gitignore to exclude all report*.json files
Replace hardcoded variant tags with dynamic discovery from ../badgedata/fst-variants.json. This reads the existing variant metadata from lang-* repositories and checks for corresponding report-*.json files. Supports all variant types: - areas (e.g., NO, SE) - dialects - orthographies - writing_systems
- Remove HEAD requests when checking for variant report files Trust that variants listed in fst-variants.json have corresponding reports Show error message if report file is missing when user selects it - Improve UI responsiveness during report loading: Clear report data immediately when changing variants (shows loading state) Use setTimeout(0) to yield to browser between data processing and rendering Don't await fetchReport() in onMount so variant selector appears faster Note: Large reports (17MB+) will still cause UI to freeze during initial rendering due to DOM manipulation. This is a known browser limitation when rendering thousands of table rows.
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.
This PR extends the accuracy-viewer to support multiple report variants.
Changes
Functionality
report-*.jsonfiles (common patterns: NO, SE, Cans, Cyrl, Latn, FI, SV, EN)?variant=TAGreport.jsonwhen no variant is specifiedUI
Files Modified
support/accuracy-viewer/src/App.svelte: Added variant discovery and selection logic.gitignore: Updated to exclude allreport*.jsonfiles (including variants)Testing
Tested with real data from
lang-smjrepository which containsreport.json,report-NO.json, andreport-SE.json.The bundled files (
bundle.js,bundle.css) are not included in this PR as they should be built during deployment. To test locally:cd support/accuracy-viewer npm install npm run build npm run startRelated
Based on existing implementation pattern from giellalt/lang-smj.