Skip to content

feat: error DM notifications, BCC, and district email config#27

Open
kurt-croix wants to merge 4 commits into
masterfrom
feat/error-dm-bcc-district-emails
Open

feat: error DM notifications, BCC, and district email config#27
kurt-croix wants to merge 4 commits into
masterfrom
feat/error-dm-bcc-district-emails

Conversation

@kurt-croix

Copy link
Copy Markdown
Owner

@kurt-croix
kurt-croix force-pushed the feat/error-dm-bcc-district-emails branch 3 times, most recently from 501f335 to b52cfb1 Compare April 29, 2026 18:46
- Add /district-emails.json in public dir — editable on server without rebuild
- Add loadDistrictEmailConfig() for runtime config loading
- Add getDistrictEmail() to resolve district → email from config
- Add ADMIN_NPUB constant for error notification recipient
- Add sendErrorDM: NIP-17 gift-wrapped kind 14 DM to admin on failures
- Add BCC to admin on every report email via nostr-mail bridge
- Update real district contacts in JSON config
- Dev mode (localhost) overrides all emails to croix4clerk@pm.me
- ReportForm sends error DM when email or report publish fails
@kurt-croix
kurt-croix force-pushed the feat/error-dm-bcc-district-emails branch from b52cfb1 to c569ff4 Compare April 29, 2026 18:55
Coverage by area:
- lib/: 97.7% lines
- hooks/: 86.5% lines
- pages/: 85.1% lines
- components/: 64.3% lines

Test files added:
- tests/lib/ (6): utils, geohash, jurisdiction, dmUtils, dmConstants, genUserName
- tests/hooks/ (15): useLocalStorage, useIsMobile, useToast, useRoadReports,
  useConversationMessages, useAuthor, useReportMutations, useComments,
  useAppContext, useWallet, useNostrPublish, useNWC, useUploadFile,
  useLoginActions, useLoggedInAccounts, useCurrentUser
- tests/pages/ (6): NotFound, NIP19Page, Index, ReportDetail, ReportList, SplashPage
- tests/components/ (8): ReportCard, AppProvider, NoteContent, NostrSync,
  ErrorBoundary, LoginArea, LoginDialog, SignupDialog

Also adds @testing-library/user-event dev dependency.
- Run unit tests (vitest) before build/deploy
- Add tsc --noEmit type check
- Add PR trigger on master
- Add tests/** to path triggers
- Build job now depends on test job passing
- Replace runtime fetch of /district-emails.json with build-time
  YAML import via Vite ?raw + js-yaml
- Add config.yaml at project root with district email contacts
- Remove public/district-emails.json
- Remove loadDistrictEmailConfig() from App.tsx (no longer needed)
- Update districtEmails tests for new import pattern
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