Conversation
…gic values, typed mailbox state
…ch limit, name magic values
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.
What changed
A behavior-neutral cleanup of Mail, Inbox, Jurisdictions, Users, Moderation, Home, Analytics, Host messaging and Signup pages. Nothing on screen or in any request changes:
Visible in: admin (nothing should change).
Before you start
admin.civfix.dev, once Admin test harness and characterization safety net #38 to Admin in-file cleanup: platform, orgs, reports, events #44 and this PR have merged to main.git diff --color-moved). This is a campaign PR; the author approved PRs over the 400-line cap for this cleanup.Verify
[Admin]
Mail:
Jurisdictions:
4. Open "Jurisdictions". Switch the filter, sort and layer, and open a jurisdiction. Expect: the same detail: boundary map, notes, handle, contacts grid, email template and actions.
5. Edit a contact and click "Save draft". Expect: the toast "Draft saved for ".
Users and moderation:
6. Open "Users", select an account, and switch the "Activity" tabs. Expect: the same detail and actions.
7. Open "Moderation", select an item, then switch to "Gov claims" and select a claim. Expect: the same detail, checks and decision buttons.
8. In "Organizations" → Members → "Add member", search for a user. Expect: the same picker.
Home, analytics, hosts, pages:
9. Open the "Dashboard". Expect: the same tiles, preview rows, analytics cell and live map.
10. Open "Analytics" and click "Export". Expect: the same cards and the same CSV.
11. Open "Host messaging" and select a host. Expect: the same broadcast log and actions.
12. Open "Signup pages" and select a page. Expect: the same preview and actions.
Regression
Everything that shares the moved code: [Admin]
Not covered
Findings addressed
MailPage(354 lines, complexity 44) is split into state, hooks, a folder switch, a stats strip, a toolbar, list and detail panes, and compose and template modals.MailReader(221 lines) is split into head, links, message, notes, bounce footer and composer; its draft and mutations stay in the reader. The mail box state is now a union type.JurisdictionDetail(438 lines, complexity 30) is split into an editor hook plus panels.DiscoveryPage(complexity 44) is split into filter and selection hooks, a toolbar and the list body. The nested ternaries became tables, with one routing-status pill and one row skeleton.users-page.tsxno longer holds about 10 components.HomePage,AnalyticsPage,HostDetail,PageDetailandpageBlockVieware split. The preview fetch limit is named once, replacingPREVIEW_ROWS + 1in about 7 places.lib/timing,lib/bytesandlib/display.fmtRouted,fmtAgeandfmtPopbecomeformatRoutedDate,formatWaitingAgeandformatPopulation, and short local variables get real names.ts()wrapper;Decisions for the reviewer
Tests changed
Verification
pnpm lint,pnpm typecheck,pnpm buildandpnpm testpass: 112 files, 1,141 tests.🤖 Generated with Claude Code