Skip to content

feat(mail): open recognized HWPX text from email attachments - #1406

Draft
seonghobae wants to merge 3 commits into
cursor/hwpx-recognized-text-preview-b246from
cursor/mail-hwpx-attachment-preview-7b5e
Draft

feat(mail): open recognized HWPX text from email attachments#1406
seonghobae wants to merge 3 commits into
cursor/hwpx-recognized-text-preview-b246from
cursor/mail-hwpx-attachment-preview-7b5e

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Customer next action

Open the email, select the HWPX file in 첨부 파일, and read the recognized paragraphs. If the preview is still pending, wait, choose another file, or use 다시 확인. If recognition failed or the file is unavailable, choose another file. Never treat a blank preview as empty document content.

Test plan

cd /workspace/backend && PYTHONWARNINGS=error DISABLE_BACKGROUND_WORKERS=1 python -m pytest tests/test_email_attachment_preview.py tests/test_repository_asset_preview.py tests/test_hwp_hwpx_attachment_recognition.py -q --tb=short
cd /workspace/backend && python -m ruff check api/emails.py api/data.py services/repository_asset_preview.py tests/test_email_attachment_preview.py tests/test_repository_asset_preview.py tests/test_hwp_hwpx_attachment_recognition.py
cd /workspace/frontend && pnpm exec vitest run src/components/MailAttachmentPreview.test.tsx src/components/EmailDetail.test.tsx src/components/RepositoryAssetPreviewPanel.test.tsx src/app/data/page.test.tsx

Results on exact head b83a0da03b46a447f9710b5f91d245f5b1783dfa:

  • Backend: 54 passed, 2 skipped (postgres smokes without TEST_DATABASE_URL). Ruff clean. No Timeout/Fatal/Warn/Denied.
  • Frontend: 46 passed (5 mail preview + 24 EmailDetail + 4 Data preview panel + 13 Data page).

CI investigation (2026-08-18)

  • The one failing check was PR Governance / metadata-only gate evaluation on b83a0da03b46a447f9710b5f91d245f5b1783dfa (95549606003), summary: Draft PR: merge automation is paused.
  • That is governance merge-automation pause for Draft, not a product test, lint, or scanner failure. Application CI does not run on this stacked base (cursor/hwpx-recognized-text-preview-b246); app-ci.yml only runs for develop / master / release/**.
  • Customer marked Ready at 2026-08-18T01:32:39Z. Governance re-evaluated the same head: comment now says no current blocking failures remain; metadata-only gate evaluation is an in-progress wait (Ruleset-governed branch: no legacy required status contexts; CWL/PR rulesets apply to ~DEFAULT_BRANCH only). mergeStateStatus=CLEAN.
  • No product code change. No dummy-commit, empty-requeue, force-cancel, CodeRabbit request, self-APPROVE, or merge from this agent.

Notes

Open in Web Open in Cursor 

Summary by CodeRabbit

  • New Features

    • Email details now list attachments with safe filenames.
    • Open HWPX attachments directly from an email to view extracted document text.
    • Attachment previews support pending, failed, unavailable, and empty states.
    • Preview access uses secure references without exposing internal identifiers.
    • Threaded emails provide the same attachment preview experience.
  • Bug Fixes

    • Prevented missing preview content and internal asset details from appearing in the interface.

List the current email's attachments with the same opaque asset_key as
the Data preview contract so a buyer can read ordered HWPX paragraphs
from mail without treating missing text as empty content.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

An error occurred during the review process. Please try again later.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: a1f7f21f-f9c3-4897-978d-a596a8e1c1ac

📥 Commits

Reviewing files that changed from the base of the PR and between f218113 and b83a0da.

📒 Files selected for processing (11)
  • AGENTS.md
  • backend/api/emails.py
  • backend/tests/test_email_attachment_preview.py
  • docs/doctoring/hwp-hwpx-attachment-recognition.md
  • frontend/src/components/EmailDetail.test.tsx
  • frontend/src/components/EmailDetail.tsx
  • frontend/src/components/MailAttachmentPreview.test.tsx
  • frontend/src/components/MailAttachmentPreview.tsx
  • frontend/src/lib/email-threading.ts
  • frontend/tests/e2e/dashboard-flows.spec.ts
  • frontend/tests/e2e/helpers.ts

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Email detail and thread responses now expose opaque attachment references. The dashboard renders selected attachments through the repository preview endpoint and handles HWPX recognition states without exposing internal identifiers.

Changes

Mail attachment preview

Layer / File(s) Summary
Attachment API contract
backend/api/emails.py, AGENTS.md
Email detail and thread responses include opaque asset keys, sanitized filenames, parser metadata, and empty attachment lists when applicable.
Attachment preview UI
frontend/src/lib/email-threading.ts, frontend/src/components/EmailDetail.tsx, frontend/src/components/MailAttachmentPreview.tsx
The selected email exposes typed attachments. MailAttachmentPreview loads and caches repository previews and renders recognized, pending, failed, and unavailable states.
Preview behavior validation and traceability
backend/tests/test_email_attachment_preview.py, frontend/src/components/*.test.tsx, frontend/tests/e2e/*, docs/doctoring/hwp-hwpx-attachment-recognition.md
Tests cover opaque metadata, scoped previews, HWPX paragraph rendering, empty attachments, recognition states, generic 404 handling, and end-to-end opening. Documentation records the preview slice and preserved error behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to b83a0

This PR adds recognized HWPX attachment previews to email while preserving existing preview behavior and unavailable/pending states. No actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant EmailDetail
  participant MailAttachmentPreview
  participant RepositoryAssetPreviewPanel
  User->>EmailDetail: select email
  EmailDetail->>MailAttachmentPreview: provide attachment references
  MailAttachmentPreview->>RepositoryAssetPreviewPanel: request preview by asset_key
  RepositoryAssetPreviewPanel-->>MailAttachmentPreview: return preview state and paragraphs
  MailAttachmentPreview-->>User: display selected attachment
Loading
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: opening recognized HWPX text from email attachments.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/mail-hwpx-attachment-preview-7b5e

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for b83a0da03b46a447f9710b5f91d245f5b1783dfa:

  • Draft PR: merge automation is paused.

cursoragent and others added 2 commits August 18, 2026 00:02
Bring Draft #1406 onto exact current #1404 f218113 so mail-attachment
reachability stays stacked on the live recognized-text preview parent.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Wire the inherited 다시 확인 control to re-fetch the same opaque mail
attachment preview so the stacked parent refresh stays reachable.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 18, 2026
Bring Draft #1407 onto independently resolved live #1406
b83a0da. Previous parent 304d5af is stale.

Keep #1404/#1406 pending 다시 확인 refresh and mail reachability together
with the fail-closed Inkspan edit handoff. No rebase, squash, or force-push.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@seonghobae
seonghobae marked this pull request as ready for review August 18, 2026 01:32
@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@seonghobae
seonghobae marked this pull request as draft August 18, 2026 02:06
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

The rolling-hour window from #1404 f2181137 (finished 04:14 UTC) has elapsed. Please review exact current head b83a0da03b46a447f9710b5f91d245f5b1783dfa, stacked on live #1404 f2181137. Predecessor evidence does not transfer. Keep Draft. This comment is not an approval.

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@seonghobae Fresh review requested for exact head b83a0da03b46a447f9710b5f91d245f5b1783dfa. I will keep #1406 as Draft. I will not approve or merge it.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Normal-priority or P2 work status: draft Draft pull request type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants