Surface common tracker pattern link across APIs

Expose the existing tracker_patterns.common_tracker_pattern_id foreign
key on the TrackerPattern type so it is possible to tell whether a
pattern is linked to the global common-tracker catalog (its description
likely came from the seed or the mapping/enrichment agents) or has no
link (added manually or inherited). This is a read-only debugging aid
for agent-generated descriptions; no migration or write path changes.

The field is added in sync across all four API surfaces (GraphQL, MCP,
CLI, n8n) plus the console UI, and covered by e2e assertions for both
the linked and unlinked cases.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-02 17:31:54 +02:00
parent 9ac71f948f
commit aebb2a1ed0
12 changed files with 208 additions and 53 deletions

View File

@@ -30,6 +30,7 @@ const trackerPatternPropertiesSectionFragment = graphql`
excluded
detectedCount
lastMatchedAt
commonTrackerPatternId
cookieCategory {
name
}
@@ -105,6 +106,16 @@ export function TrackerPatternPropertiesSection({
<span className="text-sm">{pattern.description}</span>
</PropertyRow>
)}
<PropertyRow label={__("Description source")}>
{pattern.commonTrackerPatternId
? (
<div className="flex items-center gap-2">
<Badge variant="info">{__("Common catalog")}</Badge>
<span className="font-mono text-xs text-txt-tertiary">{pattern.commonTrackerPatternId}</span>
</div>
)
: <Badge variant="neutral">{__("Manual")}</Badge>}
</PropertyRow>
<PropertyRow label={__("Excluded")}>
<span className="text-sm">{pattern.excluded ? __("Yes") : __("No")}</span>
</PropertyRow>

View File

@@ -48,6 +48,7 @@ const trackerPatternFragment = graphql`
maxAgeSeconds
excluded
lastMatchedAt
commonTrackerPatternId
cookieCategory {
id
name
@@ -287,6 +288,7 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
const typeBadge = getTrackerTypeBadge(pattern.trackerType, __);
const srcBadge = pattern.source ? getTrackerSourceBadge(pattern.source, __) : null;
const commonTrackerPatternId = pattern.commonTrackerPatternId;
return (
<Tr to={pattern.id} className={pattern.excluded ? "bg-txt-quaternary opacity-80 line-through" : undefined}>
@@ -294,8 +296,15 @@ export function TrackerPatternRow({ patternKey, connectionId }: TrackerPatternRo
<Badge variant={typeBadge.variant}>{typeBadge.label}</Badge>
</Td>
<Td>
<div className="flex flex-col min-w-0 max-w-xs">
<div className="flex flex-col min-w-0 max-w-xs gap-1">
<span className={pattern.excluded ? undefined : "font-medium"}>{pattern.displayName}</span>
{commonTrackerPatternId
? (
<span className="text-xs font-mono text-txt-tertiary truncate" title={commonTrackerPatternId}>
{commonTrackerPatternId}
</span>
)
: <span className="text-xs text-txt-tertiary">{__("Manual")}</span>}
{pattern.description && (
<span className="text-xs text-txt-tertiary wrap-break-word line-clamp-1">
{pattern.description}