Skip to content

[V1][individual] Email-to-Todo Converter - Core feature engine - #1893

Open
Banx17 wants to merge 2 commits into
Stellar-Mail:mainfrom
Banx17:feat/email-to-todo-converter-core-engine
Open

[V1][individual] Email-to-Todo Converter - Core feature engine#1893
Banx17 wants to merge 2 commits into
Stellar-Mail:mainfrom
Banx17:feat/email-to-todo-converter-core-engine

Conversation

@Banx17

@Banx17 Banx17 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR adds the core feature engine for the Email-to-Todo Converter tool inside its isolated folder. The implementation follows the established tool pattern (matching follow-up-reminder and grammar-cleaner) with a layered services/guards/ui architecture.

Related Issue

Closes #355

Changes

Core Engine (services/):

  • [ADD] services/emailToTodo.ts — Pure deterministic conversion logic with types, constants, and functions: buildTaskDraft, detectPriority, suggestDueDate, buildTaskTitle, buildTaskNotes, hasConvertibleContent
  • [ADD] services/guards.ts — Security/validation guard layer: sanitizeText, validateEmailInput, sanitizeEmailInput, checkInputLimits, safeBuildTaskDraft entry point
  • [ADD] services/fixtures.ts — 7 deterministic synthetic fixtures covering direct request, urgent, newsletter, empty subject, blank content, medium priority, and label scenarios

UI Refactor (ui/):

  • [MODIFY] ui/emailToTodoView.ts — Stripped to view-model helpers only (describeConverter, resolveStatusMessage); imports types from services
  • [MODIFY] ui/EmailToTodoConverter.tsx — Updated to use safeBuildTaskDraft from guard layer
  • [MODIFY] ui/index.ts — Updated exports to re-export from services

Tests & Config:

  • [ADD] tests/emailToTodo.test.ts — 27 engine and view-model tests
  • [ADD] tests/guards.test.ts — 33 guard, fixture, and integration tests
  • [DEL] tests/emailToTodoView.test.ts — Replaced by new test files
  • [ADD] vitest.config.ts — Local vitest configuration

Docs:

  • [MODIFY] README.md — Updated with architecture overview
  • [MODIFY] REVIEW_NOTES.md — Documented all changes

Verification Results

npm test (vitest):
✅ 61/61 tests passed (2 test files, 0 failures)

All work stays within tools/v1/individual/email-to-todo-converter/. No main app, routing, inbox, wallet, database, or design-system integration.

Acceptance Criteria

Status Criterion
Core logic is implemented without linking into the main app
Inputs, outputs, loading states, and error states are documented
No live network calls, secrets, or production data are introduced
Files changed are limited to tools/v1/individual/email-to-todo-converter/
The contribution is reviewable as a self-contained mini-product change

… guards, fixtures, and tests

- Create services/emailToTodo.ts with pure conversion logic (buildTaskDraft, detectPriority, suggestDueDate, buildTaskTitle, buildTaskNotes, hasConvertibleContent)
- Add services/guards.ts with input validation, sanitization, size limits, and safeBuildTaskDraft entry point
- Add services/fixtures.ts with 7 deterministic synthetic fixtures
- Refactor ui/ layer to import from services, keep view-model helpers only
- Add vitest.config.ts and comprehensive test coverage (61 tests passing)
- Update README.md and REVIEW_NOTES.md

All work stays within tools/v1/individual/email-to-todo-converter/.
No main app, routing, inbox, wallet, database, or design-system integration.

Closes Stellar-Mail#355
@Banx17
Banx17 force-pushed the feat/email-to-todo-converter-core-engine branch from 1d65a54 to 94791cc Compare July 27, 2026 17:22
@Banx17

Banx17 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

I've pushed a formatting fix for the Client Checks. CI needs an approval to re-run. Could a maintainer please approve the workflow run?

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.

[V1][individual] Email-to-Todo Converter - Core feature engine

1 participant