Skip to content

feat: add user notification system for manifest version mismatch#30

Merged
PaulHax merged 5 commits intomainfrom
fix-ps
Jul 22, 2025
Merged

feat: add user notification system for manifest version mismatch#30
PaulHax merged 5 commits intomainfrom
fix-ps

Conversation

@PaulHax
Copy link
Collaborator

@PaulHax PaulHax commented Jul 22, 2025

Summary

  • Add user-facing notification system to replace console warnings when URL parameters are from different manifest versions
  • Fix critical KDMA parsing bug for personal_safety and other underscore-containing KDMA names
  • Replace http.server with waitress to eliminate BrokenPipeError issues
  • Reduce verbose console output during build and server startup

Key Changes

User Notification System

  • Implement toast-style notifications that slide down from top of page and auto-dismiss after 4 seconds
  • Replace console warning with user-friendly message: "URL parameters are from an older version and have been reset"
  • Created notifications.js: Standalone notification system with queue management and animations
  • Updated state.js: Import notification module and replace console.warn with user notification
  • Enhanced style.css: Added notification styling with slide animations and color schemes

KDMA Parsing Fix

  • Fixed critical bug where personal_safety-0.0 was incorrectly parsed as personal and safety KDMAs
  • Updated parse_alignment_target_id() to handle single-value KDMAs with underscores properly
  • Added comprehensive test coverage for KDMA parsing edge cases
  • Now correctly handles both personal_safety-0.0 and ADEPT-June2025-personal_safety-0.0 formats

Infrastructure Improvements

  • Replace http.server with waitress for better stability and error handling
  • Reduce verbose console output during build process for cleaner logs
  • Add proper WSGI application for static file serving

Test plan

  • Load page with URL parameters from different manifest version
  • Verify notification appears at top of page with warning styling
  • Confirm notification auto-dismisses after 4 seconds
  • Test personal_safety KDMA experiments load correctly
  • Verify server starts without BrokenPipeError issues
  • Ensure no console errors in browser

Closes #29

PaulHax added 5 commits July 22, 2025 15:27
Replaces Python's SimpleHTTPRequestHandler with waitress WSGI server
to prevent broken pipe errors when browsers close connections early.
- Modify parse_alignment_target_id to handle single KDMA names containing underscores
- Add comprehensive test coverage for KDMA parsing edge cases
- Apply ruff formatting to build.py
Replace console warnings with user-visible notifications when URL parameters
are from different manifest versions. Implements toast-style notifications
that auto-dismiss after 4 seconds.

Closes #29
Replace hardcoded file list with automatic file discovery. Copy all static
files except Python files, ensuring new files like notifications.js are
included in production builds without manual updates.

Remove try-catch blocks - file copy failures should be fatal errors.
@PaulHax PaulHax merged commit d6dd5a1 into main Jul 22, 2025
8 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.

Add user notification for manifest version mismatch

1 participant