Commit graph

84 commits

Author SHA1 Message Date
Claude Code
f12142b63f Fix theme flash between pages (FOUC)
- Add inline script to apply theme immediately in head
- Prevents flash of light mode before auto/dark theme applies
- Script runs before DOM parsing to avoid visual flicker
- Applied to all pages: index, admin, and privacy

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 19:27:16 -04:00
Claude Code
008201aa84 Fix dark mode auto theme detection
- Add CSS media query for prefers-color-scheme detection
- Auto theme now properly follows system dark/light preference
- Maintains 3-mode cycle: auto → light → dark → auto
- Rebuilds CSS with proper @media rules for [data-theme="auto"]

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 19:25:49 -04:00
Claude Code
a0fffcf4f0 Refactor architecture: Add models/services layer and refactor frontend
Major architectural improvements:
- Created models/services layer for better separation of concerns
  - Location model with async methods for database operations
  - ProfanityWord model for content moderation
  - DatabaseService for centralized database management
  - ProfanityFilterService refactored to use models
- Refactored frontend map implementations to share common code
  - MapBase class extracts 60-70% of duplicate functionality
  - Refactored implementations extend MapBase for specific features
  - Maintained unique geocoding capabilities per implementation
- Updated server.js to use new service architecture
- All routes now use async/await with models instead of raw queries
- Enhanced error handling and maintainability

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-05 19:21:51 -04:00
Deco Vander
6c90430ff6 Merge pull request #6 from derekslenk/feature/css-optimization
CSS Optimization and Styling Improvements
2025-07-05 18:28:31 -04:00
Deco Vander
ebee173f2c Refactor privacy page styles: eliminate duplication and !important
- Create shared back-link-styles mixin in _mixins.scss for reusable button component
- Remove all duplicate back-link styling from .privacy-content .back-link and a.back-link
- Eliminate 15+ instances of !important declarations throughout privacy styles
- Use proper SCSS variables instead of hardcoded values for consistent spacing
- Add focus state to back-link mixin for accessibility compliance
- Use existing card mixin and flex-center mixin for consistent styling
- Replace hardcoded colors with CSS custom properties for theme compatibility

Benefits:
- DRY principle: One mixin defines all back-link styles
- Better maintainability: Changes in one place affect all instances
- Improved accessibility: Focus states for keyboard navigation
- Cleaner CSS: No !important declarations needed
- Theme consistency: Uses proper color variables
2025-07-04 15:03:52 -04:00
Deco Vander
8d1d62288a Remove CSS source map from version control
- Remove public/style.css.map from git tracking with git rm --cached
- CSS source maps are generated artifacts like the CSS file itself
- Already excluded in .gitignore but was previously tracked
- Keeps local file for development debugging but excludes from repo
2025-07-04 14:51:36 -04:00
Deco Vander
0953f9210e Add focus state to button mixin for accessibility
- Add :focus pseudo-class to button mixin with outline styling
- Improves keyboard navigation accessibility for all buttons
- Uses currentColor for outline to adapt to different button styles
- Meets WCAG accessibility standards for focus visibility
- Update CSS source map after rebuild
2025-07-04 14:50:14 -04:00
Deco Vander
4f6b158022 Remove !important from table styles and improve selector specificity
- Remove all !important declarations from table cell styles in _index.scss
- Increase selector specificity by changing .location-cell to td.location-cell
- Change .details-cell to td.details-cell, .time-cell to td.time-cell, etc.
- This eliminates the need for !important while maintaining proper cascade order
- Follows CSS best practices for maintainable and readable stylesheets
2025-07-04 14:46:32 -04:00
Deco Vander
9716fe9f1d Configure CSS as generated asset, not committed to git
- Added public/style.css to .gitignore
- Removed style.css from git tracking (git rm --cached)
- Enhanced package.json scripts for better CSS workflow:
  - postinstall: Auto-builds CSS on npm install
  - build-css:dev: Development build with source maps
  - start: Now builds CSS before starting server
  - dev: Builds CSS before development mode
- Updated README with CSS development documentation
- Explains SCSS organization and build process
- Documents all CSS-related npm scripts

Benefits:
 Cleaner repository (no generated files)
 Prevents merge conflicts in generated CSS
 Automatic CSS generation on new machine setup
 Source of truth is SCSS files only
 Consistent build process across environments
2025-07-04 14:43:52 -04:00
Deco Vander
23a06a5e84 Refactor privacy.html inline styles to modular SCSS
- Created src/scss/pages/_privacy.scss with all privacy page styles
- Moved all inline styles from privacy.html to proper CSS classes
- Replaced inline style attributes with semantic CSS classes:
  - privacy-header__title-wrapper for header positioning
  - privacy-header__title-content for centered title content
  - privacy-header__theme-toggle for theme toggle button
- Maintained all existing functionality and styling
- Improved maintainability and consistency with SCSS architecture
- All styles now use CSS variables for theme compatibility
2025-07-04 14:41:28 -04:00
Deco Vander
aace06bb11 Update src/scss/pages/_index.scss
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 14:38:56 -04:00
Deco Vander
9628da957b Resolve merge conflicts between feature/css-optimization and main
- Resolved conflicts in admin.html to keep CSS optimization changes
- Regenerated package-lock.json after merge
- All features from both branches are now integrated
2025-07-04 14:28:50 -04:00
Deco Vander
27c9d3da00 Merge pull request #5 from derekslenk/feature/profanity-filter-isolation
Profanity Filter Database Isolation & Timezone Fixes
2025-07-04 14:21:12 -04:00
Deco Vander
cda35b1741 Update profanity-filter.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 14:17:49 -04:00
Deco Vander
fd60ff56bd Update profanity-filter.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 14:07:51 -04:00
Deco Vander
240f56b49d Update tests/routes.test.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 14:07:42 -04:00
Deco Vander
4fdaa4f7da Update profanity-filter.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 14:03:14 -04:00
Deco Vander
6be1dc4667 Update server.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 14:03:07 -04:00
Deco Vander
4dd48627d0 mplement proper async initialization for ProfanityFilter
- Add async initialize() method for reliable initialization waiting
- Add static create() factory method for easy async creation
- Add initialization state tracking with isInitialized flag
- Add warning system for methods called before full initialization
- Update server.js to use proper async initialization pattern
- Maintain backward compatibility with constructor-only usage
- Add accessibility improvement for reduced motion preferences in CSS

Fixes the race condition issue where consumers relied on arbitrary
timeouts instead of properly waiting for async initialization to complete.
2025-07-04 13:59:57 -04:00
Deco Vander
542415cccd Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 13:30:45 -04:00
Deco Vander
b1073ce7b8 Fix critical security risk: implement complete fallback profanity filter
- Add comprehensive no-op fallback profanity filter with all required methods
- Prevent runtime errors when profanity filter initialization fails
- Add startup logging to clearly indicate profanity filter status
- Include _isFallback property for monitoring and debugging
- Ensure all routes continue to function even with fallback filter
- Maintain security awareness with clear warning messages
2025-07-04 13:25:25 -04:00
Deco Vander
a063d5a2c9 Create shared utility module to eliminate function duplication
- Create public/utils.js with shared frontend utility functions
- Extract parseUTCDate, getTimeAgo, getTimeRemaining, getRemainingClass to utils.js
- Remove duplicate functions from admin.js, app-mapbox.js, app-google.js, and app.js
- Add utils.js script import to index.html and admin.html
- Add comprehensive JSDoc documentation for all utility functions
- Ensure consistent UTC timestamp parsing across all frontend scripts

This addresses Copilot AI feedback about function duplication across multiple frontend scripts.
Now all timestamp and time calculation logic is centralized in one maintainable module.

Benefits:
- Single source of truth for time-related utilities
- Easier maintenance and updates
- Consistent behavior across all frontend components
- Better code organization and documentation
- Reduced bundle size through deduplication
2025-07-04 13:22:17 -04:00
Deco Vander
c0dc1f3c6d Fix critical error handling for ProfanityFilter initialization
- Add proper error handling to prevent undefined profanityFilter from being passed to routes
- Implement fallback no-op profanity filter strategy when initialization fails
- Add validation check before setupRoutes() to ensure profanityFilter is defined
- Provide clear error messages and security warnings when fallback is used
- Update graceful shutdown to safely handle both real and fallback profanity filters

Fallback profanity filter:
- Allows all content to pass through (security risk but prevents crash)
- Provides proper method signatures for API compatibility
- Logs prominent security warnings about disabled filtering
- Returns appropriate error messages for admin operations

This prevents runtime errors while maintaining service availability, with clear warnings about the security implications.
2025-07-04 13:16:33 -04:00
Deco Vander
45a8d67362 Refactor: Extract UTC parsing logic to parseUTCDate helper function
- Add parseUTCDate helper function to handle timestamp UTC parsing consistently
- Eliminates code duplication across getTimeAgo, getTimeRemaining, and expiry functions
- Applied to admin.js, app-mapbox.js, app-google.js, and app.js
- Ensures consistent UTC timezone handling throughout all frontend JavaScript
- Addresses Copilot AI feedback for better code maintainability and DRY principles

The parseUTCDate function handles the logic:
timestamp.includes('T') ? timestamp : timestamp + 'Z'

This ensures all timestamp parsing uses the same UTC interpretation logic.
2025-07-04 13:16:33 -04:00
Deco Vander
544766e5dc Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 13:13:52 -04:00
Deco Vander
6d745e23f6 Fix back button text color by excluding it from general link styles
- Use :not(.back-link) selector to exclude back button from general link styling
- Add more specific CSS selectors for back-link to increase specificity
- Use both .privacy-content .back-link and a.back-link selectors
- Ensure white text color overrides the blue link color from general rules
- Prevent general link styling from interfering with button appearance
2025-07-04 13:06:39 -04:00
Deco Vander
25149e4f5f Fix back button styling by removing duplicate CSS rules
- Remove conflicting .back-link CSS rule that used undefined variables
- Consolidate all back-link styling into single comprehensive rule
- Add all necessary properties with !important to override conflicts
- Include display, margin, padding, border-radius for proper button appearance
- Ensure white text color on blue background for proper contrast
- Add font-weight and transition for better visual presentation
2025-07-04 13:04:03 -04:00
Deco Vander
4aa1e6e7da Fix back button text color for proper contrast
- Change back-link text color from blue to white for readability
- Remove text-decoration underline for cleaner button appearance
- Ensure white text shows clearly on blue button background
- Maintain white text color on hover for consistency
- Improve accessibility with proper color contrast ratio
2025-07-04 13:02:56 -04:00
Deco Vander
c573ffb8bb Improve link visibility and styling on privacy policy page
- Add explicit link styling with proper color variables for readability
- Use !important declarations to override any conflicting inline styles
- Style all links in privacy-content and contact-info sections
- Add font-weight: 500 for better link visibility
- Fix back-link button with proper primary color styling
- Add CSS variables for primary colors in both light and dark themes
- Ensure links maintain proper contrast in both theme modes
2025-07-04 13:02:04 -04:00
Deco Vander
47984b2f48 Fix privacy page header alignment issue
- Change flexbox layout to relative positioning for header container
- Position theme toggle as absolute overlay in top-right corner
- Keep title and subtitle centered without interference from theme button
- Effective date now properly aligns with centered title text
- Theme toggle no longer displaces header text horizontally
2025-07-04 13:00:06 -04:00
Deco Vander
7a35732687 Fix header layout on main page to keep theme toggle right-aligned
- Add proper flexbox styling for .header-content to space items correctly
- Style .header-text with flex: 1 to take available space on left
- Position theme toggle button on the right side of header row
- Add responsive mobile layout that stacks header vertically
- Center header text and theme toggle on mobile devices
- Maintain proper spacing and visual hierarchy at all screen sizes
2025-07-04 12:58:20 -04:00
Deco Vander
7a41227345 Increase font sizes across entire site for better readability
- Increase all typography scale by 2px for improved accessibility
- xs: 10px → 12px, sm: 12px → 14px, md: 14px → 16px
- lg: 16px → 18px, xl: 18px → 20px, xxl: 24px → 28px
- Set base body font-size to medium (16px) for default text
- All form inputs, buttons, tables, and content now more readable
- Maintains responsive design but with larger, more accessible text
2025-07-04 12:56:25 -04:00
Deco Vander
c88f625485 Improve footer typography and alignment
- Increase footer font size from small to medium for better readability
- Ensure all footer text is properly centered including disclaimer
- Add explicit text-align: center and display: block for disclaimer small text
- Maintain responsive design with smaller font on mobile but still readable
- Update mobile disclaimer font size to small instead of extra small
2025-07-04 12:55:16 -04:00
Deco Vander
dbf7b8e282 Fix missing card styling for reports section and add shared footer
- Add card styling to map-section with proper spacing and visual hierarchy
- Add reports-header with flexbox layout for title and view toggle buttons
- Add styling for view-toggle buttons, map-info, and table-controls
- Create shared footer component with consistent styling across pages
- Add footer to admin.html and privacy.html for consistency
- Add missing CSS variables for links, secondary text, and font-size-xs
- Ensure footer uses proper theme colors for light/dark modes
- Restore visual box around Current Reports section on main page
2025-07-04 12:54:00 -04:00
Deco Vander
2fd9475f5d Fix CSS compilation by adding missing styles and variables
## Critical CSS Fixes
-  Added missing index page styles (_index.scss) for main application
-  Restored original CSS variables and color scheme compatibility
-  Added comprehensive reports-table styles with proper cell formatting
-  Fixed theme variables to match original design (updated colors)
-  Added missing form, button, and layout components

