mirror of
https://github.com/getmaxun/maxun.git
synced 2026-10-17 04:30:39 +08:00
fix: address coderabbit reviews
This commit is contained in:
@@ -750,7 +750,11 @@ export const BrowserWindow = () => {
|
||||
const content = candidate.field.data.trim().replace(/\s+/g, " ").toLowerCase();
|
||||
const columnSignature = getColumnSignature?.(candidate.field);
|
||||
|
||||
if (!seenContent.has(content) && (!columnSignature || !seenColumns.has(columnSignature))) {
|
||||
const isDuplicate = columnSignature
|
||||
? seenColumns.has(columnSignature)
|
||||
: seenContent.has(content);
|
||||
|
||||
if (!isDuplicate) {
|
||||
seenContent.add(content);
|
||||
if (columnSignature) {
|
||||
seenColumns.add(columnSignature);
|
||||
|
||||
@@ -339,7 +339,7 @@ export const RightSidePanel: React.FC<RightSidePanelProps> = ({ onFinishCapture
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [fieldsString, currentListStep?.listSelector, getList, extractDataClientSide]);
|
||||
}, [fieldsString, currentListStep?.id, currentListStep?.listSelector, getList, extractDataClientSide]);
|
||||
|
||||
const handleStartGetText = () => {
|
||||
const newActionId = `text-${generateUUID()}`;
|
||||
|
||||
@@ -4036,7 +4036,22 @@ class ClientSelectorGenerator {
|
||||
`contains(@class, ${this.wrapXPathValue(className)})`
|
||||
)
|
||||
.join(" and ");
|
||||
return `//table[${classPredicate}]/${sectionStep}/tr`;
|
||||
const matchingTables = Array.from(
|
||||
table.ownerDocument.querySelectorAll("table")
|
||||
).filter((candidate) =>
|
||||
tableClasses
|
||||
.slice(0, 3)
|
||||
.every((className) => candidate.classList.contains(className))
|
||||
);
|
||||
|
||||
if (matchingTables.length === 1) {
|
||||
return `//table[${classPredicate}]/${sectionStep}/tr`;
|
||||
}
|
||||
|
||||
const classMatchIndex = matchingTables.indexOf(table) + 1;
|
||||
if (classMatchIndex > 0) {
|
||||
return `(//table[${classPredicate}])[${classMatchIndex}]/${sectionStep}/tr`;
|
||||
}
|
||||
}
|
||||
|
||||
const tableIndex =
|
||||
|
||||
Reference in New Issue
Block a user