Skip to content

feat(slides): support importing pptx as slides#1068

Merged
fangshuyu-768 merged 1 commit into
mainfrom
feat/slides-pptx-import
May 26, 2026
Merged

feat(slides): support importing pptx as slides#1068
fangshuyu-768 merged 1 commit into
mainfrom
feat/slides-pptx-import

Conversation

@ethan-zhx
Copy link
Copy Markdown
Collaborator

@ethan-zhx ethan-zhx commented May 25, 2026

Summary

Support importing local PPTX files as Lark Slides through lark-cli drive +import, with the current PPTX import limit set to 500MB.

Changes

  • Add .pptx -> slides validation, file size limit handling, help text, and slides URL fallback for drive +import.
  • Update lark-drive skill docs to document PPTX import usage and the 500MB limit.
  • Add focused tests for PPTX validation, size limits, and slides import URL fallback.

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark xxx command works as expected
    • Ran gofmt.
    • Ran git diff --check.
    • Did not run unit tests/build per local AGENTS.md safety rule.

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Import PowerPoint (.pptx) as online slides via drive +import --type slides; CLI help, examples, and target list updated.
  • Documentation

    • Added examples, supported types, validation guidance, and a 500MB PPTX → slides size limit.
  • Tests

    • Added tests covering PPTX import, type/extension validation, size limits, and slides fallback URL behavior.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Caution

Review failed

Failed to post review comments

📝 Walkthrough

Walkthrough

Adds .pptx → slides import support: CLI/help updated, normalizeDriveImportKindForURL recognizes slides, validation and 500MB file-size limit added, tests extended (unit and integration), and user documentation updated.

Changes

PowerPoint to Feishu Slides Import

Layer / File(s) Summary
Core validation and size-limit support for pptx→slides
shortcuts/drive/drive_import_common.go
Adds driveImport500MBFileSizeLimit, maps pptxslides, returns 500MB for pptx in driveImportFileSizeLimit, and extends validateDriveImportSpec with slides and pptx-specific mismatch hints.
CLI metadata and URL normalization
shortcuts/drive/drive_import.go
Updates DriveImport help and --file/--type flag text to include slides and .pptx examples/limits; normalizeDriveImportKindForURL now maps server DocType slides to the canonical URL kind.
Validation and size-limit tests
shortcuts/drive/drive_import_common_test.go
TestValidateDriveImportSpec adds a passing deck.pptxslides case and negative mismatch cases; TestValidateDriveImportFileSize adds 500MB boundary and overflow cases.
End-to-end integration test for slides import
shortcuts/drive/drive_import_test.go
New TestDriveImportFallbackURLForSlides mocks upload/import_tasks/polling for a deck.pptx with --type slides and asserts the canonical Feishu slides URL is produced.
User documentation and references for pptx→slides
skills/lark-drive/SKILL.md, skills/lark-drive/references/lark-drive-import.md
Skill description, examples, --type values, conversion table, validation rules, file-path constraint, and file-size table updated to document .pptxslides and the 500MB limit.

Sequence Diagram

sequenceDiagram
  participant CLI as CLI (lark-cli drive +import)
  participant Upload as UploadService (upload_all)
  participant ImportAPI as ImportTasksAPI (import_tasks)
  participant Poller as Poller (import_tasks/<ticket> poll)
  participant Feishu as Feishu (backend)

  CLI->>Upload: upload file (deck.pptx)
  Upload-->>CLI: upload token/metadata
  CLI->>ImportAPI: create import_task (type=slides, token)
  ImportAPI->>Feishu: backend starts import, returns slides token (sldcn_imported)
  Poller->>ImportAPI: poll task status
  ImportAPI-->>Poller: task completed + slides token
  CLI-->>Feishu: build fallback URL https://www.feishu.cn/slides/sldcn_imported
  CLI-->>User: emit drive envelope with data["url"]
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#599: Both PRs modify the same Drive import shared validation/compatibility logic (extension→doc-type mapping plus size-limit/error messaging).
  • larksuite/cli#220: Both PRs touch Drive import file validation and per-document file-size limit handling.

Suggested reviewers

  • fangshuyu-768
  • wittam-01

Poem

🐰 I hopped into code with a slide and a grin,
I taught .pptx where its journey begins,
Five hundred megabytes lined up in a row,
Now slides find their home and the CLI can go. 🎞️✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding support for importing PPTX files as slides in the drive import command.
Description check ✅ Passed The description covers all required sections: summary, changes, test plan, and related issues, with appropriate detail for the changeset.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/slides-pptx-import

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 added domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths labels May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.91%. Comparing base (877fbe6) to head (792349d).

Files with missing lines Patch % Lines
shortcuts/drive/drive_import_common.go 75.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1068   +/-   ##
=======================================
  Coverage   67.91%   67.91%           
=======================================
  Files         592      592           
  Lines       55410    55414    +4     
=======================================
+ Hits        37631    37635    +4     
  Misses      14669    14669           
  Partials     3110     3110           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@792349db8a08f9d67b38ce67e67bab72d1d88071

🧩 Skill update

npx skills add larksuite/cli#feat/slides-pptx-import -y -g

@ethan-zhx ethan-zhx force-pushed the feat/slides-pptx-import branch 2 times, most recently from f261797 to e4ce73c Compare May 25, 2026 08:27
@ethan-zhx ethan-zhx force-pushed the feat/slides-pptx-import branch from e4ce73c to 792349d Compare May 26, 2026 03:09
@fangshuyu-768 fangshuyu-768 merged commit ee9d090 into main May 26, 2026
22 checks passed
@fangshuyu-768 fangshuyu-768 deleted the feat/slides-pptx-import branch May 26, 2026 03:54
@liangshuo-1 liangshuo-1 mentioned this pull request May 26, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/ccm PR touches the ccm domain size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants