Split the encryptor tool into per-tab modules - #217
Merged
404SecNotFound merged 1 commit intoSep 26, 2026
Merged
404SecNotFound merged 1 commit into
404SecNotFound merged 1 commit into
Conversation
encryptor-tool.tsx had grown to 6,459 lines. Move its code, unchanged, into src/components/encryptor/: shared.ts (types, constants, pure helpers), shared-ui.tsx (LockWarning, FileSelector, RevealableQr, InfoTip), use-encryptor-state.ts (the state and handlers more than one tab reads or writes, exposed through EncryptorContext), secret-form.tsx (the Encrypt and Decrypt tabs, which turn out to be one shared render function rather than two), workspace-tab.tsx, recovery-tab.tsx, shares-dialog.tsx and recovery-kit-dialog.tsx. encryptor-tool.tsx stays the entry point, now composing these modules; it drops to a few hundred lines of Tabs/header/footer chrome. No behaviour change: every string, id, data-testid, and handler moved rather than being rewritten.
404SecNotFound
merged commit Sep 26, 2026
742b7fa
into
claude/serene-carson-0739mv-padding
15 checks passed
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.
Stacked on the v4 PR, so the two-line format-label change there is already in the moved code. Refactor only: code moved, not rewritten. Every string, id,
data-testidand handler is where it was, in a new file.Layout
encryptor-tool.tsxencryptor/use-encryptor-state.tsencryptor/secret-form.tsxencryptor/shared.tsencryptor/shares-dialog.tsxencryptor/shared-ui.tsxencryptor/recovery-tab.tsxencryptor/recovery-kit-dialog.tsxencryptor/workspace-tab.tsxencryptor/context.tsxShared state stays in one hook rather than being duplicated per tab, which is why that file is the large one. Every lazy import of
keym-v2andkeym-v2-shamirstill goes throughloadKeym2/loadShamir;test:secret-erase-corescans for that.Gate
The Chromium suite, before and after, on the same tree: 304 passed, 5 skipped both times. Typecheck clean.
Negative control: one moved handler in
secret-form.tsxbroken in source, build compiles, suite run against it: 248 passed, 56 failed, the failures naming the Decrypt and Encrypt flows the handler serves. Restored;git statusclean before the push.Generated by Claude Code