Skip to content

Replace crib position input with interactive slider modal#124

Merged
samdaw13 merged 1 commit intomainfrom
fix/crib-position-index
Mar 12, 2026
Merged

Replace crib position input with interactive slider modal#124
samdaw13 merged 1 commit intomainfrom
fix/crib-position-index

Conversation

@samdaw13
Copy link
Copy Markdown
Owner

Summary

  • Replace the plain number TextInput for crib position with a new CribPositionModal that lets users visually slide the crib along the ciphertext using arrow buttons
  • Modal highlights conflicting positions in red (where a letter would encrypt to itself, an Enigma impossibility) and disables the Confirm button when invalid
  • Centralize page padding in the Page template component — removes per-page paddingVertical overrides so all screens get consistent padding: 16 from a single source
  • Add findConflictIndices helper to crib-analysis.tsx for detecting letter-to-self conflicts at a given position

Test plan

  • npm run lint passes (0 errors)
  • npm test passes (149 tests)
  • Open Break Cipher, enter ciphertext + crib, tap position button, verify modal opens
  • Verify arrows navigate positions, conflicts show red, confirm is disabled on conflict
  • Verify confirm stores position (1-indexed on button label), clear resets to undefined
  • Verify all screens still have correct padding after Page refactor

🤖 Generated with Claude Code

Replace the plain number TextInput for crib position with a CribPositionModal
that lets users visually slide the crib along the ciphertext. The modal shows
ciphertext and crib letters in aligned rows, highlights conflicts in red
(where a letter would encrypt to itself), and disables confirm when invalid.

Also centralizes page padding in the Page template component so all screens
get consistent padding from a single source.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@samdaw13 samdaw13 merged commit 12ae061 into main Mar 12, 2026
2 checks passed
@samdaw13 samdaw13 deleted the fix/crib-position-index branch March 12, 2026 19:07
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