Skip to content

feat: support group-level site rules in shortcut packs#833

Open
crittermike wants to merge 1 commit intomasterfrom
feat/pack-group-site-rules
Open

feat: support group-level site rules in shortcut packs#833
crittermike wants to merge 1 commit intomasterfrom
feat/pack-group-site-rules

Conversation

@crittermike
Copy link
Copy Markdown
Owner

Adds support for group-level activateOn/deactivateOn site rules in shortcut packs, so app-specific packs (like OnePageCRM) can restrict all their shortcuts to the relevant domain.

Changes

  • ShortcutPack interface — new optional groupSettings field with activateOn/deactivateOn
  • installPack — writes group settings to storage when present in the pack
  • useGroups — moved reactive state to module scope (singleton pattern, same as useShortcuts/useToast/useJsTools) so groupSettings is shared between App.vue and usePacks

Example pack JSON

{
  "name": "OnePageCRM",
  "description": "CRM shortcuts",
  "groupSettings": {
    "activateOn": "https://app.onepagecrm.com/*"
  },
  "shortcuts": [...]
}

Tests

4 new tests (746 total):

  1. Installs group settings when pack includes them
  2. Handles both activateOn and deactivateOn
  3. Skips group settings when pack doesn't include them
  4. Preserves existing group settings from other groups

Related to #811

Add optional groupSettings field to ShortcutPack interface so packs
can specify activateOn/deactivateOn site rules for the entire group.
When a pack includes groupSettings, installPack writes them alongside
the shortcuts.

Also moves useGroups reactive state to module scope (same singleton
pattern as useShortcuts, useToast, useJsTools) so groupSettings is
shared across all consumers.

Includes 4 tests covering: basic install, both filter fields,
no-groupSettings packs, and preserving existing group settings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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