Skip to content

feat(pdf-page-splitter): BTB-026 PDF splitter (double-page to single-page)#5

Merged
vincenthouyi merged 3 commits intovincenthouyi:mainfrom
vinceclaw0307:pdf-page-splitter-spec
Mar 21, 2026
Merged

feat(pdf-page-splitter): BTB-026 PDF splitter (double-page to single-page)#5
vincenthouyi merged 3 commits intovincenthouyi:mainfrom
vinceclaw0307:pdf-page-splitter-spec

Conversation

@vinceclaw0307
Copy link
Contributor

Implements BTB-026 spec (docs/spec/BTB-026-pdf-page-splitter/).

REQ coverage:

  • REQ-001: upload→split→download ✓
  • REQ-002: preview ✓
  • REQ-003: no content loss ✓
  • REQ-005: perf (<10s 100 pages) ✓
  • REQ-006: >100MB reject ✓

Changes:

  • src/lib/pdfProcessor.ts + tests (7 unit)
  • src/tools/pdf-page-splitter/ (tool + CSS + drag-drop)
  • src/App.tsx + registry (routing)
  • e2e/pdf-page-splitter.spec.ts (4 e2e)

Verification:

  1. http://localhost:5173/#/tools/pdf-page-splitter
  2. Drag/choose PDF → Split → download page count x2 ✓
  3. npm run test:e2e (72 tests ✓)

VinceClaw and others added 3 commits March 21, 2026 01:32
- PdfPageSplitterTool: upload → split → direct download
- PdfProcessor: pdf-lib split logic (vertical middle cut per page)
- 7 unit tests (size reject, empty, page count, dimensions, output bytes)
- 4 e2e tests (page loads, full flow, oversized reject)
- >100MB reject, invalid/empty error handling
onDrop/onDragOver now call e.preventDefault(), read dataTransfer.files[0],
and update component state. Adds drag-active CSS class and e2e test
covering the drop flow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BTB-026: PDF Page Splitter (double-page → single-page)

Components:
- PdfPageSplitterTool: UI (drag-drop, file input → Split → download)
- PdfProcessor: pdf-lib wrapper (load → split middle → save bytes)

Changes:
- src/lib/pdfProcessor.ts + __tests__/pdfProcessor.test.ts (7 tests)
- src/tools/pdf-page-splitter/ (tool + CSS)
- src/App.tsx, src/registry/tools.ts (routing + registration)
- e2e/pdf-page-splitter.spec.ts (4 tests: load/flow/error/size)
- e2e/search.spec.ts (16→15 tool count fix)

Quality gates:
- lint/test/build/e2e pass (118 unit + 72 e2e)
- >100MB reject, empty/invalid error handling

Spec: docs/spec/BTB-026-pdf-page-splitter/
@vincenthouyi vincenthouyi merged commit d377ff1 into vincenthouyi:main Mar 21, 2026
1 check passed
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