Skip to content

feat: add support for string comment attachments#633

Merged
andrii-bodnar merged 2 commits intomasterfrom
copilot/add-string-comment-attachments
Mar 16, 2026
Merged

feat: add support for string comment attachments#633
andrii-bodnar merged 2 commits intomasterfrom
copilot/add-string-comment-attachments

Conversation

Copy link
Contributor

Copilot AI commented Mar 16, 2026

Extends the StringComments module to support the new attachment capabilities added to the Crowdin API — attaching files when creating a comment, receiving attachment data in responses, and deleting attachments from existing comments.

Changes

  • New Attachment interface — response model for attachment objects (id, name, mime, size, category, thumbnailUrl, url, downloadUrl)
  • New AttachmentRequest interface — request model for referencing a storage item by id
  • StringComment — added optional attachments?: Attachment[] field
  • AddStringCommentRequest — added optional attachments?: AttachmentRequest[] field
  • deleteStringCommentAttachment(projectId, stringCommentId, attachmentId) — new method for DELETE /projects/{projectId}/comments/{commentId}/attachments/{attachmentId}, returns updated StringComment

Usage

// Create a comment with attachments (storage IDs from Upload Storage API)
const comment = await crowdin.stringComments.addStringComment(projectId, {
    stringId: 42,
    text: 'See attached screenshot',
    type: 'comment',
    targetLanguageId: 'uk',
    attachments: [{ id: 123 }],
});

// comment.data.attachments contains full Attachment objects

// Remove a specific attachment
await crowdin.stringComments.deleteStringCommentAttachment(projectId, commentId, attachmentId);
Original prompt

This section details on the original issue you should resolve

<issue_title>Add support for String Comment Attachments</issue_title>
<issue_description>The Crowdin API has been extended with support for attachments in string comments. This enhancement allows you to attach files to string comments and manage these attachments.

The Crowdin API client libraries need to be updated to include the new endpoint and reflect the changes to existing endpoints.

Changes:

  • Add Comment - Now supports attachments request parameter to attach files when creating a comment
  • Get Comment - Response now includes attachments field with attached files

New Endpoint:

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: andrii-bodnar <29282228+andrii-bodnar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for string comment attachments feat: add support for string comment attachments Mar 16, 2026
Copilot AI requested a review from andrii-bodnar March 16, 2026 14:26
@andrii-bodnar andrii-bodnar marked this pull request as ready for review March 16, 2026 14:27
@codecov
Copy link

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.18%. Comparing base (1dd461e) to head (ddf86d7).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #633      +/-   ##
==========================================
+ Coverage   90.16%   90.18%   +0.02%     
==========================================
  Files          40       40              
  Lines        2083     2086       +3     
  Branches      243      243              
==========================================
+ Hits         1878     1881       +3     
  Misses         82       82              
  Partials      123      123              

☔ 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.

@andrii-bodnar andrii-bodnar merged commit a56ff28 into master Mar 16, 2026
12 checks passed
@andrii-bodnar andrii-bodnar deleted the copilot/add-string-comment-attachments branch March 16, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for String Comment Attachments

2 participants