AOSSIE-Org / AOSSIE-Org/PictoPy

BUG: "Open Original File" button in Media Info Panel shows no action

Đang mở
#1,165 3 bình luận 0 reaction 1 người được giao Được @JIturiDashami nhận Xem trên GitHub
bug frontend
Ngôn ngữ chính
Python
Star
283
Fork
679
Merge trung bình
7 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Mô tả

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

### Description
The **`Open Original File`** button in the `Image Details` panel fails to open images in the system's default viewer. Even though the backend provides the correct absolute path, the frontend action is either silent or blocked by security errors.

### How to reproduce
- Launch PictoPy and go to the Home gallery.
- Select an image and click the **`Show Info (Info icon) button`**.
- Click the **`Open Original File`** button at the bottom of the panel.
- Observation: No external application opens, or a `Failed to open file` error appears in the console.

![Image](https://github.com/user-attachments/assets/ff88d5aa-7f34-4fcb-a596-8fe10ee55e71)

### Root Cause
- **Migration Gap**: The code uses `open() from @tauri-apps/plugin-shell`, which is deprecated/restricted in Tauri v2 for opening local file system paths.
- **Missing Permissions**: The Tauri capabilities configuration lacks the explicit `opener:allow-open-path` permission.
- **Missing Scope**: Tauri v2 requires an explicit scope `(**)` to authorize the opener plugin to access local file paths.

### Potential Fix
- **Frontend** : Migrate from `plugin-shell` to `@tauri-apps/plugin-opener` and use `openPath(currentImage.path)`
- **Configuration** : Update the app's capability file `migrated.json` to include the scoped permission:

```JSON
{
"identifier": "opener:allow-open-path",
"allow": [{ "path": "**" }]
}
```

### Before Screenshot

![Image](https://github.com/user-attachments/assets/4f4becbf-1170-4b1e-b042-91d3dd227f61)

### After Screenshot

![Image](https://github.com/user-attachments/assets/a7d8c994-8d04-4eed-addf-f41368f1e45e)

### Record

- [x] I agree to follow this project's Code of Conduct

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.