feat(pdf): PDF studio — merge / split / rotate (stage C item 4) - #77
Merged
Conversation
範圍照 handoff 與使用者確認:合併+拆分+旋轉,砍掉壓縮。 pdf-lib(新依賴)純前端處理,檔案不離開瀏覽器。 - src/lib/pdfPages.ts:頁碼範圍解析(TDD 5 tests)——「1-3, 7, 10-12」, 全形逗號/頓號容忍,超界或反向整串拒絕不猜意圖。 - src/lib/pdfOps.ts:合併/抽頁/旋轉(TDD 5 tests,用 pdf-lib 現做 PDF 驗頁數與旋轉角);旋轉在原角度上累加 mod 360。 - src/tools/PdfStudio.tsx:三分頁——合併(多檔排序上移下移)、 拆分(範圍抽頁)、旋轉(90/180/270,可指定頁);壞檔與加密檔 有明確錯誤訊息。 - 中英頁面、tools.ts 註冊(實用工具 📄)、OG 卡 74 張。 - e2e:現做 PDF 上傳,下載檔用 pdf-lib 回讀驗證頁數與旋轉角(+3), 含錯誤頁碼的停用與提示。 測試:typecheck:api ✓ / 551 unit ✓(+10)/ 65 e2e ✓(+3) 純前端,不碰 api/。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
TTigger
added a commit
that referenced
this pull request
Jul 13, 2026
Scope confirmed with the user (per the handoff plan): merge + split + rotate, compression dropped. pdf-lib (new dependency) does everything client-side — files never leave the browser. - src/lib/pdfPages.ts: page-range parsing (TDD 5 tests) — "1-3, 7, 10-12", tolerant of full-width and CJK commas; out-of-range or reversed ranges reject the whole string instead of guessing intent. - src/lib/pdfOps.ts: merge / extract / rotate (TDD 5 tests that build real PDFs with pdf-lib and assert page counts and rotation angles); rotation adds to the existing page angle mod 360, since scans often carry one already. - src/tools/PdfStudio.tsx: three tabs — merge (multi-file with up/down reordering), split (range extraction), rotate (90/180/270, optional page range); clear errors for broken or password-protected files. - zh/en pages, tools.ts entry (📄), OG cards regenerated (74 total). - e2e: PDFs built on the fly, downloads re-parsed with pdf-lib to assert page counts and angles; invalid ranges disable the button with a visible message (+3). Tests: typecheck:api / 551 unit (+10) / 65 e2e (+3). Frontend only; api/ untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
階段 C 第 4 項(範圍已與使用者確認:合併+拆分+旋轉,照 handoff 砍掉壓縮)。
pdf-lib(新依賴)純前端處理,檔案不離開瀏覽器,與全站隱私承諾一致。功能
驗證
api/🤖 Generated with Claude Code