How should the view data be defined when adding a custom filter to a field?
You get the error Error: missing group.

You should be able to fix it by adding the group property, like this:

$data['node__contact']['active_contact'] = [
  'title' =&gt; t('Active contact filter'),
  'group' =&gt; t('Contact'), // Add this line.
  'filter' =&gt; [
    // ...
  ],
];