Skip to content

Split the encryptor tool into per-tab modules - #217

Merged
404SecNotFound merged 1 commit into
claude/serene-carson-0739mv-paddingfrom
claude/serene-carson-0739mv-split
Sep 26, 2026
Merged

404SecNotFound merged 1 commit into
claude/serene-carson-0739mv-paddingfrom
claude/serene-carson-0739mv-split

Conversation

@404SecNotFound

Copy link
Copy Markdown
Owner

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-testid and handler is where it was, in a new file.

Layout

module lines holds
encryptor-tool.tsx 279 the entry point: tabs, header and footer chrome, composing the modules below
encryptor/use-encryptor-state.ts 3,130 the state and handlers more than one tab reads or writes, exposed through one context
encryptor/secret-form.tsx 1,756 the Encrypt and Decrypt tabs, which turn out to be one shared render function rather than two
encryptor/shared.ts 772 types, constants, pure helpers
encryptor/shares-dialog.tsx 406 the one-time shares dialog and its rehearsal
encryptor/shared-ui.tsx 381 LockWarning, FileSelector, RevealableQr, InfoTip
encryptor/recovery-tab.tsx 121 the Recovery tab
encryptor/recovery-kit-dialog.tsx 99 the recovery kit dialog
encryptor/workspace-tab.tsx 49 the Workspace tab
encryptor/context.tsx 25 the context object

Shared 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-v2 and keym-v2-shamir still goes through loadKeym2 / loadShamir; test:secret-erase-core scans 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.tsx broken 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 status clean before the push.


Generated by Claude Code

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
404SecNotFound merged commit 742b7fa into claude/serene-carson-0739mv-padding Sep 26, 2026
15 checks passed
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