Skip to content

Refactor various modules for clarity, type safety, and documentation - #51

Merged
kbtale merged 7 commits into
masterfrom
refactor/code-clarity-and-naming
Sep 6, 2026
Merged

Refactor various modules for clarity, type safety, and documentation#51
kbtale merged 7 commits into
masterfrom
refactor/code-clarity-and-naming

Conversation

@kbtale

@kbtale kbtale commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

Refactor core logic modules and state management to eliminate cryptic variable names, replace magic numbers with derived constants, make bitwise operations self-documenting, and unify storage key conventions across the application.

Changes included:

  • Chronometry: Clarified Conway algorithm variables (a, b, c, anchor, diff) and added WeekdayIndex type.
  • Storage Units: Migrated from stringified indices to type-safe StorageUnitSymbol and added convertStorageBySymbol.
  • Color Theory: Replaced magic number 442 with MAX_RGB_COLOR_DISTANCE constant and added calculateColorScore helper.
  • Subnetting: Made 32-bit unsigned bitwise math explicit with toUint32 and exported ipToUint32 / uint32ToIp.
  • Luhn Algorithm: Improved loop variable clarity (processedDigit, checksumTotal, shouldDoubleCurrentDigit) and extracted digit doubling helper.
  • Storage Service: Unified storage keys under polymath_ prefixes with legacy key fallback and typed date format events.

Type of Change

  • Bug fix
  • New feature
  • Refactoring
  • Performance improvement
  • Accessibility improvement
  • Documentation update

Checklist

  • npm run check passes (Biome lint & format)
  • npm run test passes (all unit tests)
  • npm run build passes (TypeScript strict mode)
  • New i18n keys added to all 3 locales (en, es, it)
  • No inline styles added (use SCSS modules)

@kbtale
kbtale merged commit 01ddbc0 into master Sep 6, 2026
1 check passed
@kbtale
kbtale deleted the refactor/code-clarity-and-naming branch September 6, 2026 00:19
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.

1 participant