larksuite / larksuite/cli

Mermaid pie chart legend text truncated in whiteboard rendering

Open
#1,360 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

domain/doc domain/whiteboard
Dominant language
Go
Stars
17.3k
Forks
1.4k
Avg merge
2d 4h
Merged PRs (30d)
105

Description

Description

When a mermaid pie chart is inserted into a Feishu docx document (via lark-cli docs +create or docs +update), the chart is rendered as a whiteboard (block_type 43). The legend area on the right side of the pie chart has a fixed width, causing legend labels to be truncated and wrap awkwardly.

Steps to Reproduce

  1. Create a Feishu doc with a mermaid pie chart:
lark-cli docs +create --api-version v1 --as bot \
  --wiki-node "<node>" \
  --title "Test Pie Chart" \
  --markdown @test.md

Where test.md contains:

```mermaid
pie title Category Distribution (49 valid tickets)
    "Troubleshooting (25)" : 25
    "咨询 (9)" : 9
    "Account&Org (5)" : 5
    "Verification (5)" : 5
    "Duplicate (3)" : 3
    "Billing (2)" : 2
```
  1. View the generated whiteboard in Feishu web UI.

Expected Behavior

Legend labels should be fully visible without truncation. The legend area width should adapt to the longest label, or the whiteboard should support configurable dimensions.

Actual Behavior

Legend labels are truncated and wrap to the next line. For example:

  • Troubleshooting wraps so (25) appears on a separate line
  • Account&Org wraps so (5) is cut off
  • Mixed Chinese/English labels are particularly affected

Screenshot:

The whiteboard block (type 43) has only align and token fields — no size or layout configuration is exposed.

Environment

  • lark-cli version: 1.0.46
  • Platform: macOS (darwin)
  • Feishu doc type: docx (wiki page)

Suggestion

  1. Auto-size the whiteboard/legend area based on label length
  2. Or expose a width/height attribute on the board block so users can control rendering dimensions
  3. Or allow mermaid pie chart %%{init: {'theme': ...}}%% directives to influence legend layout

🤖 Generated with Claude Code

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documented lark-cli docs +create and docs +update reproduction using the supplied Mermaid pie chart, then trace how it becomes a Feishu whiteboard block of type 43. Check whether the CLI can control the legend or block dimensions; done means legend labels are fully visible or the limitation and supported control are clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.