Skip to content

feat(attachments): add UI for full CRUD operations - #7333

Merged
balazs-szucs merged 57 commits into
Stirling-Tools:mainfrom
balazs-szucs:attachments-crud
Oct 4, 2026
Merged

balazs-szucs merged 57 commits into
Stirling-Tools:mainfrom
balazs-szucs:attachments-crud

Conversation

@balazs-szucs

@balazs-szucs balazs-szucs commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

Description of Changes

Adds a full "Manage Attachments" UI for attachment CRUD operations in a single save flow

Changes:

  • Added /extract-single-attachment endpoint to extract a specific attachment from a PDF by name, with the corresponding ExtractSingleAttachmentRequest model and service method.
  • Added /batch-process-attachments endpoint to perform atomic batch renames, deletions, and additions of PDF attachments, with the BatchAttachmentRequest model and service logic for parsing and applying batch operations.
  • Improved attachment name matching logic in AttachmentService to handle case-insensitive, simplified, and URL-decoded comparisons, making operations more robust.
image

Checklist

General

Documentation

Translations (if applicable)

UI Changes (if applicable)

  • Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR)

Testing (if applicable)

  • I have run task check to verify linters, typechecks, and tests pass
  • I have tested my changes locally. Refer to the Testing Guide for more details.

Summary by CodeRabbit

  • New Features
    • Manage embedded PDF attachments in one workflow: add, view, rename, delete, restore, download, or extract them individually or as a ZIP. Stage changes and save them together.
    • Batch attachment processing and single-attachment extraction are supported, with optional PDF/A-3b conversion.
  • Improvements
    • Attachment matching handles case differences and encoded names more reliably. Updated labels, tooltips, and metadata clarify attachment management.
  • Bug Fixes
    • Adding attachments now reports unreadable-file errors instead of returning an incomplete result.
  • Tests
    • Expanded coverage for attachment workflows and edge cases.

@stirlingbot stirlingbot Bot added enhancement New feature or request Java Pull requests that update Java code Front End Issues or pull requests related to front-end development Back End Issues related to back-end development Translation Issues or pull requests related to translation API API-related issues or pull requests labels Aug 7, 2026
@stirlingbot stirlingbot Bot added the engine Issues or pull requests related to the engine label Aug 7, 2026
@balazs-szucs
balazs-szucs marked this pull request as ready for review August 9, 2026 12:40
@balazs-szucs
balazs-szucs requested review from a team and Ludy87 as code owners August 9, 2026 12:40
Copilot AI lite review requested due to automatic review settings August 9, 2026 12:40
@balazs-szucs
balazs-szucs requested a review from a team as a code owner August 9, 2026 12:40
@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines ignoring generated files. label Aug 9, 2026
Comment thread frontend/editor/src/core/services/attachmentService.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a full “Manage Attachments” experience to Stirling-PDF, expanding the existing Add Attachments tool into a UI that supports listing, staging changes, and applying attachment CRUD operations in a single save flow, with supporting backend endpoints and engine/tool metadata updates.

Changes:

  • Introduces a new attachment management UI (list/filter/rename/delete/extract/add + single “Save Changes”) and a frontend attachment service with legacy-backend fallbacks.
  • Adds backend endpoints for batch attachment operations and single-attachment extraction, plus supporting request models and service interface updates.
  • Updates tool registry metadata, tool IO/type models, tests, and user-facing copy/OG metadata to reflect “Manage Attachments”.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
