Skip to content

Extract highlight match/trigger logic into Core HighlightEvaluator#643

Merged
Hirogen merged 5 commits into
Developmentfrom
highlight-evaluator-extraction
Jun 26, 2026
Merged

Extract highlight match/trigger logic into Core HighlightEvaluator#643
Hirogen merged 5 commits into
Developmentfrom
highlight-evaluator-extraction

Conversation

@Hirogen

@Hirogen Hirogen commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

The highlight-match semantics lived only inside LogWindow and had been copy-pasted into HighlightBookmarkScanner (its own comment admitted "Replicates the logic from LogWindow.CheckHighlightEntryMatch"), so two copies had to be kept in sync by hand and the logic had no direct test surface.

Add a pure LogExpert.Core HighlightEvaluator with IsMatch, FindMatchingEntries, and GetTriggerActions (returning a HighlightActions record struct). Route both consumers through it:

  • HighlightBookmarkScanner: delete its duplicated CheckHighlightEntryMatch, call HighlightEvaluator.IsMatch.
  • LogWindow: FindMatchingHighlightEntries becomes a thin lock-wrapper over the evaluator; GetHighlightActions and the private CheckHighlightEntryMatch are removed; GetHighlightEntryMatches and FindHighlightEntry use HighlightEvaluator.IsMatch.

The evaluator reports the decision only; side effects (Audio Alert, Set Bookmark, Stop Tail) stay at the LogWindow call sites, "Audio Alert fires only on the tail trigger path" invariant remains structural and cannot leak onto the bulk/scanner/paint paths.

12 new tests pin match/find/action behavior plus the null-arg guards.

BRUNER Patrick and others added 2 commits June 25, 2026 17:51
The highlight-match semantics lived only inside LogWindow and had been copy-pasted into HighlightBookmarkScanner (its own comment admitted "Replicates the logic from LogWindow.CheckHighlightEntryMatch"), so two copies had to be kept in sync by hand and the logic had no direct test surface.

Add a pure LogExpert.Core HighlightEvaluator with IsMatch, FindMatchingEntries, and GetTriggerActions (returning a HighlightActions record struct). Route both consumers through it:

- HighlightBookmarkScanner: delete its duplicated CheckHighlightEntryMatch, call HighlightEvaluator.IsMatch.
- LogWindow: FindMatchingHighlightEntries becomes a thin lock-wrapper over the evaluator; GetHighlightActions and the private CheckHighlightEntryMatch are removed; GetHighlightEntryMatches and FindHighlightEntry use HighlightEvaluator.IsMatch.

The evaluator reports the decision only; side effects (Audio Alert, Set Bookmark, Stop Tail) stay at the LogWindow call sites, "Audio Alert fires only on the tail trigger path" invariant remains structural and cannot leak onto the bulk/scanner/paint paths.

12 new tests pin match/find/action behavior plus the null-arg guards.
Comment thread src/LogExpert.Core/Classes/Highlight/HighlightEvaluator.cs Fixed
@Hirogen Hirogen merged commit b22ecfa into Development Jun 26, 2026
1 check passed
@Hirogen Hirogen deleted the highlight-evaluator-extraction branch June 26, 2026 06:17
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