Skip to content

fix(core): use permanent delete icon consistently #13051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

yifeiyin
Copy link
Contributor

@yifeiyin yifeiyin commented Jul 6, 2025

  • Update to DeletePermanentlyIcon in QuickDeletePermanently and trash-page-footer
  • A trivial refactor to use permanentlyDeletePage helper method

Summary by CodeRabbit

  • Style

    • Updated the delete icon in quick actions and trash page footer to use a new "permanently delete" icon for improved clarity.
  • Refactor

    • Streamlined deletion logic in the trash page footer for consistency with new icon usage.

- Update to DeletePermanentlyIcon in QuickDeletePermanently and trash-page-footer
- A trivial refactor to use permanentlyDeletePage helper method
@CLAassistant
Copy link

CLAassistant commented Jul 6, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

coderabbitai bot commented Jul 6, 2025

Walkthrough

The changes update the icon used for permanent deletion actions in both the quick actions and trash page footer components, replacing the previous delete icon with a new "DeletePermanentlyIcon." Additionally, the trash page footer now uses a new permanentlyDeletePage method for deleting documents.

Changes

File(s) Change Summary
packages/frontend/core/src/components/explorer/docs-view/quick-actions.tsx Replaced DeleteIcon with DeletePermanentlyIcon in the quick delete action button.
packages/frontend/core/src/components/pure/trash-page-footer/index.tsx Switched to DeletePermanentlyIcon, replaced direct doc removal with permanentlyDeletePage, and updated dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TrashPageFooter
    participant useBlockSuiteMetaHelper

    User->>TrashPageFooter: Clicks "Delete Permanently"
    TrashPageFooter->>useBlockSuiteMetaHelper: permanentlyDeletePage(doc.id)
    useBlockSuiteMetaHelper-->>TrashPageFooter: Deletion confirmed
    TrashPageFooter-->>User: UI updates to reflect deletion
Loading

Possibly related PRs

Suggested labels

app:core

Suggested reviewers

  • EYHN

Poem

A bunny with icons hopped in with glee,
Swapped old for new—now clearer to see!
With a permanent touch, delete is now neat,
The trash page footer’s update is sweet.
Quick actions refreshed, all tidy and bright—
The codebase now sparkles, oh what a sight!
🗑️✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8857d5 and 61005be.

📒 Files selected for processing (2)
  • packages/frontend/core/src/components/explorer/docs-view/quick-actions.tsx (2 hunks)
  • packages/frontend/core/src/components/pure/trash-page-footer/index.tsx (4 hunks)
🧰 Additional context used
🧠 Learnings (1)
packages/frontend/core/src/components/pure/trash-page-footer/index.tsx (1)
Learnt from: EYHN
PR: toeverything/AFFiNE#12320
File: packages/frontend/core/src/desktop/dialogs/collection-editor/rules-mode.tsx:366-366
Timestamp: 2025-05-22T02:37:07.462Z
Learning: In React components, avoid redundant translation calls. When using services like `docDisplayMetaService.title$` that already provide localized strings, don't wrap the result in another translation call like `i18n.t()` as it's unnecessary and may break interpolation if the string contains special markers.
🔇 Additional comments (7)
packages/frontend/core/src/components/explorer/docs-view/quick-actions.tsx (2)

17-17: LGTM: Appropriate icon import added.

Adding the DeletePermanentlyIcon import is correct for the permanent deletion functionality.


298-298: LGTM: Icon change aligns with component purpose.

Using DeletePermanentlyIcon instead of DeleteIcon for the QuickDeletePermanently component provides better semantic clarity and visual distinction for permanent deletion actions.

packages/frontend/core/src/components/pure/trash-page-footer/index.tsx (5)

6-6: LGTM: Consistent icon import update.

Replacing DeleteIcon with DeletePermanentlyIcon aligns with the semantic purpose of permanent deletion in the trash page footer.


22-22: LGTM: Good refactoring to use helper method.

Adding permanentlyDeletePage from useBlockSuiteMetaHelper promotes better code organization and reusability.


37-37: LGTM: Appropriate method abstraction.

Replacing the direct docCollection.removeDoc(doc.id) call with permanentlyDeletePage(doc.id) provides better abstraction and aligns with the helper method approach.


39-39: LGTM: Dependency array properly updated.

The dependency array correctly reflects the new dependencies after the refactoring, removing docCollection and adding permanentlyDeletePage.


66-66: LGTM: Icon change provides visual consistency.

Using DeletePermanentlyIcon for the permanent delete button provides better visual clarity and consistency with the semantic action being performed.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yifeiyin yifeiyin changed the title fix(core): update to use permanent delete icon fix(core): use permanent delete icon consistently Jul 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants