refactor(editor): Boost n8n Form Trigger in nodes-panel search results (#10294)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions

This commit is contained in:
Iván Ovejero 2024-08-05 17:52:46 +02:00 committed by GitHub
parent c0bdf3b719
commit 74e154b130
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 5 deletions

View file

@ -139,10 +139,12 @@ function fuzzyMatchRecursive(
if (matched) {
outScore = 100;
// Apply leading letter penalty
let penalty = LEADING_LETTER_PENALTY * matches[0];
penalty = penalty < MAX_LEADING_LETTER_PENALTY ? MAX_LEADING_LETTER_PENALTY : penalty;
outScore += penalty;
// Apply leading letter penalty (if not n8n-prefixed)
if (!target.toLowerCase().startsWith('n8n')) {
let penalty = LEADING_LETTER_PENALTY * matches[0];
penalty = penalty < MAX_LEADING_LETTER_PENALTY ? MAX_LEADING_LETTER_PENALTY : penalty;
outScore += penalty;
}
//Apply unmatched penalty
const unmatched = target.length - nextMatch;

View file

@ -3,7 +3,7 @@
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Core Nodes"],
"alias": ["_Form", "form", "table", "submit", "post"],
"alias": ["table", "submit", "post"],
"resources": {
"primaryDocumentation": [
{