← Back to Pull requests

refactor(app): audit element properties and strip irrelevant controls on map elements #57

Closed
unknown closed this pull request without merging on Oct 19, 2026 13:39 UTC
View on GitHub
unknown unknown commented on Oct 13, 2026 21:35 UTC
Author

Summary


Audits element properties for course maps across the UI, template schema, and chart renderer, addressing the course maps audit sub-item in TODOS.md:

1. UI restrictions (ElementProperties.svelte):
- Restricts Fill (color and opacity) to scalar metric plots (elevation, speed, power, etc.) and hides it when item.value === 'course', because GPS route lines have no area under curve.
- Restricts Point Label (show value at marker, font, size, italic, units, decimal rounding) to scalar metric plots and hides it for course maps.
- Updates setAllColors so basic-mode bulk color updates do not inject unused fill or point_label color patches into course map element configs.
- Switching an element's metric to course leaves existing fill and point_label keys in the config untouched; they are hidden in the UI and come back if the metric is switched away from course.
2. Template schema & deserialization (template.rs):
- Added PlotConfig::is_course(), PlotConfig::effective_fill(), and PlotConfig::effective_point_label(). fill_opacity() and fill_color() delegate to effective_fill(), returning None for course plots.
- Saved configs are never stripped: fill and point_label stay in the JSON, and the renderer ignores them for course plots via the effective_* accessors (hide in UI + ignore at render).
3. Renderer alignment (chart.rs):
- ChartCache::build loads effective_point_label(), skipping font loading for course maps.
- render_chart_background skips fill drawing for course maps via effective_fill() and ColorBy::color_fill(is_course), ensuring route paths are rendered cleanly without baseline artifacts.
4. Task tracking (TODOS.md):
- Split the Element properties audit item into a completed sub-bullet for course maps, keeping the remaining audit tasks open for subsequent element types.

Verification


  • Unit tests: Added Rust tests in template.rs (course_plots_ignore_fill_and_point_label) and chart.rs (course_chart_ignores_fill_and_point_label).

  • pnpm --dir app lint: clean with 0 errors.

  • pnpm --dir app vite-build: builds successfully in 7.3s.
  • Diff: 264 lines (+198 / -66) across 3 files Reviewer: FrancescoCastaldi Review duration: 8163m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 264 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.334
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #57"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.3% (MEDIUM) · Higher = larger blast radius
    39.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 15.5% · Safe to merge
    15.5%