Skip to content

feat: add platform inclusion filtering and polish notification UI#4484

Open
ComputelessComputer wants to merge 10 commits intomainfrom
add-platform-inclusion-filtering
Open

feat: add platform inclusion filtering and polish notification UI#4484
ComputelessComputer wants to merge 10 commits intomainfrom
add-platform-inclusion-filtering

Conversation

@ComputelessComputer
Copy link
Collaborator

@ComputelessComputer ComputelessComputer commented Mar 10, 2026

Summary

  • Add platform inclusion filtering to allow users to explicitly include apps that would otherwise be ignored by default category rules (e.g. re-enabling VS Code for mic detection)
  • Implement included_platforms across the full stack: Rust policy engine, Tauri commands, TinyBase/Zod schemas, desktop settings store, and persister
  • Update MicNotificationPolicy so user-ignored always takes priority → user-included overrides default category filtering → category rules apply as fallback
  • Replace custom autocomplete dropdown with shadcn Command/Popover component for the "exclude apps" UI
  • Add chip layout optimization (orderIgnoredPlatformIdsForWrap) using bin-packing to minimize row count
  • Add comprehensive test coverage for inclusion behavior in both Rust policy tests and TypeScript unit tests

Updates since last revision

  • Resolved merge conflicts with main (kept inclusion filtering branch changes for notification-app-options.ts, notification-app-options.test.ts, notification.tsx)
  • Simplified handleToggleIgnoredApp: removed redundant defaultIgnored ternary branch when ignoring an app — now always appends to ignoredPlatforms (see note below)
  • Optimized set_included_bundle_ids in ext.rs: now only cancels mic tracking for apps that were previously included but removed, instead of iterating all default-ignored bundle IDs
  • Added test test_user_ignored_overrides_user_included to verify priority when same app is in both sets

Review & Testing Checklist for Human

  • Verify handleToggleIgnoredApp simplification: When a user re-ignores a default-ignored app (e.g. VS Code) from the dropdown after previously including it, the new code adds the bundle ID to ignoredPlatforms and removes from includedPlatforms. The old code would only remove from includedPlatforms. Both approaches result in the app being ignored, but the new approach is slightly "dirtier" (redundant entry in ignoredPlatforms when default-ignored already handles it). This is intentional for code simplicity. Confirm this is acceptable.
  • Test inclusion/exclusion toggle behavior end-to-end: Open Settings → Notifications → Microphone detection. Verify that: (1) default-ignored apps (e.g. VS Code) appear as excluded by default, (2) clicking an excluded default app re-includes it, (3) re-excluding a previously included app works correctly, (4) the app actually gets tracked for mic detection when included
  • Verify should_track_app policy logic: The priority order is user_ignored > user_included > category filtering. Check that explicitly including a categorized app actually triggers mic detection notifications for it
  • Check chip layout optimization: With multiple ignored apps, verify chips wrap reasonably in the container without overflow or visual glitches

Notes

  • The web_ci check failure on this PR is a pre-existing tiptap TypeScript version mismatch (@tiptap/core 3.17.1 vs 3.19.0) in apps/web/src/components/admin/blog-editor/ — reproduces identically on main and is unrelated to this PR. Not marked as required.
  • Requested by: @ComputelessComputer
  • Devin Session

This is part 2 of 2 in a stack made with GitButler:

Simplify ignored platforms logic by storing bundle IDs instead of
app names. Extract dropdown options logic into separate function
and remove unnecessary name-to-bundleId conversions. Update form
handling to work directly with bundle IDs and improve variable
naming for clarity.
Add included_platforms configuration alongside ignored_platforms to
provide more granular control over app tracking. This allows users
to explicitly include categorized apps that would normally be
filtered out.

Implement storage layer support for included platforms with JSON
array serialization. Update MicNotificationPolicy to prioritize
included platforms over default category-based filtering while
maintaining ignored platform precedence. Add comprehensive test
coverage for the new inclusion behavior.
Filter out already ignored apps from the dropdown options instead of
showing them with an "include" action. This simplifies the interface
by only displaying apps that can actually be excluded, making the
user experience more intuitive.

Remove action labels and isDefaultIgnored properties from dropdown
items since they are no longer needed. Update helper text to reflect
the new behavior where only non-ignored apps appear in search results.
…mponent

Migrate notification settings app selection from custom dropdown
implementation to shadcn's Command/Popover components for
better UX and maintainability. Remove manual keyboard handling
and click-outside logic in favor of built-in Command component
functionality.
@ComputelessComputer ComputelessComputer force-pushed the fix-exclude-mic-detection branch from 2b018cc to 181514d Compare March 10, 2026 08:17
@ComputelessComputer ComputelessComputer force-pushed the add-platform-inclusion-filtering branch from 844fc81 to db6926d Compare March 10, 2026 08:17
Add width-aware ordering algorithm for ignored platform ID chips
that optimizes layout by filling rows efficiently. Implement
container width tracking using ResizeObserver to dynamically
adjust chip ordering based on available space.

This improves visual organization of ignored apps by minimizing
gaps and creating more balanced rows when chips wrap to multiple
lines.
@ComputelessComputer ComputelessComputer changed the title added default apps for ignoring added default apps for ignoring and polished ui Mar 10, 2026
Base automatically changed from fix-exclude-mic-detection to main March 10, 2026 08:58
…ges)

Co-Authored-By: John <john@hyprnote.com>
@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for hyprnote-storybook canceled.

Name Link
🔨 Latest commit 02b58b9
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/69afe4aad3b379000865ff7c

@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for hyprnote canceled.

Name Link
🔨 Latest commit 02b58b9
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/69afe4aa574cfe00086bc891

@devin-ai-integration devin-ai-integration bot changed the title added default apps for ignoring and polished ui feat: add platform inclusion filtering and polish notification UI Mar 10, 2026
@ComputelessComputer
Copy link
Collaborator Author

ComputelessComputer commented Mar 10, 2026

@yujonglee FYI - included_platforms exists to let users override default-ignored apps. With only ignored_platforms, the default ignore list would always suppress those apps with no opt-back-in path.

devin-ai-integration bot and others added 2 commits March 10, 2026 09:23
…le_ids, add priority test

Co-Authored-By: John <john@hyprnote.com>
Co-Authored-By: John <john@hyprnote.com>
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.

1 participant