Skip to content

Phase 3.4 PR3: Centralize Constants#41

Merged
AccessiT3ch merged 2 commits intostaging/phase3from
refactor/phase3.4-pr3-constants
Feb 3, 2026
Merged

Phase 3.4 PR3: Centralize Constants#41
AccessiT3ch merged 2 commits intostaging/phase3from
refactor/phase3.4-pr3-constants

Conversation

@AccessiT3ch
Copy link
Copy Markdown
Contributor

Summary

Centralizes theme colors, external URLs, app metadata, PWA config, and analytics placeholders into a single configuration file.

Changes

  • Created src/config/constants.js with centralized constants
  • Updated vite.config.js to import and use constants for PWA manifest
  • Updated src/config/index.js to re-export all constants
  • Updated Footer.jsx to use GitHub URL constants
  • Updated Share.jsx to use color constants
  • Updated SCSS variables with documentation comments
  • Updated HTML files with documentation comments (values remain inline)
  • Updated PWA tests to verify constant usage

Testing

✅ All 239 tests passing
✅ No breaking changes
✅ Full backward compatibility maintained

Configuration Structure

{
  theme: { colors: { primary, secondary } },
  urls: { external: { ilrc, informedImmigrant, github }, internal: { base } },
  app: { name, shortName, description, version, copyright, lang },
  pwa: { display, startUrl, scope },
  analytics: { GA_MEASUREMENT_ID: null }
}

Part of Phase 3.4: Centralize Configuration Data (PR 3 of 4)

- 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.
Copy link
Copy Markdown
Contributor

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

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.

Comment thread src/scss/variables.scss Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AccessiT3ch AccessiT3ch merged commit 7d5dab2 into staging/phase3 Feb 3, 2026
1 check passed
@AccessiT3ch AccessiT3ch deleted the refactor/phase3.4-pr3-constants branch February 3, 2026 00:58
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