Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 26, 2025

Implements Export functionality for bookmarked images, copying them to a user-selected directory without modifying the album or requiring folder addition prompts (unlike Move). Also updates directory picker defaults for better UX across all instances.

Backend

  • /copy_images/{album_key} endpoint - Copies images by index to target directory using shutil.copy2, preserving originals. Returns detailed success/error statistics. No album lock check required.
class CopyImagesRequest(BaseModel):
    indices: List[int]
    target_directory: str

Frontend

  • Export button - Added to Bookmarks menu after Move. Opens directory picker with "Export" action, shows confirmation with copy results.
  • Directory picker defaults - Changed button label from "Add" to "Select Directory", moved button right of Cancel, updated path label to "Selected directory:".
// Export opens picker without album folder prompt
createSimpleDirectoryPicker(
  async (targetDirectory) => {
    await this.performExport(indices, targetDirectory);
  },
  startingPath,
  {
    buttonLabel: "Export",
    title: "Select Export Destination",
    showCreateFolder: true
  }
);

Error Handling

Detects and reports: permission denied, file already exists, file not found, invalid directory.

Tests

Added backend tests for copy_images endpoint covering success case and file collision scenario.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add an Export item to the Bookmarks menu</issue_title>
<issue_description>This feature request is to add an Export menu item to the Bookmarks menu, located under the Move item. The Export action should prompt the user for a server-side folder to copy the current list of bookmarked images into using the filetree browser. It should copy the images, not move them, and should not ask whether the destination folder should be added to the album the way that Move does.

Please detect error conditions (PermissionDenied, attempts that would clobber existing images, etc) and report them appropriately. On success, show a confirmation dialogue.

Also please change the parameters passed to the directory browser (filetree.js) so that the action button (currently labeled "Add") is changed to "Select Directory". Move this button to the right to be adjacent to Cancel. Also change the message "Current directory to add:" to "Selected directory."</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add export item to bookmarks menu with functionality Add Export action to Bookmarks menu with directory picker improvements Dec 26, 2025
Copilot AI requested a review from lstein December 26, 2025 17:01
@lstein lstein marked this pull request as ready for review December 26, 2025 18:43
Copy link
Owner

@lstein lstein left a comment

Choose a reason for hiding this comment

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

works well

@lstein lstein merged commit 28995a5 into master Dec 26, 2025
4 checks passed
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 an Export item to the Bookmarks menu

2 participants