Skip to content

Show import upload progress toast for PPTX and DOCX#299

Merged
hackerwins merged 7 commits into
mainfrom
feat/import-progress-toast
May 25, 2026
Merged

Show import upload progress toast for PPTX and DOCX#299
hackerwins merged 7 commits into
mainfrom
feat/import-progress-toast

Conversation

@hackerwins

@hackerwins hackerwins commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

Importing a .pptx/.docx from the document list uploads each embedded
image serially to /images with no UI feedback — only the Import buttons
are disabled. This adds a live toast.loading "Uploading images X / N"
during the upload phase that morphs in place into the existing
success/error toast.

  • Importers gain onProgressimportPptx (options field) and
    DocxImporter.import (optional 3rd positional param). Implemented by
    wrapping the single injected upload callback at its one injection point
    (no counter threaded through parse contexts). done bumps in a
    finally, so a soft-failed upload still advances the bar.
  • total = image-file count under ppt/media/ / word/media/ — a
    pragmatic denominator; drift is clamped with Math.min and overridden
    by the final toast.
  • FrontendpickAndImport* forward { done, total, fileName };
    the document-list handlers lazily create the toast on the first
    progress tick (so a cancelled picker shows no toast) and morph it into
    the existing success/error toast in place.
  • Backward compatible: onProgress is optional everywhere; CLI and
    existing callers are unchanged.

Test plan

  • pnpm verify:self green (lint, all unit tests, all builds,
    dead-code, doc-staleness)
  • New unit tests — PPTX: progress, soft-fail still advances, zero
    images; DOCX: progress, zero images
  • Manual smoke in pnpm dev: import an image-heavy .pptx and
    .docx; confirm the toast appears only after a file is chosen,
    counts X / N upward, morphs to success on completion, shows no
    toast on picker cancel, and morphs to error on failure

🤖 Generated with Claude Code

hackerwins and others added 7 commits May 25, 2026 20:27
Importing a .pptx/.docx uploads embedded images serially with no UI
feedback during the upload phase. Capture the brainstormed design for a
live toast.loading 'Uploading images X / N' that morphs into the
existing success/error toast.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Switch the design from threading a progress counter through every parse
context to wrapping the injected uploader once at the single injection
point — same behavior, far fewer files touched. Add the bite-sized
TDD plan.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Add onProgress callback to ImportPptxOptions. Wrap the injected
uploadImage once at the single injection point in index.ts: count
image files under ppt/media/ as total, emit (0, total) up-front, then
bump done in a finally block after each upload so soft-failed uploads
still advance the bar.

Export EXT_TO_MIME from image.ts so index.ts can filter the media
list to image files only. Extend the fixture builder with imageCount
so progress tests can generate decks with embedded images.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Wrap the injected imageUploader once at the top of DocxImporter.import
to emit onProgress(done, total) without threading a counter through
uploadImages/parseHeaderFooter. total = word/media/ image-file count;
done increments in a finally so a soft-failed upload still advances.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Wire onProgress from importPptx/DocxImporter through the action helpers
into the document-list handlers so a live loading toast tracks image
upload progress and morphs in place into the final success or error toast.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Capture the implementation outcome, risk notes, known limitations, and
lessons (wrapper-at-injection-point, finally-invariant, pragmatic
denominator, commit-hook gotcha) and index the paired task docs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@hackerwins, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 27 minutes and 31 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c455fcd-177f-4e4d-9834-d1a55b4bf370

📥 Commits

Reviewing files that changed from the base of the PR and between c664e9f and d9f2e14.

📒 Files selected for processing (12)
  • docs/tasks/README.md
  • docs/tasks/active/20260525-import-progress-toast-lessons.md
  • docs/tasks/active/20260525-import-progress-toast-todo.md
  • packages/docs/src/import/docx-importer.ts
  • packages/docs/test/import/docx-importer.test.ts
  • packages/frontend/src/app/docs/docx-actions.ts
  • packages/frontend/src/app/documents/document-list.tsx
  • packages/frontend/src/app/slides/pptx-actions.ts
  • packages/slides/src/import/pptx/image.ts
  • packages/slides/src/import/pptx/index.ts
  • packages/slides/test/import/pptx/__fixtures__/build-minimal-pptx.ts
  • packages/slides/test/import/pptx/index.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/import-progress-toast

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 and usage tips.

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Verification: verify:self

Result: ✅ PASS in 182.5s

Lane Status Duration
tokens:build ✅ pass 1.6s
sheets:build ✅ pass 10.3s
docs:build ✅ pass 9.6s
slides:build ✅ pass 10.9s
verify:fast ✅ pass 114.8s
frontend:build ✅ pass 15.1s
verify:frontend:chunks ✅ pass 0.3s
backend:build ✅ pass 3.9s
cli:build ✅ pass 1.6s
verify:entropy ✅ pass 14.2s

Verification: verify:integration

Result: ✅ PASS

@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/docs/src/import/docx-importer.ts 96.42% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@hackerwins

Copy link
Copy Markdown
Collaborator Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@hackerwins
hackerwins merged commit c3b44ed into main May 25, 2026
4 checks passed
@hackerwins
hackerwins deleted the feat/import-progress-toast branch May 25, 2026 12:09
hackerwins added a commit that referenced this pull request May 25, 2026
These tasks landed on main per recent commit log: docker-publish-arm64
(#296), import-progress-toast (#299), pptx-blipfill-fillrect-crop (#297),
release-v0.4.2 (#295), slides-textbox-autogrow (cf83a49), and
slides-textbox-edit-theme-color (#300). Move their docs to
archive/2026/05 and regenerate the task indexes.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
hackerwins added a commit that referenced this pull request May 25, 2026
These tasks landed on main per recent commit log: docker-publish-arm64
(#296), import-progress-toast (#299), pptx-blipfill-fillrect-crop (#297),
release-v0.4.2 (#295), slides-textbox-autogrow (cf83a49), and
slides-textbox-edit-theme-color (#300). Move their docs to
archive/2026/05 and regenerate the task indexes.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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