Skip to content

refactor: extract codebreaking into standalone module - #102

Merged
samdaw13 merged 1 commit into
mainfrom
refactor/codebreaking-module
Mar 9, 2026
Merged

samdaw13 merged 1 commit into
mainfrom
refactor/codebreaking-module

Conversation

@samdaw13

@samdaw13 samdaw13 commented Mar 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Move src/utils/codebreaking.tsx to src/codebreaking/ as its own top-level module, split into three focused files: enigma-int.tsx (integer-path primitives), crib-analysis.tsx (crib positions, menu graphs, BFS propagation), and crib-search.tsx (search orchestrator)
  • Extract named functions from the 285-line cribSearchAsync (buildSearchContext, computeAllRotorPositions, precomputeScramblerLookups, testCribPosition, collectResult) and DRY up repeated MOD26 rotor pass pattern into rotorPassForward/rotorPassInverse
  • Add result pagination to the Break Cipher UI so users can browse all results across pages

Test plan

  • All 121 existing tests pass (23 suites)
  • Verify Break Cipher search produces results and pagination controls appear with >10 results
  • Verify page navigation (previous/next) works correctly

🤖 Generated with Claude Code

…results

Move codebreaking logic out of utils/ into its own top-level src/codebreaking/
module, split into focused files (enigma-int, crib-analysis, crib-search),
extract named functions from large blocks, DRY up repeated patterns, and add
result pagination to the Break Cipher UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@samdaw13
samdaw13 enabled auto-merge March 9, 2026 14:50
@samdaw13
samdaw13 merged commit c7ae8e5 into main Mar 9, 2026
2 checks passed
@samdaw13
samdaw13 deleted the refactor/codebreaking-module branch March 9, 2026 14:51
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