Phase 3.4 PR3: Centralize Constants#41
Merged
AccessiT3ch merged 2 commits intostaging/phase3from Feb 3, 2026
Merged
Conversation
- Created src/config/constants.js with centralized configuration: - theme.colors: primary (#FFFFFF), secondary (#B11111) - urls.external: ILRC, Informed Immigrant, GitHub repo links - app: name, shortName, description, version, copyright, lang - pwa: display, startUrl, scope - analytics.GA_MEASUREMENT_ID: null (placeholder for future) - Updated vite.config.js: - Import constants from src/config/constants.js - Use app.name, theme.colors.secondary, etc. in manifest config - Replaced all hardcoded values with constant references - Updated src/config/index.js: - Import and re-export all constants for centralized access - Destructure named exports for convenience - Updated src/Components/Footer/Footer.jsx: - Import urls and app from config - Use urls.external.github for all GitHub links - Use app.copyright instead of hardcoded string - Updated src/Components/Share/Shar- Updated src/Components/Share/Shar- Updated src/Components/Share/Shar- Updated src/Components/Share/Shar- Updated ct lookup - Updated src/scss/variables.scss: - Add comment referen - Add comment referen - Add comment referen - Add cmain in SCSS for Bootstrap integration - Updated index.html and public/offline.html: - Add comments referencing constants.js for theme colors - Static HTML cannot import JS, so values stay inline - Updated src/pwa.test.js- Updated src/pwa.test.jst- Updated src/pwa.test.js- Updated src/pwa.test.fi- Updamports and uses constants correctly All 239 tests passing. No breaking changes.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes application constants including theme colors, URLs, app metadata, PWA configuration, and analytics placeholders into a single configuration file (src/config/constants.js). The changes improve maintainability by eliminating magic strings and providing a single source of truth for configuration values.
Changes:
- Created centralized constants configuration with theme colors, external/internal URLs, app metadata, PWA settings, and analytics placeholders
- Updated vite.config.js to use constants for PWA manifest configuration
- Refactored Footer.jsx to use centralized GitHub URL and copyright constants
- Updated tests to verify constant usage rather than hardcoded values
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/config/constants.js | New file containing centralized constants for theme colors, URLs, app metadata, PWA config, and analytics |
| vite.config.js | Updated PWA manifest to import and use constants for app name, colors, display settings, etc. |
| src/config/index.js | Added re-exports of all constants for convenient barrel import pattern |
| src/Components/Footer/Footer.jsx | Updated to use GitHub URL and copyright constants from centralized config |
| src/Components/Share/Share.jsx | Extracted hardcoded Bootstrap alert colors to named local constants for better maintainability |
| src/scss/variables.scss | Added documentation comments linking SCSS color values to constants.js |
| index.html | Added documentation comments indicating theme color synchronization with constants.js |
| public/offline.html | Added documentation comment for theme color synchronization |
| src/pwa.test.js | Updated tests to verify constant usage in vite.config.js instead of checking hardcoded values |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Summary
Centralizes theme colors, external URLs, app metadata, PWA config, and analytics placeholders into a single configuration file.
Changes
src/config/constants.jswith centralized constantsvite.config.jsto import and use constants for PWA manifestsrc/config/index.jsto re-export all constantsFooter.jsxto use GitHub URL constantsShare.jsxto use color constantsTesting
✅ All 239 tests passing
✅ No breaking changes
✅ Full backward compatibility maintained
Configuration Structure
Part of Phase 3.4: Centralize Configuration Data (PR 3 of 4)