refactor: remove HTML report export and implement PDF export options in PDF comparison tool

- Deleted the exportCompareHtmlReport function and its related imports.
- Introduced a dropdown menu for exporting comparison results as PDFs with multiple modes (split, alternating, left, right).
- Updated the comparison logic to utilize caching for page models and comparison results.
- Refactored rendering functions to improve code organization and maintainability.
- Enhanced UI elements for better user experience during PDF export.
This commit is contained in:
alam00000
2026-03-09 23:26:52 +05:30
parent 0fe94795cc
commit d2a1450bc0
15 changed files with 953 additions and 526 deletions

View File

@@ -1,8 +1,5 @@
import type { ComparePagePair, ComparePageSignature } from '../types.ts';
function tokenize(text: string) {
return new Set(text.split(/\s+/).filter(Boolean));
}
import { tokenizeTextAsSet } from './text-normalization.ts';
function similarityScore(
left: ComparePageSignature,
@@ -16,8 +13,8 @@ function similarityScore(
return 0.08;
}
const leftTokens = tokenize(left.plainText);
const rightTokens = tokenize(right.plainText);
const leftTokens = tokenizeTextAsSet(left.plainText);
const rightTokens = tokenizeTextAsSet(right.plainText);
const union = new Set([...leftTokens, ...rightTokens]);
let intersectionCount = 0;