## Enhanced Styles
-  Proper table cell styling (.location-cell, .details-cell, .time-cell, .remaining-cell)
-  Status indicators for urgent/warning/normal time remaining
-  Enhanced responsive design for mobile tables
-  Form and input styling consistency
-  Theme toggle and header components
-  Error/success message styling

## Architecture Improvements
-  Modular imports: admin styles + index styles + shared components
-  Better CSS variable organization with light/dark theme support
-  Maintained backward compatibility with existing classes
-  Compressed CSS output for production performance

The application now has full styling coverage with the new SCSS architecture.
2025-07-04 11:34:11 -04:00
Deco Vander
f83e087541 Optimize CSS architecture with SCSS modular system
## Major CSS/SCSS Improvements
-  Set up modular SCSS architecture with variables, mixins, and components
-  Created organized directory structure: src/scss/ with variables, mixins, pages/
-  Removed ~300+ lines of inline CSS from admin.html
-  Added comprehensive design system with consistent spacing, colors, typography
-  Created reusable mixins for buttons, cards, tables, forms, and layouts
-  Implemented responsive breakpoint mixins for mobile/tablet/desktop
-  Added utility classes for common layouts and spacing

## Build System
-  Added sass and concurrently as dev dependencies
-  Created npm scripts: build-css, watch-css, dev-with-css
-  Automated SCSS compilation to compressed CSS
-  Set up development workflow with CSS watching

## Admin Panel Enhancements
-  Added complete tab navigation system (Location Reports + Profanity Filter)
-  Integrated profanity management UI with forms and tables
-  Consistent styling across all components using SCSS mixins
-  Improved responsive design for mobile devices

## Benefits
- 🎯 Maintainable: All styles centralized in modular SCSS files
- 📱 Responsive: Better mobile experience with consistent breakpoints
- 🎨 Consistent: Design system ensures visual consistency
-  Efficient: Compressed CSS output, no inline styles
- 🔧 Developer-friendly: Easy to extend and modify styles

