Skip to content

feat(import): expose email import to the iOS app - #252

Merged
AnnatarHe merged 1 commit into
mainfrom
claude/magical-sagan-v4nv25
Oct 29, 2026
Merged

AnnatarHe merged 1 commit into
mainfrom
claude/magical-sagan-v4nv25

Conversation

@AnnatarHe

Copy link
Copy Markdown
Member

Summary

The iOS app is getting email import (companion PR: https://github.com/clippingkk/ios-n1, branch claude/magical-sagan-v4nv25). The app can already call /api/v3/email-bindings with its ck_ios_ bearer, since requireUserId accepts the native credential first. What it couldn't get was the rest of what Settings → Email import and Settings → Notes render server-side. This PR adds two read-only routes for that:

  • GET /api/v3/email-import → { address, maxBindings, bindings, history: { total, emails } }
    • address is INBOUND_EMAIL_ADDRESS, or null while it's unset (the settings page's "not available" state).
    • history is listInboundEmails(userId) (latest 50, detail already nulled for readers).
  • GET /api/v3/reader-notes → listReaderNotes(userId) (latest 100 and the total).

Both use route() + noStore, like the binding routes. No schema or migration changes.

Docs

  • docs/email-import.md: adds the two routes to the table, and replaces "(cookie session only)" with what requireUserId actually accepts (cookie or the native credential).
  • docs/native-ios.md: new "Email import" section listing the routes the app uses.
  • CLAUDE.md: one sentence in the Email Import section.

Tests

  • src/server/__tests__/email-import-routes.test.ts: response shape, Cache-Control: no-store, null address when unconfigured, notes, and 401 for a signed-out caller on both routes.
  • pnpm test: 699 passed. pnpm lint and pnpm format:check are clean. pnpm typecheck shows only the existing image-module errors you get without the generated next-env.d.ts; none are in these files.

Generated by Claude Code

Add GET /api/v3/email-import (the import address, the reader's sending
addresses and their latest emails, as Settings → Email import shows them)
and GET /api/v3/reader-notes (the notes that came with the exports). Both
take the browser session or the native ck_ios_ credential, like the
existing /api/v3/email-bindings routes the app uses to add, verify and
remove addresses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014EpZReoTKSJukkNsgaKaKw
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T13:19:21.742678Z
We couldn’t complete this review. Comment @codex review to try again.
597c0fa PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@shelltime

shelltime Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

☁️ Claude Code cloud · Add email import workflow to iOS client

Implemented the web app’s email-import workflow in the iOS client, including domain models, service integration, UI screens, and test coverage.

💰 Cost 🔢 Tokens ⏱️ Duration 🧠 Model 💬 Prompts ✏️ Lines
$10.93 27.6M 23m (23m active) claude-opus-5-5 1 +1149 / −0

27.6M tokens: 700 input · 130.3K output · 27.1M cache read · 361.9K cache write

📝 AI summary

Added iOS support for email imports by introducing the relevant domain representation in Domain/EmailImport.swift and implementing API/service behavior in Core/Import/EmailImportService.swift. Built the user-facing import flow in Features/Import/EmailImportScreens.swift, aligning the native client functionality with the existing web implementation.

Expanded automated coverage in ClippingKK N1Tests/EmailImportTests.swift for the new iOS behavior. The existing server-side flow was also reviewed and its route tests were updated in web/src/server/__tests__/email-import-routes.test.ts to support and validate integration with the client workflow.

View this session on ShellTime →

Updated 2026-10-30 13:20 UTC by ShellTime · totals for the whole session so far · the session page is visible to its owner

@AnnatarHe
AnnatarHe merged commit 8a016dc into main Oct 29, 2026
1 of 2 checks passed
@AnnatarHe
AnnatarHe deleted the claude/magical-sagan-v4nv25 branch October 29, 2026 13:51
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.

2 participants