Skip to content
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

feat: use highSignalNotificationFilter to api #3588

Merged
merged 1 commit into from
Aug 20, 2023

Conversation

bigint
Copy link
Member

@bigint bigint commented Aug 20, 2023

What does this PR do?

πŸ€– Generated by Copilot at cf7a12f

The pull request adds a new feature to let users filter notifications by signal strength in the web app. It updates the Settings.tsx component, the preferences worker, and the tracking.ts module to handle the new preference option highSignalNotificationFilter. It also improves the cache clearing logic for the preferences worker.

Related issues

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (non-breaking small changes to existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Explanation of the changes

πŸ€– Generated by Copilot at cf7a12f

  • Add a new feature to toggle the high signal notification filter, which is a preference that filters out low-quality notifications for users (link, link, link, link, link, link, link, link)
  • Import additional modules and constants in Settings.tsx (link)
  • Define a new function toggleHighSignalNotificationFilter in Settings.tsx that makes a POST request to the preferences worker, shows a toast message, and tracks the event using Leafwatch (link)
  • Replace the inline function for setting the state of the filter with the new function in Settings.tsx (link)
  • Add a new constant TOGGLE_HIGH_SIGNAL_NOTIFICATION_FILTER to the NOTIFICATION object in tracking.ts (link)
  • Add a new optional property highSignalNotificationFilter to the ExtensionRequest type in updatePreferences.ts (link)
  • Add a new validation rule for the highSignalNotificationFilter property in updatePreferences.ts (link)
  • Destructure the highSignalNotificationFilter property from the request body in updatePreferences.ts (link)
  • Add the highSignalNotificationFilter property to the update query for the preferences table in updatePreferences.ts (link)
  • Optimize the cache clearing logic in the preferences worker to only clear the cache in Cloudflare KV if the update request was made by an admin (link)

Emoji

πŸ””πŸ“ΆπŸ› οΈ

@vercel
Copy link

vercel bot commented Aug 20, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
prerender βœ… Ready (Inspect) Visit Preview Aug 20, 2023 2:13pm
web βœ… Ready (Inspect) Visit Preview Aug 20, 2023 2:13pm

@vercel vercel bot temporarily deployed to Preview – prerender August 20, 2023 14:11 Inactive
@bigint bigint merged commit dd052c1 into main Aug 20, 2023
9 checks passed
@bigint bigint deleted the high_signal_notification_filter branch August 20, 2023 14:13
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.

None yet

1 participant