[PR #6368] [MERGED] delete previous image on cover change #7335

Closed
opened 2026-03-23 23:19:09 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/6368
Author: @Ahad-patel
Created: 9/20/2024
Status: Merged
Merged: 12/31/2024
Merged by: @LucasXu0

Base: mainHead: delete-unecessary-images


📝 Commits (9)

  • bd9be43 remove unecessary images from localstorage
  • 5ca7cbc Merge branch 'main' into delete-unecessary-images
  • 86ba1ee Merge branch 'main' into delete-unecessary-images
  • 5c6b18b feat: Add handler for deleting previous cover image on cover image change
  • bf6b3ef fix: add local image case for versions after 0.5.5
  • e668352 fix: add try catch block and delete action to bottom of function
  • 093ec2a Merge branch 'main' into delete-unecessary-images
  • 86ffa67 chore: add test case for uploading and deleting image in localmode
  • 64d5718 Merge branch 'main' into delete-unecessary-images

📊 Changes

4 files changed (+99 additions, -3 deletions)

View changed files

📝 frontend/appflowy_flutter/integration_test/desktop/document/document_with_cover_image_test.dart (+61 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_cover_widget.dart (+17 -3)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_util.dart (+13 -0)
📝 frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/migration/editor_migration.dart (+8 -0)

📄 Description

Feature Preview

Closes: https://github.com/AppFlowy-IO/AppFlowy/issues/5145

I have created two methods for deletePreviousImageFromCloudStorage and deleteFile in DocumentSevce Class
when ever the user changes cover image the this method will check if there the previous image was file, If so then it will delete the previous image.

I have a question ther is a an method DocumentEventDeleteFile which takes DownloadFilePB payload which has two params localFilePath and url, the url can be obtained from coverDetails but localFilepath is not stored any where how do i delete it from the local storage? @Xazin

PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/6368 **Author:** [@Ahad-patel](https://github.com/Ahad-patel) **Created:** 9/20/2024 **Status:** ✅ Merged **Merged:** 12/31/2024 **Merged by:** [@LucasXu0](https://github.com/LucasXu0) **Base:** `main` ← **Head:** `delete-unecessary-images` --- ### 📝 Commits (9) - [`bd9be43`](https://github.com/AppFlowy-IO/AppFlowy/commit/bd9be437fa3ce90c1b4e2df694ff8eebe01eafa8) remove unecessary images from localstorage - [`5ca7cbc`](https://github.com/AppFlowy-IO/AppFlowy/commit/5ca7cbcb9a865441aab2fdf3083855a0d2695e4d) Merge branch 'main' into delete-unecessary-images - [`86ba1ee`](https://github.com/AppFlowy-IO/AppFlowy/commit/86ba1ee352fc3d96d8357f78c6c912a5c54b573b) Merge branch 'main' into delete-unecessary-images - [`5c6b18b`](https://github.com/AppFlowy-IO/AppFlowy/commit/5c6b18b0c65f4d606cf0b1f28d68b8dfc0bbb8e6) feat: Add handler for deleting previous cover image on cover image change - [`bf6b3ef`](https://github.com/AppFlowy-IO/AppFlowy/commit/bf6b3ef4101ebd791aba312265001dddc5ac89bb) fix: add local image case for versions after 0.5.5 - [`e668352`](https://github.com/AppFlowy-IO/AppFlowy/commit/e66835297a2dc84febf8d4f1517aa64252fc4624) fix: add try catch block and delete action to bottom of function - [`093ec2a`](https://github.com/AppFlowy-IO/AppFlowy/commit/093ec2a0c4468a90a8f9726a4a30aa39e835feaa) Merge branch 'main' into delete-unecessary-images - [`86ffa67`](https://github.com/AppFlowy-IO/AppFlowy/commit/86ffa676f2f315f17a2cae8fb8b74648dd7596ee) chore: add test case for uploading and deleting image in localmode - [`64d5718`](https://github.com/AppFlowy-IO/AppFlowy/commit/64d571846394fa87c9899fea2981b8934be4c848) Merge branch 'main' into delete-unecessary-images ### 📊 Changes **4 files changed** (+99 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_flutter/integration_test/desktop/document/document_with_cover_image_test.dart` (+61 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/header/document_cover_widget.dart` (+17 -3) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/image/image_util.dart` (+13 -0) 📝 `frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/migration/editor_migration.dart` (+8 -0) </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> <!--- Before you mark this PR ready for review, run through this checklist! --> Closes: https://github.com/AppFlowy-IO/AppFlowy/issues/5145 I have created two methods for deletePreviousImageFromCloudStorage and deleteFile in DocumentSevce Class when ever the user changes cover image the this method will check if there the previous image was file, If so then it will delete the previous image. I have a question ther is a an method DocumentEventDeleteFile which takes DownloadFilePB payload which has two params localFilePath and url, the url can be obtained from coverDetails but localFilepath is not stored any where how do i delete it from the local storage? @Xazin #### PR Checklist - [x] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [x] I've listed at least one issue that this PR fixes in the description above. - [x] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [x] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:19:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#7335
No description provided.