fix: Figma comment and deep link for instance-internal nodes#230
fix: Figma comment and deep link for instance-internal nodes#230
Conversation
- Comment API: strip instance path (semicolons) and "I" prefix from node IDs before posting — API only accepts simple "3010:7457" format - Deep link: convert colons to hyphens in node IDs for valid Figma URLs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughA new utility normalizes Figma node IDs and is applied to comment payloads and deep-link construction. Node IDs are truncated at the first semicolon, a leading "I" is removed, and colon/dash format conversions are applied where appropriate. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as Client UI (button)
participant Script as Embedded postComment script
participant Util as toCommentableNodeId
participant API as Figma Comments API
UI->>Script: click (dataset.nodeId with dashes)
Script->>Script: replace '-' -> ':' (intermediate nodeId)
Script->>Util: toCommentableNodeId(intermediate nodeId)
Util-->>Script: commentNodeId (first segment, no leading "I")
Script->>API: POST /v1/files/{fileKey}/comments (client_meta.node_id = commentNodeId)
API-->>Script: 200/response
Script-->>UI: update UI (success/failure)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/adapters/figma-url-parser.ts`:
- Around line 48-57: The helper toCommentableNodeId is implemented but not
exposed to consumers — either export it through the public browser API or remove
it to avoid duplicate logic in HTML scripts; specifically, add an export
forwarding to src/browser.ts (e.g., expose toCommentableNodeId on the CanICode
public object so callers like the inline scripts in
src/core/report-html/index.ts and app/web/src/index.html can call
CanICode.toCommentableNodeId()), or if you want it private, delete the export
from src/core/adapters/figma-url-parser.ts and update the inline scripts to keep
their local logic.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 944bcac6-929c-4151-90da-7a7ea78fd0b2
📒 Files selected for processing (3)
app/web/src/index.htmlsrc/core/adapters/figma-url-parser.tssrc/core/report-html/index.ts
…uplication Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
I3010:7457;1442:7704are stripped to3010:7457before posting — Figma Comments API only accepts simple node IDsI175:7425;1442:7704→node-id=175-7425)Test plan
pnpm test:run— 656 tests pass🤖 Generated with Claude Code