Skip to content

Conversation

@robertherber
Copy link
Member

@robertherber robertherber commented Apr 9, 2025

Summary by CodeRabbit

  • Chores

    • Updated the package version to 0.4.21.
  • New Features

    • Adjusted the naming for whitelist actions to enhance clarity.
    • Enhanced whitelist selection by supporting the inclusion of category tokens when available.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 9, 2025

Walkthrough

This pull request updates the react-native-device-activity package. The changes include an increment in the version number in the package configuration file, a renaming of the whitelist action type from "whitelistCurrentApp" to "whitelistCurrent" in the TypeScript definitions, and corresponding updates in the Swift extension. The Swift changes also add a new conditional check to insert a categoryToken into the categoryTokens set if present.

Changes

File(s) Change Summary
packages/.../package.json Version bumped from 0.4.20 to 0.4.21.
packages/.../ReactNativeDeviceActivity.types.ts, packages/.../ShieldActionExtension.swift Renamed whitelist action from "whitelistCurrentApp" to "whitelistCurrent". Additionally, the Swift file now checks for a categoryToken and adds it into the selection.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Module
  participant ShieldAction
  Client->>Module: Initiate whitelist action
  Module->>ShieldAction: Call handleAction("whitelistCurrent", token?)
  alt Token present
    ShieldAction->>Module: Insert categoryToken into selection
  else No token
    ShieldAction->>Module: Proceed without categoryToken
  end
Loading

Possibly related PRs

Suggested reviewers

  • mfazekas

Poem

I’m a rabbit with hops so keen,
Chewing on changes crisp and clean.
Version bumped like a springtime bloom,
Renamed actions banishing the gloom.
With tokens added in a swift delight,
I celebrate code from morning till night!
🥕🐇 Happy coding!

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 38f2068 and dcd3bd1.

📒 Files selected for processing (3)
  • packages/react-native-device-activity/package.json (1 hunks)
  • packages/react-native-device-activity/src/ReactNativeDeviceActivity.types.ts (1 hunks)
  • packages/react-native-device-activity/targets/ShieldAction/ShieldActionExtension.swift (2 hunks)
🔇 Additional comments (4)
packages/react-native-device-activity/package.json (1)

3-3: Version increment looks appropriate.

Version bump from 0.4.20 to 0.4.21 reflects the changes made to support category unblocks and the renaming of the whitelist action type.

packages/react-native-device-activity/src/ReactNativeDeviceActivity.types.ts (1)

163-163: More precise action type naming.

Renamed from "whitelistCurrentApp" to "whitelistCurrent" to better reflect the more general functionality that now works with categories as well, not just apps.

packages/react-native-device-activity/targets/ShieldAction/ShieldActionExtension.swift (2)

121-121: Action type name updated for consistency.

Updated the string check from "whitelistCurrentApp" to "whitelistCurrent" to match the renamed action type in the TypeScript definition file.


132-134: Added support for category token whitelisting.

This new conditional block adds the category token to the whitelist selection, implementing the functionality described in the PR title. The implementation follows the same pattern used for application and web domain tokens, providing a consistent approach.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/kingstinct/react-native-device-activity@50

commit: 3c032dd

@robertherber robertherber merged commit 30c588a into main Apr 9, 2025
1 check passed
@robertherber robertherber deleted the add-category-unblock-to-shield-actions branch April 9, 2025 10:23
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.

2 participants