frontend/editor/src/desktop/hooks/useGroupEnabled.test.tsx Fixes useSyncExternalStore mocking to avoid infinite loop; adjusts offline assertions.
frontend/editor/src/core/ui/FilePicker.tsx Adds inputProps passthrough to hidden file input (test selectors, etc.).
frontend/editor/src/core/types/toolIO.ts Adds IO specs for new attachment endpoints.
frontend/editor/src/core/types/toolApiTypes.ts Adds generated API param types/endpoints for new attachment operations.
frontend/editor/src/core/tools/AddAttachments.tsx Switches tool behavior to inline “save” model by wiring AttachmentManager settings.
frontend/editor/src/core/tests/live/viewer-sidebar-add-buttons.spec.ts Updates live test to click “Save Changes” and capture new endpoint response.
frontend/editor/src/core/services/attachmentService.ts New client service for attachment list/extract/single-extract/batch ops + fallbacks.
frontend/editor/src/core/services/attachmentService.test.ts Adds unit tests for filename truncation helper.
frontend/editor/src/core/hooks/tools/addAttachments/useAttachmentManager.ts New state manager hook for staged attachment CRUD + save/discard/extract.
frontend/editor/src/core/data/useTranslatedToolRegistry.tsx Renames tool to “Manage Attachments” and expands declared endpoint set.
frontend/editor/src/core/components/viewer/AttachmentSidebar.css Changes filename display to ellipsis truncation.
frontend/editor/src/core/components/tooltips/useAddAttachmentsTips.ts Updates tooltip copy to match “Manage Attachments” behavior.
frontend/editor/src/core/components/tools/addAttachments/AttachmentRow.tsx New row component with rename/delete/restore/download actions.
frontend/editor/src/core/components/tools/addAttachments/AttachmentManagerUI.tsx New attachment manager panel UI (filter, list, stage, extract, save/discard).
frontend/editor/src/core/components/tools/addAttachments/AddAttachmentsSettings.tsx Replaces old “pick files” settings UI with AttachmentManagerUI integration.
frontend/editor/public/og-metadata.saas.json Updates OG title/description for Manage Attachments.
frontend/editor/public/og-metadata.json Updates OG title/description for Manage Attachments.
frontend/editor/public/locales/en-US/translation.toml Updates attachment-related strings (new attachments.* keys, removes old ones).
engine/src/stirling/models/tool_models.py Adds engine-side param models for new attachment endpoints.
engine/src/stirling/models/tool_io.py Adds engine-side tool IO specs for new attachment endpoints.
app/core/src/main/java/stirling/software/SPDF/service/AttachmentServiceInterface.java Adds extract-single API to service interface.
app/core/src/main/java/stirling/software/SPDF/service/AttachmentService.java Implements single attachment extraction and improves name matching for rename/delete.
app/core/src/main/java/stirling/software/SPDF/model/api/misc/ExtractSingleAttachmentRequest.java New request model for single attachment extraction endpoint.
app/core/src/main/java/stirling/software/SPDF/model/api/misc/BatchAttachmentRequest.java New request model for batch attachment operations endpoint.
app/core/src/main/java/stirling/software/SPDF/controller/api/misc/AttachmentController.java Adds /extract-single-attachment and /batch-process-attachments endpoints.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/core/src/main/java/stirling/software/SPDF/service/AttachmentService.java Outdated
Comment thread frontend/editor/src/core/components/viewer/AttachmentSidebar.css
Comment thread frontend/editor/src/core/services/attachmentService.ts
Comment thread frontend/editor/src/core/services/attachmentService.ts
Comment thread frontend/editor/src/core/data/useTranslatedToolRegistry.tsx
Comment thread frontend/editor/public/locales/en-US/translation.toml
@stirlingbot stirlingbot Bot added the Test Testing-related issues or pull requests label Aug 9, 2026
…annotations

Use a plain lombok import and Loader import instead of qualified names, and
catch only the IOException and RuntimeException the batch ops can throw.
@reecebrowne
reecebrowne added this pull request to the merge queue Oct 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 2, 2026
@balazs-szucs
balazs-szucs added this pull request to the merge queue Oct 4, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 4, 2026
@balazs-szucs
balazs-szucs enabled auto-merge October 4, 2026 20:27
@balazs-szucs
balazs-szucs added this pull request to the merge queue Oct 4, 2026
Merged via the queue into Stirling-Tools:main with commit 885eac4 Oct 4, 2026
60 checks passed
@balazs-szucs
balazs-szucs deleted the attachments-crud branch October 4, 2026 21:05

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API API-related issues or pull requests Back End Issues related to back-end development engine Issues or pull requests related to the engine enhancement New feature or request Front End Issues or pull requests related to front-end development Java Pull requests that update Java code size:XXL This PR changes 1000+ lines ignoring generated files. Test Testing-related issues or pull requests Translation Issues or pull requests related to translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants