docs +media-download whiteboard thumbnail: content not centered / viewport mismatch
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 17.3k
- Forks
- 1.4k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 105
Description
Description
When using lark-cli docs +media-download --type whiteboard to export a whiteboard thumbnail, the exported image does not properly center the whiteboard content. The thumbnail appears to capture a fixed viewport from the canvas origin (0,0), which results in content being cut off or offset to one side.
Steps to Reproduce
- Create a whiteboard in a Feishu document
- Add some content (shapes, text, etc.) to the whiteboard (not near the canvas origin)
- Run:
lark-cli docs +media-download --type whiteboard --token <whiteboard_token> --output ./thumbnail.jpg - Open the exported thumbnail — content is not centered
Expected Behavior
The exported thumbnail should auto-fit the content bounds (similar to what the Feishu client shows), centering all whiteboard elements in the image. This is the behavior users see when they use "Download as image" in the Feishu client UI.
Actual Behavior
The thumbnail captures a fixed viewport, likely starting from the canvas origin (0,0). Content placed elsewhere on the infinite canvas is offset or partially visible.
Screenshots
Exported via API (whiteboard-v5, content offset to the right):

Another export attempt (whiteboard-v3, same offset issue):

For reference, the Feishu client auto-centers all content in the viewport, but the API thumbnail does not replicate this behavior.
Environment
- OS: Ubuntu Linux
Suggestion
The whiteboard thumbnail API should either:
- Auto-fit content bounds — Calculate the bounding box of all nodes and generate a content-centered thumbnail (most user-friendly)
- Accept viewport parameters — e.g.
--viewport x,y,width,heightso callers can control the captured region - Expose a "get whiteboard nodes" API — Let callers read node positions and compute the bounding box themselves, then combine with option 2
Option 1 would be ideal for most use cases. Option 3 would enable advanced scenarios like programmatic whiteboard-to-image conversion.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation files or tests are named. Start by tracing the lark-cli docs +media-download --type whiteboard entry point and reproduce the export with content away from the canvas origin. Done means the thumbnail centers all whiteboard content like the Feishu client, but the issue leaves the implementation approach unresolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100