Skip to content

Techquiz#2

Merged
holg merged 3 commits intomainfrom
techquiz
Mar 7, 2026
Merged

Techquiz#2
holg merged 3 commits intomainfrom
techquiz

Conversation

@holg
Copy link
Copy Markdown
Owner

@holg holg commented Mar 7, 2026

All tests passed, as well i tried online and in the tui

Summary by CodeRabbit

  • New Features

    • Added photometric file comparison with multiple visualization modes and metrics
    • Added BIM parameter viewing and export functionality
    • Added schema validation UI with detailed error reporting
    • Added three new diagram types: Isolux, Isocandela, and Floodlight
    • Expanded file format support to include IES and XML files
    • Added Imperial/Metric unit system toggle
    • Added C-plane rotation capability in CLI
    • Expanded template library with 19+ new luminaire examples
  • Documentation

    • Comprehensive localization updates across 7 languages
    • Enhanced validation messaging with standardized error codes

holg added 2 commits March 6, 2026 19:53
Pure Rust shared library with 155 questions across 15 categories
(EULUMDAT, IES, symmetry, coordinates, calculations, BUG rating,
UGR/glare, color science, horticultural, BIM, modern formats,
validation, units, diagrams, standards). FFI-safe types for
uniffi/PyO3 cross-platform use. Optional serde feature.
…g category

- Add eulumdat-tui-quiz crate: ratatui terminal quiz with braille polar
  diagrams, half-block heatmap renderer, config/quiz/results screens,
  language picker (F2), clap CLI with --lang/--help
- Add eulumdat-wasm-quiz crate: Leptos web quiz with SVG diagrams,
  dark/light theme, per-question diagram routing for DiagramReading
- Add DiagramReading category (20 questions): polar diagram interpretation
  (12) and heatmap reading (8) with per-question diagram selection
- Add pitfalls category, quiz i18n with 195 questions in 8 languages
- Add heatmap UI string to QuizUiStrings (optional, backward-compatible)
- Add compare module, BIM/schema validation, template improvements
- Update eulumdat-i18n with compare/validation/BIM translation keys
Copilot AI review requested due to automatic review settings March 7, 2026 16:02
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 7, 2026

Warning

Rate limit exceeded

@holg has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 53 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a6bc2391-89d7-4d68-8373-efda6473c9cf

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff9755 and 5a88197.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • Cargo.toml
📝 Walkthrough

Walkthrough

This PR introduces comprehensive photometric comparison, BIM data visualization, and schema validation across Swift and Rust platforms. New diagram types (Isolux, Isocandela, Floodlight) with C-plane rotation support are added. Localization is expanded with structured validation codes and comparison metrics. Multiple template resources and a new quiz module are included.

Changes

Cohort / File(s) Summary
Swift UI Views
BimPanelView.swift, CompareView.swift, SchemaValidationView.swift
New views for BIM parameter display, photometric comparison with multiple overlay/side-by-side modes, and schema validation UI with error/warning details. Includes platform-specific macOS windowing and iOS fullscreen modes.
Swift Core Updates
ContentView.swift, Room3DView.swift
Extended ContentView with Compare and BIM tabs, new diagram types (Isolux, Isocandela, Floodlight), imperial/metric unit toggling, and C-plane slider controls. Room3DView adds scene change detection to avoid unnecessary rebuilds.
Xcode Project Configuration
EulumdatApp.xcodeproj/project.pbxproj
Added new Swift source files, template/photometric resource entries, bumped macOS deployment target from 13.0 to 14.6, wired Compare window with singleton model state.
Rust CLI & Rotation Support
eulumdat-cli/src/cli.rs, eulumdat-cli/src/commands.rs, eulumdat-cli/src/main.rs
Added rotate parameter (f64) for C-plane rotation during conversion; implements load_with_rotation for IES imports and IesExportOptions handling.
Rust egui UI Layer
eulumdat-egui/src/app.rs, eulumdat-egui/src/ui/diagram_panel.rs, eulumdat-egui/src/ui/tabs.rs
Added CompareMode enum and compare/BIM panel rendering; introduced DiagramParams struct for isolux/isocandela/floodlight; expanded MainTab/SubTab with Compare group and new diagram types; wired SVG generation for plane-specific diagrams.
Rust FFI Expansion
eulumdat-ffi/src/bim.rs, eulumdat-ffi/src/compare.rs, eulumdat-ffi/src/schema_validation.rs, eulumdat-ffi/src/diagram.rs, eulumdat-ffi/src/lib.rs
New modules for BIM parameters, photometric comparison with metrics, and schema validation; extended diagram FFI with 12+ new functions for isolux/isocandela/floodlight/overlay variants with localization support.
Template & Resource Registry
Templates.swift, Cargo.toml
Added IES format case and 18 new LuminaireTemplate cases (TM-33/TM-32 XML templates, LEDVANCE LDT files, horticultural/UV/far-red/seedling luminaire definitions). Added rfd and toml dependencies.
Localization Foundation
eulumdat-i18n/locales/en.json, ...de/es/fr/it/pt-BR/ru/zh.json, eulumdat-i18n/src/lib.rs
Replaced legacy validation messages (missing_manufacturer, etc.) with coded structure (w001–w047, e001–e006) across 7 languages; added comparison metrics block, new UI sections (compare, bim, schema, isolux, floodlightCtrl); extended ValidationLocale and UiLocale with new struct types and lookup methods.
Photometric Data Resources
Resources/Templates/tm-33-23_*.xml, .../tm-32-24_*.xml, .../4058075580*.ldt, .../ITALO/*.IES, .../S01.01.02.354_*.IES
Added 14 template files: TM-33-23 horticultural/UV/far-red/seedling/minimal/custom-data variants, TM-32-24 office/road, LEDVANCE floodlight LDTs (600/900/1200W), and IES photometric data files for ITALO and Maxwell fixtures.
New Quiz Crate
eulumdat-quiz/Cargo.toml, eulumdat-quiz/locales/de.json
Introduces new quiz module with German localization covering 2000+ lines of Q&A content on photometry, standards, color science, BIM, and GLDF topics.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CompareUI as Compare UI<br/>(Swift/egui)
    participant FileLoader as File Loader
    participant PhotometricEngine as Photometric<br/>Comparison Engine
    participant SVGRenderer as SVG Diagram<br/>Renderer
    participant MetricsCalculator as Metrics &<br/>Similarity Calc.
    
    User->>CompareUI: Load File A (LDT/IES)
    User->>CompareUI: Load File B (LDT/IES/XML)
    CompareUI->>FileLoader: Parse File A & B
    FileLoader-->>CompareUI: Eulumdat objects
    User->>CompareUI: Select Compare Mode (Overlay/Side-by-Side)
    User->>CompareUI: Select C-Plane (optional)
    CompareUI->>PhotometricEngine: compare_photometric(A, B, mode)
    PhotometricEngine->>MetricsCalculator: Calculate metrics<br/>(flux, LOR, BUG, etc.)
    MetricsCalculator-->>PhotometricEngine: Metrics & similarity
    PhotometricEngine-->>CompareUI: ComparisonResult
    CompareUI->>SVGRenderer: generate_overlay_svg(A, B, mode)
    SVGRenderer-->>CompareUI: SVG string
    CompareUI-->>User: Render diagrams +<br/>metrics table
    User->>CompareUI: Export CSV/PDF
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Comparing luminaires with grace,
New diagrams light up the place,
BIM data glows, schemas align,
Isolux rays in patterns so fine,
From quiz to FFI, features combine!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Techquiz' is vague and generic, providing minimal information about the substantial changes in this PR. Consider a more descriptive title that captures the main change, such as 'Add eulumdat-quiz crate with TUI and WASM quiz applications' or 'Introduce interactive quiz engine with TUI and web applications'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 85.57% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch techquiz

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds localized validation/comparison support and new tooling/UI capabilities (comparison, BIM, schema validation, new diagram types, and conversion rotation), plus accompanying locale and template updates.

Changes:

  • Expanded i18n locale structures to support code-keyed validation messages and comparison metric translations.
  • Added new UniFFI exports for localized validation, photometric comparison, BIM parameter extraction, and schema validation.
  • Introduced new diagrams (isolux/isocandela/floodlight), compare UI surface areas, CLI C-plane rotation option, and new app templates/resources.

Reviewed changes

Copilot reviewed 52 out of 141 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
crates/eulumdat-quiz/Cargo.toml Adds a new eulumdat-quiz crate manifest (quiz engine scaffold).
crates/eulumdat-i18n/src/lib.rs Extends locale model (comparison + validation messages) and adds lookup/templating helpers.
crates/eulumdat-i18n/locales/zh.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-i18n/locales/ru.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-i18n/locales/pt-BR.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-i18n/locales/it.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-i18n/locales/fr.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-i18n/locales/es.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-i18n/locales/en.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-i18n/locales/de.json Updates validation messages to keyed codes; adds compare/report UI strings and comparison metrics.
crates/eulumdat-ffi/src/validation.rs Adds localized validation/warnings/errors FFI entrypoints.
crates/eulumdat-ffi/src/schema_validation.rs Adds schema validation FFI surface (S001/TM33/TM32).
crates/eulumdat-ffi/src/lib.rs Re-exports new FFI modules and adds new diagram exports.
crates/eulumdat-ffi/src/diagram.rs Adds isolux/isocandela/floodlight + per-plane and overlay SVG generation functions.
crates/eulumdat-ffi/src/compare.rs Adds photometric comparison result types + localized comparison export.
crates/eulumdat-ffi/src/bim.rs Adds BIM extraction/availability APIs and data records for FFI consumers.
crates/eulumdat-egui/src/ui/tabs.rs Adds Compare main tab and new subtabs (isolux/isocandela/floodlight/BIM/compare panel).
crates/eulumdat-egui/src/ui/diagram_panel.rs Adds new diagram types & params and refines diagram centering/layout behavior.
crates/eulumdat-cli/src/main.rs Wires rotate into convert command execution.
crates/eulumdat-cli/src/commands.rs Implements optional C-plane rotation during conversion (import/export).
crates/eulumdat-cli/src/cli.rs Adds --rotate flag to conversion CLI.
EulumdatApp/EulumdatApp/Templates.swift Adds IES template support and many new templates; improves bundle reading encoding handling.
EulumdatApp/EulumdatApp/SchemaValidationView.swift Adds a new schema validation + localized LDT/IES validation UI.
EulumdatApp/EulumdatApp/Room3DView.swift Optimizes 3D scene rebuilds by introducing a scene-change key.
EulumdatApp/EulumdatApp/Resources/Templates/tm-33-23_with_custom_data.xml Adds TM-33-23 custom data template resource.
EulumdatApp/EulumdatApp/Resources/Templates/tm-33-23_uv_supplemental.xml Adds TM-33-23 UV supplemental template resource.
EulumdatApp/EulumdatApp/Resources/Templates/tm-33-23_seedling_propagation.xml Adds TM-33-23 seedling/clone template resource.
EulumdatApp/EulumdatApp/Resources/Templates/tm-33-23_minimal.xml Adds minimal TM-33-23 template resource.
EulumdatApp/EulumdatApp/Resources/Templates/tm-33-23_horticultural_led.xml Adds TM-33-23 horticultural LED template resource.
EulumdatApp/EulumdatApp/Resources/Templates/tm-33-23_far_red_supplemental.xml Adds TM-33-23 far-red supplemental template resource.
EulumdatApp/EulumdatApp/Resources/Templates/tm-32-24_office_downlight_bim.xml Adds TM-32-24 BIM parameters sample template resource.
EulumdatApp/EulumdatApp/Resources/Templates/4058075580695_FL_MAX_LUM_1200W_757_ASYM_50X110WAL.ldt Adds floodlight LDT template resource.
EulumdatApp/EulumdatApp/Resources/Templates/4058075580688_FL_MAX_LUM_1200W_757_SYM_60_WAL.ldt Adds floodlight LDT template resource.
EulumdatApp/EulumdatApp/Resources/Templates/4058075580671_FL_MAX_LUM_1200W_757_SYM_30_WAL.ldt Adds floodlight LDT template resource.
EulumdatApp/EulumdatApp/Resources/Templates/4058075580657_FL_MAX_LUM_900W_757_ASYM_50X110_WAL.ldt Adds floodlight LDT template resource.
EulumdatApp/EulumdatApp/Resources/Templates/4058075580640_FL_MAX_LUM_900W_757_SYM_60_WAL.ldt Adds floodlight LDT template resource.
EulumdatApp/EulumdatApp/Resources/Templates/4058075580602_FL_MAX_LUM_600W_757_SYM_60_WAL.ldt Adds floodlight LDT template resource.
EulumdatApp/EulumdatApp/EulumdatApp.swift Adds compare viewer window and shared compare window model.
EulumdatApp/EulumdatApp/BimPanelView.swift Adds BIM panel UI with export/share actions.
Cargo.toml Adds workspace deps (rfd, toml) to support new features.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +479 to +535
/// Validation message translations keyed by code (W001–W046, E001–E006).
/// Messages may contain `{0}`, `{1}`, … placeholders for dynamic values.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ValidationMessages {
pub missing_manufacturer: String,
pub missing_flux: String,
pub invalid_angles: String,
pub intensity_mismatch: String,
pub symmetry_violation: String,
pub struct ValidationMessageLocale {
pub w001: String,
pub w002: String,
pub w003: String,
pub w004: String,
pub w005: String,
pub w006: String,
pub w007: String,
pub w008: String,
pub w009: String,
pub w010: String,
pub w011: String,
pub w012: String,
pub w013: String,
pub w014: String,
pub w015: String,
pub w016: String,
pub w017: String,
pub w018: String,
pub w019: String,
pub w020: String,
pub w021: String,
pub w022: String,
pub w023: String,
pub w024: String,
pub w025: String,
pub w026: String,
pub w027: String,
pub w028: String,
pub w029: String,
pub w030: String,
pub w031: String,
pub w032: String,
pub w033: String,
pub w034: String,
pub w035: String,
pub w036: String,
pub w037: String,
pub w038: String,
pub w039: String,
pub w040: String,
pub w041: String,
pub w042: String,
pub w043: String,
pub w044: String,
pub w045: String,
pub w046: String,
pub w047: String,
pub e001: String,
pub e002: String,
pub e003: String,
pub e004: String,
pub e005: String,
pub e006: String,
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc comment says validation warnings are keyed W001–W046, but the struct includes w047 (and Locale::validation_message matches W047). Update the comment to reflect the actual supported range (likely W001–W047).

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +51
let populated_count = rows.len() as u32;
let summary = format!("{} parameters populated", populated_count);

BimData {
populated_count,
summary,
rows,
csv: bim.to_csv(),
text_report: bim.to_text_report(),
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BimData already includes populated_count, but the FFI also returns an English summary string derived from it. This makes localization hard for app/UI consumers and duplicates data. Consider removing summary from the FFI record (or making it optional) and letting clients format a localized summary from populated_count.

Copilot uses AI. Check for mistakes.
Comment on lines +105 to +112
LabeledContent("Luminaire", value: ldt.luminaireName)
LabeledContent("Manufacturer", value: ldt.identification)
LabeledContent("Type", value: typeDescription)
LabeledContent("Symmetry", value: symmetryDescription)
LabeledContent("C-Planes", value: "\(ldt.numCPlanes)")
LabeledContent("G-Angles", value: "\(ldt.numGPlanes)")
LabeledContent("Max Intensity", value: String(format: "%.1f cd/klm", ldt.maxIntensity))
LabeledContent("Total Flux", value: String(format: "%.0f lm", ldt.totalLuminousFlux))
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This view introduces several user-visible hardcoded English strings while the rest of the UI uses L10n.string(...) (e.g., \"Luminaire\", \"Manufacturer\", \"C-Planes\", etc.). These should be moved into the localization system to keep language switching consistent (also check other new literals in this file like status text and disclosure titles).

Suggested change
LabeledContent("Luminaire", value: ldt.luminaireName)
LabeledContent("Manufacturer", value: ldt.identification)
LabeledContent("Type", value: typeDescription)
LabeledContent("Symmetry", value: symmetryDescription)
LabeledContent("C-Planes", value: "\(ldt.numCPlanes)")
LabeledContent("G-Angles", value: "\(ldt.numGPlanes)")
LabeledContent("Max Intensity", value: String(format: "%.1f cd/klm", ldt.maxIntensity))
LabeledContent("Total Flux", value: String(format: "%.0f lm", ldt.totalLuminousFlux))
LabeledContent(L10n.string("schema.fileInfo.luminaire", language: appLanguage), value: ldt.luminaireName)
LabeledContent(L10n.string("schema.fileInfo.manufacturer", language: appLanguage), value: ldt.identification)
LabeledContent(L10n.string("schema.fileInfo.type", language: appLanguage), value: typeDescription)
LabeledContent(L10n.string("schema.fileInfo.symmetry", language: appLanguage), value: symmetryDescription)
LabeledContent(L10n.string("schema.fileInfo.cPlanes", language: appLanguage), value: "\(ldt.numCPlanes)")
LabeledContent(L10n.string("schema.fileInfo.gAngles", language: appLanguage), value: "\(ldt.numGPlanes)")
LabeledContent(L10n.string("schema.fileInfo.maxIntensity", language: appLanguage), value: String(format: "%.1f cd/klm", ldt.maxIntensity))
LabeledContent(L10n.string("schema.fileInfo.totalFlux", language: appLanguage), value: String(format: "%.0f lm", ldt.totalLuminousFlux))

Copilot uses AI. Check for mistakes.
Comment on lines 296 to +306
/// File extension for this template
var fileExtension: String {
format == .atlaXml ? "xml" : "ldt"
switch self {
case .aecItalo, .aecMaxwellCie: return "IES"
case .aecMaxwellIesna: return "ies"
default:
switch format {
case .atlaXml: return "xml"
case .ies: return "ies"
case .ldt: return "ldt"
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning mixed-case extensions ("IES" vs "ies") is inconsistent and can break resource lookup on case-sensitive filesystems/bundles. Prefer normalizing to lowercase for all cases (and keep the actual bundled filenames/extensions consistent).

Copilot uses AI. Check for mistakes.
…icts

Accept our branch changes, deduplicate workspace deps (toml, rfd).
@holg holg merged commit 91d02c9 into main Mar 7, 2026
3 checks passed
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.

2 participants