Use params.format in exportNodeAsImage instead of hardcoded PNG - #146
Open
bimawa wants to merge 2 commits into
Open
Use params.format in exportNodeAsImage instead of hardcoded PNG#146bimawa wants to merge 2 commits into
bimawa wants to merge 2 commits into
Conversation
bimawa
marked this pull request as draft
March 2, 2026 07:43
bimawa
marked this pull request as ready for review
March 2, 2026 07:48
Author
|
Thanks for taking the time to review! I'd really appreciate it if you
could leave a link to your solution so I can learn the best way to approach
this.
Once I've had a chance to check it out, should we go ahead and close my
pull request?
…On 17 Mar 2026 at 05:08:30, David Bowman ***@***.***> wrote:
*dabowman* left a comment (grab/cursor-talk-to-figma-mcp#146)
<#146 (comment)>
Thanks for catching this! The bug is real — params.format is indeed
ignored because of the hardcoded const format = "PNG".
However, this PR targets src/cursor_mcp_plugin/code.js, which doesn't
exist in this fork — the plugin was moved to src/figma_plugin/ and is now
built from source modules (src/figma_plugin/src/commands/document.js).
The fix would need to go in that source file, then bun run build:plugin
regenerates the bundled code.js.
The fix itself is correct in spirit. One style note: since params is
already guaranteed non-null via params || {} at the top of the function,
the cleaner pattern (consistent with how scale is handled) would be:
const { nodeId, scale = 1, format = "PNG" } = params || {};
That way format is a proper destructured default rather than an inline ||
expression, and .toUpperCase() can be dropped since the MCP layer
validates via z.enum(["PNG", "JPG", "SVG", "PDF"]) and always sends
uppercase values.
I'll port this fix to the correct source location. Thanks for surfacing it!
—
Reply to this email directly, view it on GitHub
<#146 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKUJEPV2YGYQYAGFCPCAZD4RCJP5AVCNFSM6AAAAACWD4T7YGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DANZRGQZTIMZYGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
juansilvadesign
added a commit
to juansilvadesign/cursor-talk-to-figma-mcp
that referenced
this pull request
Jul 10, 2026
…rab#179) + export format fix (grab#146) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFKprMCkUsAZfvcM9Uhjax
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.
Previously the format was hardcoded to "PNG" regardless of what was
passed in params. Now uses params.format with "PNG" as fallback,
enabling SVG, JPG, and PDF exports.