Parsers: Make parser cards source-oriented and explain duplicate matching #39

Closed
opened 2026-06-27 15:41:15 +02:00 by bullitt · 1 comment
Owner

Problem

  1. Parser cards use the sender domain as the title (e.g. "dhl.de") but the domain alone doesn't differentiate multiple parsers for the same domain. There are 3 separate "dhl.de" parser cards with no explanation of which one is active or how conflicts are resolved.

  2. The CardDescription shows "Created X ago" but not the keyword set that distinguishes each parser.

  3. There is no explanation of precedence when multiple parsers match the same domain.

Implementation

File: frontend/src/pages/Parsers.tsxParserCard component.

Fix 1 — Richer title

Change the CardTitle to include the keyword summary inline:

<CardTitle className="text-base flex items-center gap-2">
  <Cpu className="h-4 w-4 text-muted-foreground shrink-0" />
  <span className="truncate">{parser.sender_domain}</span>
  {keywords.length > 0 && (
    <span className="text-xs font-normal text-muted-foreground">· {keywords.join(", ")}</span>
  )}
</CardTitle>

Fix 2 — Duplicate warning

When rendering the parser list, group by domain and show a warning badge when a domain has more than one parser:

// In the Parsers page component, compute:
const domainCounts = parsers.reduce((acc, p) => {
  acc[p.sender_domain] = (acc[p.sender_domain] ?? 0) + 1
  return acc
}, {} as Record<string, number>)

// Pass isDuplicate to ParserCard:
<ParserCard
  key={p.id}
  parser={p}
  isDuplicate={domainCounts[p.sender_domain] > 1}
  onDelete={...}
/>

In ParserCard, show a note when isDuplicate:

{isDuplicate && (
  <p className="text-xs text-amber-600 mt-1">
    Multiple parsers for this domain  first keyword match wins.
  </p>
)}

Fix 3 — Subtitle

Change the page subtitle from:
"email domain rules for extracting shipment data"
To:
"Email templates — one per sender, used to extract tracking info from incoming emails"

Acceptance criteria

  • Card title includes domain and keyword summary inline
  • Parsers with duplicate domains show a disambiguation note
  • Page subtitle uses plain English

Brand identity alignment

Parsers are part of Trackbox's transparent source pipeline. The UI should present them as email/source extraction rules, not anonymous CPU cards.

Brand-compliant implementation notes

  • Prefer labels like Source domain, Keywords, Field map, and Last used where data exists.
  • Domain remains the primary identifier; keyword summary acts as the disambiguator.
  • Duplicate-domain warning should use calm operational copy: Multiple rules match this source. First matching keyword set is used.
  • Keep field maps monospace and collapsible as technical audit data.

Additional acceptance criteria

  • Users can understand why two parsers share a domain.
  • Parser cards reinforce source transparency and user control.
  • Duplicate warnings are visible but not alarmist.

Migrated from GitHub issue #18: https://github.com/bullitt186/trackbox/issues/18
Original author: @bullitt186
Original created: 2026-06-27T13:24:52Z
Original labels: ux

## Problem 1. Parser cards use the sender domain as the title (e.g. "dhl.de") but the domain alone doesn't differentiate multiple parsers for the same domain. There are 3 separate "dhl.de" parser cards with no explanation of which one is active or how conflicts are resolved. 2. The `CardDescription` shows "Created X ago" but not the keyword set that distinguishes each parser. 3. There is no explanation of precedence when multiple parsers match the same domain. ## Implementation File: `frontend/src/pages/Parsers.tsx` — `ParserCard` component. ### Fix 1 — Richer title Change the `CardTitle` to include the keyword summary inline: ```tsx <CardTitle className="text-base flex items-center gap-2"> <Cpu className="h-4 w-4 text-muted-foreground shrink-0" /> <span className="truncate">{parser.sender_domain}</span> {keywords.length > 0 && ( <span className="text-xs font-normal text-muted-foreground">· {keywords.join(", ")}</span> )} </CardTitle> ``` ### Fix 2 — Duplicate warning When rendering the parser list, group by domain and show a warning badge when a domain has more than one parser: ```tsx // In the Parsers page component, compute: const domainCounts = parsers.reduce((acc, p) => { acc[p.sender_domain] = (acc[p.sender_domain] ?? 0) + 1 return acc }, {} as Record<string, number>) // Pass isDuplicate to ParserCard: <ParserCard key={p.id} parser={p} isDuplicate={domainCounts[p.sender_domain] > 1} onDelete={...} /> ``` In `ParserCard`, show a note when `isDuplicate`: ```tsx {isDuplicate && ( <p className="text-xs text-amber-600 mt-1"> Multiple parsers for this domain — first keyword match wins. </p> )} ``` ### Fix 3 — Subtitle Change the page subtitle from: `"email domain rules for extracting shipment data"` To: `"Email templates — one per sender, used to extract tracking info from incoming emails"` ## Acceptance criteria - Card title includes domain and keyword summary inline - Parsers with duplicate domains show a disambiguation note - Page subtitle uses plain English ## Brand identity alignment Parsers are part of Trackbox's transparent source pipeline. The UI should present them as email/source extraction rules, not anonymous CPU cards. ## Brand-compliant implementation notes - Prefer labels like `Source domain`, `Keywords`, `Field map`, and `Last used` where data exists. - Domain remains the primary identifier; keyword summary acts as the disambiguator. - Duplicate-domain warning should use calm operational copy: `Multiple rules match this source. First matching keyword set is used.` - Keep field maps monospace and collapsible as technical audit data. ## Additional acceptance criteria - Users can understand why two parsers share a domain. - Parser cards reinforce source transparency and user control. - Duplicate warnings are visible but not alarmist. --- Migrated from GitHub issue #18: https://github.com/bullitt186/trackbox/issues/18 Original author: @bullitt186 Original created: 2026-06-27T13:24:52Z Original labels: ux
bullitt changed title from Parsers: Show domain + keyword summary as card title, explain duplicate parsers to Parsers: Make parser cards source-oriented and explain duplicate matching 2026-06-27 15:46:22 +02:00
Author
Owner

Implemented in commit bd6b0e7. Parser cards now show a keyword summary inline in the title (first 2 keywords with ellipsis for more). When a domain appears more than once, an amber note reads 'Multiple parsers for this domain — first keyword match wins.' This explains deduplication behaviour without hiding it. Page subtitle updated to 'email templates — one per sender, used to extract tracking info from incoming emails'.

Implemented in commit bd6b0e7. Parser cards now show a keyword summary inline in the title (first 2 keywords with ellipsis for more). When a domain appears more than once, an amber note reads 'Multiple parsers for this domain — first keyword match wins.' This explains deduplication behaviour without hiding it. Page subtitle updated to 'email templates — one per sender, used to extract tracking info from incoming emails'.
Sign in to join this conversation.
No labels
arch
harness
security
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bullitt/trackbox#39
No description provided.