The application now has professional-grade CSS architecture that's easy to maintain and extend.
2025-07-04 11:30:34 -04:00
Deco Vander
3b4db2b8d1 Update README repository URLs from great-lakes-ice-report to ice
- Updated clone commands to use correct repository name
- Fixed deployment directory paths to /opt/ice
- Updated systemctl service names to 'ice' from 'great-lakes-ice-report'
- Ensures documentation matches actual repository structure
2025-07-04 11:20:25 -04:00
Deco Vander
58b6a13106 Fix timezone handling for accurate 48-hour expiry display
- Fixed getTimeAgo(), getTimeRemaining(), and getRemainingClass() functions
- Database stores UTC timestamps but frontend was treating them as local time
- Added logic to append 'Z' to timestamps without timezone info to force UTC interpretation
- Now properly shows 48-hour countdown instead of incorrect 52-hour or 28-hour values
- Affects both main app (app-mapbox.js) and admin panel (admin.js)
2025-07-04 11:16:18 -04:00
Deco Vander
276dc65195 Fix location expiry display to show correct 48-hour timeframe
- Updated getTimeRemaining() function to use 48 hours instead of 24 hours
- Updated getRemainingClass() function to calculate remaining time based on 48 hours
- Frontend now matches backend 48-hour expiration policy
- Time remaining display will now show up to ~47h instead of ~23h for new reports
2025-07-04 11:12:09 -04:00
Deco Vander
e32dfd849f Fix profanity filter admin UI API endpoints
- Corrected API endpoint URLs from /api/admin/profanity/words to /api/admin/profanity-words
- Fixed profanity test endpoint from /api/admin/profanity/test to /api/admin/test-profanity
- Updated data handling to match actual API response format
- Fixed profanity test results display to match API analysis structure
- All CRUD operations for profanity words now working correctly
2025-07-04 11:09:28 -04:00
Deco Vander
b8e1bc9aa8 Merge branch 'main' into feature/profanity-filter-isolation 2025-07-04 11:03:03 -04:00
Deco Vander
71ddcc9a5c Complete profanity filter UI integration
- Added tab-based admin interface with separate Profanity Filter tab
- Implemented custom word management (add/delete words with severity levels)
- Added profanity filter testing interface for real-time validation
- Integrated with profanity database API endpoints
- Added comprehensive CSS styling for new UI components
- Full admin interface for managing custom profanity words and categories
2025-07-04 00:07:03 -04:00
Deco Vander
c7f39e4939 feat: isolate profanity filter with separate database
- Create dedicated ProfanityFilter class with isolated SQLite database
- Separate profanity.db from main application database to prevent SQLITE_MISUSE errors
- Add comprehensive custom word management (CRUD operations)
- Implement advanced profanity detection with leetspeak and pattern matching
- Add admin UI for managing custom profanity words
- Add extensive test suites for both profanity filter and API routes
- Update server.js to use isolated profanity filter
- Add proper database initialization and cleanup methods
- Support in-memory databases for testing

Breaking changes:
- Profanity filter now uses separate database file
- Updated admin API endpoints for profanity management
- Enhanced profanity detection capabilities
2025-07-04 00:03:24 -04:00
Deco Vander
49be81e29b Merge pull request #4 from derekslenk/update-readme-urls-20250704-025536
Update deployment URLs in README
2025-07-03 22:56:18 -04:00
GitHub Action
41d658ddc1 Update deployment URLs
- Updated S3 URLs in README.md
    - Deploy script URL: https://ice-puremichigan-lol.s3.amazonaws.com/scripts/deploy.sh
2025-07-04 02:55:36 +00:00
Deco Vander
e44d363685 Merge pull request #3 from derekslenk/auto-readme
Update deploy scripts to create a PR
2025-07-03 22:55:22 -04:00
Deco Vander
d7afbe15f0 Merge branch 'main' into auto-readme 2025-07-03 22:54:38 -04:00
Deco Vander
d766f08338 Update deploy scripts to create a PR 2025-07-03 22:53:53 -04:00
Deco Vander
cf86727acd Merge pull request #2 from derekslenk/actions-contents-update
Update deploy-scripts.yml
2025-07-03 22:46:46 -04:00
Deco Vander
d6df2f9237 Update deploy-scripts.yml 2025-07-03 22:46:10 -04:00