Skip to content

fix(files): unpin option missing in batch delete#2488

Merged
lidel merged 2 commits into
mainfrom
fix/batch-delete-unpin-checkbox
Jul 16, 2026
Merged

fix(files): unpin option missing in batch delete#2488
lidel merged 2 commits into
mainfrom
fix/batch-delete-unpin-checkbox

Conversation

@lidel

@lidel lidel commented Apr 21, 2026

Copy link
Copy Markdown
Member

Problem

It was impossible to also unpin while removing more than one file.

Why

FilesPage never connected to selectPins, so it read files?.pins (i.e. pageContent.pins, always undefined) when computing pinned for batch-selected items. Every batch item ended up with pinned: false, so RemoveModal's files.some(f => f.pinned) was false and the "Also remove local pin" checkbox stayed hidden. Single-file context-menu delete worked because it gets pinned from rows in FilesList, which does connect selectPins.

Fix (this PR)

Wire selectPins into FilesPage and use it in selectedFiles and commonProps.pins. state.files.pins is already string[] (the reducer does .map(String)), so no per-element toString() is needed. The delete action already short-circuits unpin for non-pinned items and wraps ipfs.pin.rm in best-effort try/catch, so mixed pinned/unpinned selections are handled idempotently.

Preview

image

FilesPage never connected to `selectPins`, so it read `files?.pins`
(i.e. `pageContent.pins`, always undefined) when computing `pinned`
for batch-selected items. Every batch item ended up with
`pinned: false`, so RemoveModal's `files.some(f => f.pinned)` was
false and the "Also remove local pin" checkbox stayed hidden.
Single-file context-menu delete worked because it gets `pinned`
from <File> rows in FilesList, which does connect `selectPins`.

Wire `selectPins` into FilesPage and use it in `selectedFiles` and
`commonProps.pins`. `state.files.pins` is already `string[]` (the
reducer does `.map(String)`), so no per-element `toString()` is
needed. The delete action already short-circuits unpin for
non-pinned items and wraps `ipfs.pin.rm` in best-effort try/catch,
so mixed pinned/unpinned selections are handled idempotently.

Fixes ipfs/ipfs-desktop#3134
@lidel
lidel merged commit d87d88b into main Jul 16, 2026
13 checks passed
@lidel
lidel deleted the fix/batch-delete-unpin-checkbox branch July 16, 2026 20:11
ipfs-gui-bot pushed a commit that referenced this pull request Jul 16, 2026
## [4.13.0](v4.12.0...v4.13.0) (2026-07-16)

 CID `bafybeiciqeyipumpmhxzlxnbqdbbv6u5uij4hy4wax64dmj7kvrhusiq6y`

 ---

### Features

* choose share link type, add native uris ([#2482](#2482)) ([bbd8a31](bbd8a31)), closes [#2486](#2486)
* **config:** add Local Gateway URL for reverse proxy and Docker ([#2486](#2486)) ([6a4acab](6a4acab)), closes [#2458](#2458) [#2383](#2383)

### Bug Fixes

* **files:** unpin option missing in batch delete ([#2488](#2488)) ([d87d88b](d87d88b)), closes [ipfs/ipfs-desktop#3134](https://github.com/ipfs/ipfs-desktop/issues/3134)
* **ipns:** surface publish errors to user ([#2493](#2493)) ([5cdb301](5cdb301)), closes [#2492](#2492)

### Trivial Changes

* pull transifex translations ([#2483](#2483)) ([9037406](9037406))
* pull transifex translations ([#2491](#2491)) ([2007bd8](2007bd8))
* pull transifex translations ([#2495](#2495)) ([78ce01a](78ce01a))
@ipfs-gui-bot

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 4.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to cancel pinning while deleting in batch?

2 participants