Skip to content

фикс#44

Merged
mmeerrkkaa merged 2 commits intomasterfrom
dev
Nov 27, 2025
Merged

фикс#44
mmeerrkkaa merged 2 commits intomasterfrom
dev

Conversation

@mmeerrkkaa
Copy link
Copy Markdown
Member

@mmeerrkkaa mmeerrkkaa commented Nov 27, 2025

Summary by Sourcery

Унификация обработки плейсхолдеров переменных между нодами, расширение конфигурации HTTP-запросов, улучшение работы с клавиатурой в визуальном редакторе и повышение версии проекта до 1.23.0 с обновлённым changelog.

New Features:

  • Добавлена глобальная поддержка извлечения плейсхолдеров вида {varName} из данных ноды для автоматической генерации соответствующих входных пинов-джокеров (wildcard).
  • Расширен узел действия HTTP request: добавлены входы для query-параметров и заголовков в виде объекта, а также поддержка плейсхолдеров переменных в URL и других строковых полях.

Bug Fixes:

  • Обеспечена корректная работа сочетаний клавиш копирования, вставки и удаления в визуальном редакторе с последними выбранными нодами/рёбрами, а также поддержка удаления выбранных соединений.
  • Централизована и исправлена подстановка переменных в строках за счёт выполнения замены в движке выполнения графа при вычислении значений пинов, что упростило реализации отдельных нод.

Enhancements:

  • Обновлены UI-подсказки для action-нод и нод строковых литералов, чтобы лучше объяснить поддержку переменных {varName}.
  • Проведён рефакторинг строковых нод и нод отправки сообщений для использования централизованной логики подстановки переменных вместо дублирования кода парсинга.

Build:

  • Повышена версия пакета с 1.22.0 до 1.23.0.

Documentation:

  • Добавлена запись для версии 1.23.0 в changelog с описанием новых возможностей и исправлений.
Original summary in English

Summary by Sourcery

Unify variable placeholder handling across nodes, enhance HTTP request configuration, improve visual editor keyboard interactions, and bump the project version to 1.23.0 with updated changelog.

New Features:

  • Add global support for extracting {varName} placeholders from node data to auto-generate corresponding wildcard input pins.
  • Extend the HTTP request action node with query parameter and object-based headers inputs, and support variable placeholders in the URL and other string fields.

Bug Fixes:

  • Ensure copy, paste, and delete keyboard shortcuts in the visual editor operate on the latest selected nodes/edges and support deleting selected connections.
  • Centralize and fix variable substitution in strings by performing replacement in the graph execution engine when resolving pin values, simplifying individual node implementations.

Enhancements:

  • Update action and string literal nodes’ UI hints to better communicate support for {varName} variables.
  • Refactor string and send message nodes to rely on centralized variable substitution logic instead of duplicating parsing code.

Build:

  • Bump package version from 1.22.0 to 1.23.0.

Documentation:

  • Add a 1.23.0 entry to the changelog describing new features and fixes.

Summary by CodeRabbit

Выпуск 1.23.0

  • Новые возможности

    • Добавлена поддержка переменных синтаксис {varName} в текстовых полях и сообщениях
    • HTTP запрос: разделены параметры запроса и заголовки на отдельные поля типа Object
    • Улучшена работа копирования и удаления графов в редакторе
  • Исправления ошибок

    • Исправлены различные ошибки в обработке узлов и переменных

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 27, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Выпуск версии 1.23.0 с централизованной системой подстановки переменных в ядре графа, обновленными определениями действий (HTTP-запрос, отправка сообщений, строковый литерал), упрощением логики вычисления входов на фронтенде и улучшением обработки клавиатурных команд копирования и удаления узлов в визуальном редакторе.

Changes

Cohort / File(s) Change Summary
Версионирование и Журнал изменений
CHANGELOG.md, package.json
Добавлена запись версии 1.23.0 с описанием исправлений и новых возможностей; версия в package.json обновлена с 1.22.0 на 1.23.0.
Ядро: Подстановка переменных
backend/src/core/GraphExecutionEngine.js
Добавлен механизм автоматической замены переменных {varName} в строках при чтении значений пинов через новый вспомогательный метод _replaceVariablesInString, который разрешает значения из пинов var_<VarName>.
Конфигурация и регистрация узлов действий
backend/src/core/node-registries/actions.js
Удален флаг dynamicPins из узла action:send_message; в узле action:http_request заменено поле заголовков String на два отдельных поля типа Object: "Query Params" и "Headers".
Реализация узлов действий
backend/src/core/nodes/actions/http_request.js, backend/src/core/nodes/actions/send_message.js, backend/src/core/nodes/data/string_literal.js
Добавлена обработка queryParams; обновлена обработка заголовков с поддержкой JSON и объектных форматов; упрощена логика подстановки переменных за счет использования resolvePinValue.
Фронтенд: Вспомогательные функции и определения узлов
frontend/src/components/visual-editor/core/registry/NodeDefinition.js
Добавлена функция extractVariables() для парсинга переменных из текста; модифицирован метод getInputs() для автоматического создания дополнительных вайлдкард-пинов на основе обнаруженных переменных {varName}.
Фронтенд: Определения действий
frontend/src/components/visual-editor/nodes/action/actionHttpRequest.js, frontend/src/components/visual-editor/nodes/action/actionSendMessage.js, frontend/src/components/visual-editor/nodes/string/stringLiteral.js
Обновлены описания узлов и плейсхолдеры с указанием поддержки переменных; в actionHttpRequest добавлены входы queryParams и headers; в actionSendMessage и stringLiteral переведены входы с динамического расчета на статический массив.
Фронтенд: Обработка клавиатурных команд
frontend/src/pages/Bot/VisualEditorPage.jsx
Улучшена логика обработки клавиш: операция копирования работает с наведенным узлом при отсутствии выделения; удаление теперь поддерживает как выделенные узлы и рёбра, так и наведенный узел; состояние графа получается из хранилища внутри обработчика.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45–60 minutes

Области повышенного внимания:

  • GraphExecutionEngine.js — логика замены переменных в _replaceVariablesInString должна быть проверена на предмет обработки циклических ссылок и граничных случаев с вложенными переменными.
  • VisualEditorPage.jsx — сложная логика обработки состояния между выделением, наведением, копированием и удалением требует тщательной проверки потоков выполнения и побочных эффектов.
  • Координация backend и frontend — убедитесь, что определения входов на фронтенде (статические vs динамические) согласованы с логикой исполнения узлов на бэкенде, особенно для queryParams и headers в action:http_request.
  • Обработка ошибок JSON парсинга — в http_request.js и send_message.js добавлены попытки парсинга JSON; проверьте логирование и fallback-поведение при ошибках разбора.

Poem

🐰✨ Переменные теперь в {скобочках} живут,
Централизованно друзья их подменяют,
Узлы с входами статичными блистают,
Копирование-удаленье точно вот берут,
Версия 1.23 с добром приходит вмиг! 🎉

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b0ffbd1 and bf9e5f7.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • CHANGELOG.md (1 hunks)
  • backend/src/core/GraphExecutionEngine.js (1 hunks)
  • backend/src/core/node-registries/actions.js (1 hunks)
  • backend/src/core/nodes/actions/http_request.js (1 hunks)
  • backend/src/core/nodes/actions/send_message.js (1 hunks)
  • backend/src/core/nodes/data/string_literal.js (1 hunks)
  • frontend/src/components/visual-editor/core/registry/NodeDefinition.js (2 hunks)
  • frontend/src/components/visual-editor/nodes/action/actionHttpRequest.js (3 hunks)
  • frontend/src/components/visual-editor/nodes/action/actionSendMessage.js (1 hunks)
  • frontend/src/components/visual-editor/nodes/string/stringLiteral.js (1 hunks)
  • frontend/src/pages/Bot/VisualEditorPage.jsx (2 hunks)
  • package.json (1 hunks)

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Nov 27, 2025

Руководство для ревьюера

Рефакторинг обработки плейсхолдеров переменных для универсального использования во всех нодах, расширение возможностей ноды HTTP-запроса, улучшение взаимодействия с клавиатурой в визуальном редакторе и обновление версионирования/чейнджлога для релиза 1.23.0.

Диаграмма последовательности для универсального разрешения плейсхолдеров переменных в resolvePinValue

sequenceDiagram
  participant NodeInstance
  participant GraphExecutionEngine
  participant VariablePins

  NodeInstance->>GraphExecutionEngine: resolvePinValue(node, pinId, defaultValue)
  alt pin is connected to another node
    GraphExecutionEngine->>GraphExecutionEngine: evaluateOutputPin(sourceNode, sourcePinId, defaultValue)
    GraphExecutionEngine-->>NodeInstance: valueFromConnection
  else pin is local data field
    GraphExecutionEngine->>GraphExecutionEngine: read node.data[pinId] or defaultValue
    GraphExecutionEngine->>GraphExecutionEngine: check if value is string and contains {
    alt value contains placeholders
      GraphExecutionEngine->>GraphExecutionEngine: _replaceVariablesInString(text, node)
      loop for each {varName}
        GraphExecutionEngine->>VariablePins: resolvePinValue(node, var_varName, "")
        VariablePins-->>GraphExecutionEngine: varValue
        GraphExecutionEngine->>GraphExecutionEngine: replace {varName} with varValue in text
      end
      GraphExecutionEngine-->>NodeInstance: valueWithReplacedVariables
    else no placeholders
      GraphExecutionEngine-->>NodeInstance: originalValue
    end
  end
Loading

Диаграмма последовательности для ноды HTTP-запроса с query-параметрами и заголовками

sequenceDiagram
  participant GraphExecutionEngine
  participant HttpRequestActionNode
  participant ExternalHttpService

  GraphExecutionEngine->>HttpRequestActionNode: execute(node, context, helpers)
  activate HttpRequestActionNode

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, url, "")
  GraphExecutionEngine-->>HttpRequestActionNode: url

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, method, node.data.method or GET)
  GraphExecutionEngine-->>HttpRequestActionNode: method

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, queryParams, null)
  GraphExecutionEngine-->>HttpRequestActionNode: queryParamsInput

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, headers, null)
  GraphExecutionEngine-->>HttpRequestActionNode: headersInput

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, body, "")
  GraphExecutionEngine-->>HttpRequestActionNode: body

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, timeout, 5000)
  GraphExecutionEngine-->>HttpRequestActionNode: timeout

  alt queryParamsInput exists and is valid
    HttpRequestActionNode->>HttpRequestActionNode: parse queryParamsInput to params
    HttpRequestActionNode->>HttpRequestActionNode: append params to url as ?key=value
  else invalid or absent
    HttpRequestActionNode->>HttpRequestActionNode: keep original url
  end

  alt headersInput exists and is valid
    HttpRequestActionNode->>HttpRequestActionNode: parse headersInput to headers object
  else invalid or absent
    HttpRequestActionNode->>HttpRequestActionNode: use empty headers
  end

  HttpRequestActionNode->>ExternalHttpService: HTTP method url with headers, body, timeout
  ExternalHttpService-->>HttpRequestActionNode: HTTP response

  HttpRequestActionNode-->>GraphExecutionEngine: store response in outputs
  deactivate HttpRequestActionNode
Loading

Обновлённая диаграмма классов для обработки переменных в NodeDefinition и GraphExecutionEngine

classDiagram
  class NodeDefinition {
    +computeInputs(data, context)
    +getInputs(data, context)
  }

  class VariableExtractor {
    +extractVariables(text) string[]
  }

  class GraphExecutionEngine {
    +resolvePinValue(node, pinId, defaultValue) any
    +evaluateOutputPin(node, pinId, defaultValue) any
    -_replaceVariablesInString(text, node) string
    -activeGraph
  }

  class HttpRequestActionNode {
    +execute(node, context, helpers) Promise
  }

  class SendMessageActionNode {
    +execute(node, context, helpers) Promise
  }

  class StringLiteralNode {
    +evaluate(node, pinId, context, helpers) Promise
  }

  VariableExtractor <.. NodeDefinition : uses for
  GraphExecutionEngine <.. VariableExtractor : uses for

  GraphExecutionEngine <.. HttpRequestActionNode : helper resolvePinValue
  GraphExecutionEngine <.. SendMessageActionNode : helper resolvePinValue
  GraphExecutionEngine <.. StringLiteralNode : helper resolvePinValue

  NodeDefinition <|-- HttpRequestActionNode
  NodeDefinition <|-- SendMessageActionNode
  NodeDefinition <|-- StringLiteralNode
Loading

Изменения на уровне файлов

Change Details Files
Централизовать и обобщить извлечение плейсхолдеров {varName} в динамические входные пины для всех нод.
  • Добавить общий helper extractVariables и постобработку в NodeDefinition.getInputs для сканирования данных ноды на наличие шаблонов {varName}.
  • Автоматически добавлять wildcard-пины var_* с описаниями для всех обнаруженных переменных, если они ещё не определены в computeInputs.
  • Упростить реализации computeInputs в нодах, которые ранее обрабатывали парсинг переменных вручную (нода действия send_message и нода string literal).
frontend/src/components/visual-editor/core/registry/NodeDefinition.js
frontend/src/components/visual-editor/nodes/action/actionSendMessage.js
frontend/src/components/visual-editor/nodes/string/stringLiteral.js
Переместить логику подстановки строковых переменных в движок выполнения графа, чтобы resolvePinValue прозрачно разворачивал плейсхолдеры {varName}.
  • Расширить resolvePinValue, чтобы он определял строковые значения с { и вызывал новый приватный helper _replaceVariablesInString.
  • Реализовать _replaceVariablesInString для сканирования текста на {varName}, разрешения соответствующих пинов var_* и замены их в строке.
  • Удалить нод-специфичную замену плейсхолдеров из реализаций backend-нод string_literal и send_message и полагаться на семантику resolvePinValue.
  • Отключить флаг dynamicPins в backend-регистрации send_message, поскольку динамические пины теперь выводятся во frontend через NodeDefinition.
backend/src/core/GraphExecutionEngine.js
backend/src/core/nodes/data/string_literal.js
backend/src/core/nodes/actions/send_message.js
backend/src/core/node-registries/actions.js
Улучшить UX и поведение ноды HTTP-запроса за счёт поддержки переменных, query-параметров и структурированных заголовков.
  • Обновить описание/placeholder’ы во frontend-ноде HTTP-запроса, чтобы задокументировать поддержку {varName} и пример URL с плейсхолдерами.
  • Добавить входы queryParams и headers типа Object во frontend-ноде с соответствующими описаниями и placeholder’ами.
  • Изменить backend-исполнитель ноды http_request, чтобы он принимал headers и queryParams как JSON-строки или объекты, парсил их и строил финальный URL с query-параметрами через URL API.
  • Обновить backend-регистрацию пинов, чтобы экспонировать queryParams и headers как типы Object вместо одного входа headers с JSON-строкой.
frontend/src/components/visual-editor/nodes/action/actionHttpRequest.js
backend/src/core/nodes/actions/http_request.js
backend/src/core/node-registries/actions.js
Улучшить взаимодействие с клавиатурой в визуальном редакторе для копирования/вставки и удаления нод и рёбер.
  • Удалить debug-логирование из обработчика keydown и избегать использования устаревшего состояния нод/рёбер из замыкания, считывая их из useVisualEditorStore внутри обработчика.
  • При Ctrl/Cmd+C использовать текущие ноды из стора для логики выбора, при этом по-прежнему поддерживая копирование наведённой ноды, если ничего не выбрано.
  • При Delete/Backspace вызвать preventDefault, удалить все выбранные ноды через onNodesChange, в противном случае удалить наведённую ноду, если ничего не выбрано, а также удалить все выбранные рёбра через onEdgesChange.
frontend/src/pages/Bot/VisualEditorPage.jsx
Обновление метаданных релиза для версии 1.23.0.
  • Добавить секцию 1.23.0 в CHANGELOG со списком исправлений и новых возможностей.
  • Повысить версию в package.json с 1.22.0 до 1.23.0 и тем самым обновить метаданные версии в lockfile.
CHANGELOG.md
package.json
package-lock.json

Подсказки и команды

Взаимодействие с Sourcery

  • Запустить новое ревью: Оставьте комментарий @sourcery-ai review в pull request.
  • Продолжить обсуждение: Отвечайте напрямую на комментарии ревью от Sourcery.
  • Создать GitHub-issue из комментария ревью: Попросите Sourcery создать issue из комментария ревью, ответив на него. Также можно ответить на комментарий ревью с @sourcery-ai issue, чтобы создать issue на его основе.
  • Сгенерировать заголовок pull request: Напишите @sourcery-ai в любом месте заголовка pull request, чтобы сгенерировать заголовок в любой момент. Также можно оставить комментарий @sourcery-ai title в pull request, чтобы (пере)сгенерировать заголовок в любой момент.
  • Сгенерировать summary pull request: Напишите @sourcery-ai summary в любом месте тела pull request, чтобы сгенерировать summary именно там, где вам нужно. Также можно оставить комментарий @sourcery-ai summary в pull request, чтобы (пере)сгенерировать summary в любой момент.
  • Сгенерировать руководство для ревьюера: Оставьте комментарий @sourcery-ai guide в pull request, чтобы (пере)сгенерировать руководство для ревьюера в любой момент.
  • Разрешить все комментарии Sourcery: Оставьте комментарий @sourcery-ai resolve в pull request, чтобы пометить все комментарии Sourcery как разрешённые. Полезно, если вы уже всё исправили и не хотите их больше видеть.
  • Отклонить все ревью Sourcery: Оставьте комментарий @sourcery-ai dismiss в pull request, чтобы отклонить все существующие ревью от Sourcery. Особенно полезно, если вы хотите начать с чистого листа — не забудьте затем оставить комментарий @sourcery-ai review, чтобы запустить новое ревью!

Настройка опыта работы

Зайдите в свою панель управления, чтобы:

  • Включать или отключать функции ревью, такие как автоматически сгенерированное Sourcery summary для pull request, руководство для ревьюера и другие.
  • Изменять язык ревью.
  • Добавлять, удалять или редактировать пользовательские инструкции для ревью.
  • Настраивать другие параметры ревью.

Получение помощи

Original review guide in English

Reviewer's Guide

Refactors variable placeholder handling to be generic across nodes, enhances HTTP request node capabilities, improves visual editor keyboard interactions, and updates versioning/changelog for the 1.23.0 release.

Sequence diagram for generic variable placeholder resolution in resolvePinValue

sequenceDiagram
  participant NodeInstance
  participant GraphExecutionEngine
  participant VariablePins

  NodeInstance->>GraphExecutionEngine: resolvePinValue(node, pinId, defaultValue)
  alt pin is connected to another node
    GraphExecutionEngine->>GraphExecutionEngine: evaluateOutputPin(sourceNode, sourcePinId, defaultValue)
    GraphExecutionEngine-->>NodeInstance: valueFromConnection
  else pin is local data field
    GraphExecutionEngine->>GraphExecutionEngine: read node.data[pinId] or defaultValue
    GraphExecutionEngine->>GraphExecutionEngine: check if value is string and contains {
    alt value contains placeholders
      GraphExecutionEngine->>GraphExecutionEngine: _replaceVariablesInString(text, node)
      loop for each {varName}
        GraphExecutionEngine->>VariablePins: resolvePinValue(node, var_varName, "")
        VariablePins-->>GraphExecutionEngine: varValue
        GraphExecutionEngine->>GraphExecutionEngine: replace {varName} with varValue in text
      end
      GraphExecutionEngine-->>NodeInstance: valueWithReplacedVariables
    else no placeholders
      GraphExecutionEngine-->>NodeInstance: originalValue
    end
  end
Loading

Sequence diagram for HTTP request node with query params and headers

sequenceDiagram
  participant GraphExecutionEngine
  participant HttpRequestActionNode
  participant ExternalHttpService

  GraphExecutionEngine->>HttpRequestActionNode: execute(node, context, helpers)
  activate HttpRequestActionNode

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, url, "")
  GraphExecutionEngine-->>HttpRequestActionNode: url

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, method, node.data.method or GET)
  GraphExecutionEngine-->>HttpRequestActionNode: method

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, queryParams, null)
  GraphExecutionEngine-->>HttpRequestActionNode: queryParamsInput

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, headers, null)
  GraphExecutionEngine-->>HttpRequestActionNode: headersInput

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, body, "")
  GraphExecutionEngine-->>HttpRequestActionNode: body

  HttpRequestActionNode->>GraphExecutionEngine: resolvePinValue(node, timeout, 5000)
  GraphExecutionEngine-->>HttpRequestActionNode: timeout

  alt queryParamsInput exists and is valid
    HttpRequestActionNode->>HttpRequestActionNode: parse queryParamsInput to params
    HttpRequestActionNode->>HttpRequestActionNode: append params to url as ?key=value
  else invalid or absent
    HttpRequestActionNode->>HttpRequestActionNode: keep original url
  end

  alt headersInput exists and is valid
    HttpRequestActionNode->>HttpRequestActionNode: parse headersInput to headers object
  else invalid or absent
    HttpRequestActionNode->>HttpRequestActionNode: use empty headers
  end

  HttpRequestActionNode->>ExternalHttpService: HTTP method url with headers, body, timeout
  ExternalHttpService-->>HttpRequestActionNode: HTTP response

  HttpRequestActionNode-->>GraphExecutionEngine: store response in outputs
  deactivate HttpRequestActionNode
Loading

Updated class diagram for NodeDefinition and GraphExecutionEngine variable handling

classDiagram
  class NodeDefinition {
    +computeInputs(data, context)
    +getInputs(data, context)
  }

  class VariableExtractor {
    +extractVariables(text) string[]
  }

  class GraphExecutionEngine {
    +resolvePinValue(node, pinId, defaultValue) any
    +evaluateOutputPin(node, pinId, defaultValue) any
    -_replaceVariablesInString(text, node) string
    -activeGraph
  }

  class HttpRequestActionNode {
    +execute(node, context, helpers) Promise
  }

  class SendMessageActionNode {
    +execute(node, context, helpers) Promise
  }

  class StringLiteralNode {
    +evaluate(node, pinId, context, helpers) Promise
  }

  VariableExtractor <.. NodeDefinition : uses for
  GraphExecutionEngine <.. VariableExtractor : uses for

  GraphExecutionEngine <.. HttpRequestActionNode : helper resolvePinValue
  GraphExecutionEngine <.. SendMessageActionNode : helper resolvePinValue
  GraphExecutionEngine <.. StringLiteralNode : helper resolvePinValue

  NodeDefinition <|-- HttpRequestActionNode
  NodeDefinition <|-- SendMessageActionNode
  NodeDefinition <|-- StringLiteralNode
Loading

File-Level Changes

Change Details Files
Centralize and generalize extraction of {varName} placeholders into dynamic input pins for all nodes.
  • Add shared extractVariables helper and post-processing in NodeDefinition.getInputs to scan node data for {varName} patterns.
  • Auto-append wildcard var_* pins with descriptions for all detected variables if they are not already defined by computeInputs.
  • Simplify computeInputs implementations in nodes that previously handled variable parsing manually (send_message action node and string literal node).
frontend/src/components/visual-editor/core/registry/NodeDefinition.js
frontend/src/components/visual-editor/nodes/action/actionSendMessage.js
frontend/src/components/visual-editor/nodes/string/stringLiteral.js
Move string variable substitution logic into the graph execution engine so resolvePinValue transparently expands {varName} placeholders.
  • Extend resolvePinValue to detect string values with { and call a new private _replaceVariablesInString helper.
  • Implement replaceVariablesInString to scan text for {varName}, resolve corresponding var* pins, and replace them in the string.
  • Remove node-specific placeholder replacement from string_literal and send_message backend node implementations and rely on resolvePinValue semantics.
  • Disable dynamicPins flag in send_message backend registry entry since dynamic pins are now inferred by frontend NodeDefinition.
backend/src/core/GraphExecutionEngine.js
backend/src/core/nodes/data/string_literal.js
backend/src/core/nodes/actions/send_message.js
backend/src/core/node-registries/actions.js
Enhance HTTP request node UX and behavior with variable support, query parameters, and structured headers.
  • Update frontend HTTP request node description/placeholders to document {varName} support and example URL with placeholders.
  • Add queryParams and headers Object-type inputs to the frontend node with appropriate descriptions and placeholders.
  • Change backend http_request node executor to accept headers and queryParams as either JSON strings or objects, parse them, and build the final URL with query parameters via URL API.
  • Update backend registry pins to expose queryParams and headers as Object types instead of a single JSON-string headers input.
frontend/src/components/visual-editor/nodes/action/actionHttpRequest.js
backend/src/core/nodes/actions/http_request.js
backend/src/core/node-registries/actions.js
Improve keyboard interactions in the visual editor for copy/paste and deletion of nodes and edges.
  • Remove debug logging from keydown handler and avoid using stale closure state for nodes/edges by reading from useVisualEditorStore inside the handler.
  • On Ctrl/Cmd+C, use current store nodes for selection logic while still supporting copying hovered node when none are selected.
  • On Delete/Backspace, prevent default, delete all selected nodes via onNodesChange, fall back to deleting hovered node if nothing is selected, and also delete all selected edges via onEdgesChange.
frontend/src/pages/Bot/VisualEditorPage.jsx
Release metadata update for version 1.23.0.
  • Add 1.23.0 section to CHANGELOG with bugfix and feature bullets.
  • Bump package.json version from 1.22.0 to 1.23.0 and implicitly update lockfile version metadata.
CHANGELOG.md
package.json
package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@mmeerrkkaa mmeerrkkaa merged commit 7bf46e8 into master Nov 27, 2025
3 of 5 checks passed
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет! Я посмотрел твои изменения — вот несколько замечаний:

  • В NodeDefinition.getInputs ты изменяешь массив, возвращаемый из computeInputs, добавляя в него динамические var‑пины через push. Если какая‑то нода переиспользует общий константный массив для computeInputs, это приведёт к «протеканию» пинов между инстансами. Подумай о том, чтобы клонировать массив перед модификацией (inputs = [...this.computeInputs(...)]) или явно зафиксировать контракт, что computeInputs всегда должен возвращать новый массив.
  • Новое автоматическое развёртывание переменных в resolvePinValue/_replaceVariablesInString может зациклиться, если сам пин var_... содержит плейсхолдеры {varName} (например, значение для var_x содержит {x}), потому что resolvePinValue снова вызывается для той же логической переменной. Безопаснее было бы отключать замену для пинов var_ или передавать флаг, запрещающий повторный вход в подстановку.
  • Обобщённое извлечение переменных в NodeDefinition.getInputs теперь добавляет пины var_* для любого строкового поля в data. Это может затронуть ноды, которые концептуально не поддерживают шаблонные переменные. Рассмотри вариант сделать это поведение опциональным через флаг в определении ноды, а не применять его глобально ко всем нодам.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `NodeDefinition.getInputs`, you mutate the array returned from `computeInputs` by pushing dynamic var pins; if any node reuses a shared constant array for `computeInputs` this will leak pins across instances—consider cloning (`inputs = [...this.computeInputs(...)]`) before mutation or clearly enforcing that `computeInputs` must always return a fresh array.
- The new automatic variable expansion in `resolvePinValue`/`_replaceVariablesInString` can recurse indefinitely if a `var_...` pin itself contains `{varName}` placeholders (e.g. `value` for `var_x` contains `{x}`) because `resolvePinValue` is called again on the same logical variable; it would be safer to short‑circuit replacement for `var_` pins or pass a flag to avoid re‑entering substitution.
- The generic variable extraction in `NodeDefinition.getInputs` now adds `var_*` pins for any string field in `data`; this may affect nodes that don’t conceptually support template variables—consider making this behavior opt‑in via a flag on the node definition instead of applying it to all nodes globally.

## Individual Comments

### Comment 1
<location> `frontend/src/components/visual-editor/core/registry/NodeDefinition.js:58-65` </location>
<code_context>
   getInputs(data, context = {}) {
+    let inputs = [];
+
     if (this.computeInputs) {
-      return this.computeInputs(data, context);
+      inputs = this.computeInputs(data, context);
     }
-    return [];
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Guard against computeInputs returning a falsy or non-array value.

Since `inputs` is used with `.find`/`.push`, a non-array or `undefined` return from `computeInputs` will cause a runtime error. Consider defaulting to an empty array (e.g. `inputs = this.computeInputs(data, context) || [];`) and optionally validating that the result is actually an array to guard against misbehaving implementations.

```suggestion
  getInputs(data, context = {}) {
    let inputs = [];

    if (this.computeInputs) {
      const computedInputs = this.computeInputs(data, context);
      inputs = Array.isArray(computedInputs) ? computedInputs : [];
    }

    const allVars = new Set();
```
</issue_to_address>

### Comment 2
<location> `backend/src/core/nodes/actions/http_request.js:25-29` </location>
<code_context>
+                ? JSON.parse(queryParamsInput)
+                : queryParamsInput;
+
+            const urlObj = new URL(url);
+            Object.entries(params).forEach(([key, value]) => {
+                urlObj.searchParams.append(key, value);
+            });
+            url = urlObj.toString();
+        } catch (e) {
+            console.error('[HTTP Request] Ошибка обработки query params:', e);
</code_context>

<issue_to_address>
**issue:** Using `new URL(url)` will throw for relative URLs; consider a fallback or base.

Since `queryParams` are now parsed unconditionally, any relative `url` (e.g. `/api/users`) will cause `new URL(url)` to throw and the request to drop into the `catch`, silently skipping query param handling. To make this more robust, either support a configurable base (e.g. `new URL(url, context.baseUrl)`) or detect relative URLs and append query parameters via string/`URLSearchParams` without `new URL` so relative paths don’t fail unexpectedly.
</issue_to_address>

### Comment 3
<location> `CHANGELOG.md:19` </location>
<code_context>
+
+* дебаг режим для графов ([ffc910b](https://github.com/blockmineJS/blockmine/commit/ffc910b772bccf9b64ca828eb55debddb11715d7))
+* добавлен ai помощник в blockmine ide ([d7c5f7e](https://github.com/blockmineJS/blockmine/commit/d7c5f7e555beacf614b6cdc94706339880aac55c))
+* добавлен diff для просмотра изменений кода от ии ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
+* новая вкладка - прокси ([3094b8b](https://github.com/blockmineJS/blockmine/commit/3094b8b5f1b9a59dd6494ff54c721f1e720b28f6))
+* новая ивент нода - При запуске бота ([5189a02](https://github.com/blockmineJS/blockmine/commit/5189a024c5e57fe8cb28f557b946247644367491))
</code_context>

<issue_to_address>
**issue (typo):** Исправить регистр аббревиатуры «ИИ» для единообразия.

Рекомендуется заменить «ии» на «ИИ», чтобы не выглядело как опечатка и соответствовало написанию аббревиатуры в остальных пунктах.

```suggestion
* добавлен diff для просмотра изменений кода от ИИ ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
```
</issue_to_address>

### Comment 4
<location> `CHANGELOG.md:25-26` </location>
<code_context>
+* новый ide редактор ([2d7b302](https://github.com/blockmineJS/blockmine/commit/2d7b3026882b56a226760ba38c52cba0815a0720))
+* подсветки при соединении нод ([dd06cdd](https://github.com/blockmineJS/blockmine/commit/dd06cdd4fca871713688382c9b73d0eaa4d1b8bd))
+* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
+* фиксы и для нод копирование вставка графов ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
+
 ## [1.22.0](https://github.com/blockmineJS/blockmine/compare/v1.21.0...v1.22.0) (2025-11-16)
</code_context>

<issue_to_address>
**issue (typo):** Уточнить формулировку: сейчас фраза выглядит обрезанной и грамматически невыверенной.

Конкретно, фраза «фиксы и для нод копирование вставка графов» тяжело читается: нет союза или разделителя между «копирование» и «вставка», структура неочевидна. Лучше переформулировать, например: «фиксы копирования и вставки графов для нод» или «фиксы копирования/вставки графов и для нод», чтобы смысл был однозначным.

```suggestion
* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
* фиксы копирования и вставки графов для нод ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
```
</issue_to_address>

### Comment 5
<location> `backend/src/core/nodes/data/string_literal.js:14-15` </location>
<code_context>
        const text = String(await resolvePinValue(node, 'value', ''));
        return text;

</code_context>

<issue_to_address>
**suggestion (code-quality):** Inline variable that is immediately returned ([`inline-immediately-returned-variable`](https://docs.sourcery.ai/Reference/Rules-and-In-Line-Suggestions/JavaScript/Default-Rules/inline-immediately-returned-variable))

```suggestion
        return String(await resolvePinValue(node, 'value', ''));

```

<br/><details><summary>Explanation</summary>Something that we often see in people's code is assigning to a result variable
and then immediately returning it.

Returning the result directly shortens the code and removes an unnecessary
variable, reducing the mental load of reading the function.

Where intermediate variables can be useful is if they then get used as a
parameter or a condition, and the name can act like a comment on what the
variable represents. In the case where you're returning it from a function, the
function name is there to tell you what the result is, so the variable name
is unnecessary.
</details>
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Original comment in English

Hey there - I've reviewed your changes - here's some feedback:

  • In NodeDefinition.getInputs, you mutate the array returned from computeInputs by pushing dynamic var pins; if any node reuses a shared constant array for computeInputs this will leak pins across instances—consider cloning (inputs = [...this.computeInputs(...)]) before mutation or clearly enforcing that computeInputs must always return a fresh array.
  • The new automatic variable expansion in resolvePinValue/_replaceVariablesInString can recurse indefinitely if a var_... pin itself contains {varName} placeholders (e.g. value for var_x contains {x}) because resolvePinValue is called again on the same logical variable; it would be safer to short‑circuit replacement for var_ pins or pass a flag to avoid re‑entering substitution.
  • The generic variable extraction in NodeDefinition.getInputs now adds var_* pins for any string field in data; this may affect nodes that don’t conceptually support template variables—consider making this behavior opt‑in via a flag on the node definition instead of applying it to all nodes globally.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `NodeDefinition.getInputs`, you mutate the array returned from `computeInputs` by pushing dynamic var pins; if any node reuses a shared constant array for `computeInputs` this will leak pins across instances—consider cloning (`inputs = [...this.computeInputs(...)]`) before mutation or clearly enforcing that `computeInputs` must always return a fresh array.
- The new automatic variable expansion in `resolvePinValue`/`_replaceVariablesInString` can recurse indefinitely if a `var_...` pin itself contains `{varName}` placeholders (e.g. `value` for `var_x` contains `{x}`) because `resolvePinValue` is called again on the same logical variable; it would be safer to short‑circuit replacement for `var_` pins or pass a flag to avoid re‑entering substitution.
- The generic variable extraction in `NodeDefinition.getInputs` now adds `var_*` pins for any string field in `data`; this may affect nodes that don’t conceptually support template variables—consider making this behavior opt‑in via a flag on the node definition instead of applying it to all nodes globally.

## Individual Comments

### Comment 1
<location> `frontend/src/components/visual-editor/core/registry/NodeDefinition.js:58-65` </location>
<code_context>
   getInputs(data, context = {}) {
+    let inputs = [];
+
     if (this.computeInputs) {
-      return this.computeInputs(data, context);
+      inputs = this.computeInputs(data, context);
     }
-    return [];
</code_context>

<issue_to_address>
**suggestion (bug_risk):** Guard against computeInputs returning a falsy or non-array value.

Since `inputs` is used with `.find`/`.push`, a non-array or `undefined` return from `computeInputs` will cause a runtime error. Consider defaulting to an empty array (e.g. `inputs = this.computeInputs(data, context) || [];`) and optionally validating that the result is actually an array to guard against misbehaving implementations.

```suggestion
  getInputs(data, context = {}) {
    let inputs = [];

    if (this.computeInputs) {
      const computedInputs = this.computeInputs(data, context);
      inputs = Array.isArray(computedInputs) ? computedInputs : [];
    }

    const allVars = new Set();
```
</issue_to_address>

### Comment 2
<location> `backend/src/core/nodes/actions/http_request.js:25-29` </location>
<code_context>
+                ? JSON.parse(queryParamsInput)
+                : queryParamsInput;
+
+            const urlObj = new URL(url);
+            Object.entries(params).forEach(([key, value]) => {
+                urlObj.searchParams.append(key, value);
+            });
+            url = urlObj.toString();
+        } catch (e) {
+            console.error('[HTTP Request] Ошибка обработки query params:', e);
</code_context>

<issue_to_address>
**issue:** Using `new URL(url)` will throw for relative URLs; consider a fallback or base.

Since `queryParams` are now parsed unconditionally, any relative `url` (e.g. `/api/users`) will cause `new URL(url)` to throw and the request to drop into the `catch`, silently skipping query param handling. To make this more robust, either support a configurable base (e.g. `new URL(url, context.baseUrl)`) or detect relative URLs and append query parameters via string/`URLSearchParams` without `new URL` so relative paths don’t fail unexpectedly.
</issue_to_address>

### Comment 3
<location> `CHANGELOG.md:19` </location>
<code_context>
+
+* дебаг режим для графов ([ffc910b](https://github.com/blockmineJS/blockmine/commit/ffc910b772bccf9b64ca828eb55debddb11715d7))
+* добавлен ai помощник в blockmine ide ([d7c5f7e](https://github.com/blockmineJS/blockmine/commit/d7c5f7e555beacf614b6cdc94706339880aac55c))
+* добавлен diff для просмотра изменений кода от ии ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
+* новая вкладка - прокси ([3094b8b](https://github.com/blockmineJS/blockmine/commit/3094b8b5f1b9a59dd6494ff54c721f1e720b28f6))
+* новая ивент нода - При запуске бота ([5189a02](https://github.com/blockmineJS/blockmine/commit/5189a024c5e57fe8cb28f557b946247644367491))
</code_context>

<issue_to_address>
**issue (typo):** Исправить регистр аббревиатуры «ИИ» для единообразия.

Рекомендуется заменить «ии» на «ИИ», чтобы не выглядело как опечатка и соответствовало написанию аббревиатуры в остальных пунктах.

```suggestion
* добавлен diff для просмотра изменений кода от ИИ ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
```
</issue_to_address>

### Comment 4
<location> `CHANGELOG.md:25-26` </location>
<code_context>
+* новый ide редактор ([2d7b302](https://github.com/blockmineJS/blockmine/commit/2d7b3026882b56a226760ba38c52cba0815a0720))
+* подсветки при соединении нод ([dd06cdd](https://github.com/blockmineJS/blockmine/commit/dd06cdd4fca871713688382c9b73d0eaa4d1b8bd))
+* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
+* фиксы и для нод копирование вставка графов ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
+
 ## [1.22.0](https://github.com/blockmineJS/blockmine/compare/v1.21.0...v1.22.0) (2025-11-16)
</code_context>

<issue_to_address>
**issue (typo):** Уточнить формулировку: сейчас фраза выглядит обрезанной и грамматически невыверенной.

Конкретно, фраза «фиксы и для нод копирование вставка графов» тяжело читается: нет союза или разделителя между «копирование» и «вставка», структура неочевидна. Лучше переформулировать, например: «фиксы копирования и вставки графов для нод» или «фиксы копирования/вставки графов и для нод», чтобы смысл был однозначным.

```suggestion
* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
* фиксы копирования и вставки графов для нод ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
```
</issue_to_address>

### Comment 5
<location> `backend/src/core/nodes/data/string_literal.js:14-15` </location>
<code_context>
        const text = String(await resolvePinValue(node, 'value', ''));
        return text;

</code_context>

<issue_to_address>
**suggestion (code-quality):** Inline variable that is immediately returned ([`inline-immediately-returned-variable`](https://docs.sourcery.ai/Reference/Rules-and-In-Line-Suggestions/JavaScript/Default-Rules/inline-immediately-returned-variable))

```suggestion
        return String(await resolvePinValue(node, 'value', ''));

```

<br/><details><summary>Explanation</summary>Something that we often see in people's code is assigning to a result variable
and then immediately returning it.

Returning the result directly shortens the code and removes an unnecessary
variable, reducing the mental load of reading the function.

Where intermediate variables can be useful is if they then get used as a
parameter or a condition, and the name can act like a comment on what the
variable represents. In the case where you're returning it from a function, the
function name is there to tell you what the result is, so the variable name
is unnecessary.
</details>
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines 58 to +65
getInputs(data, context = {}) {
let inputs = [];

if (this.computeInputs) {
return this.computeInputs(data, context);
inputs = this.computeInputs(data, context);
}
return [];

const allVars = new Set();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (bug_risk): Защититься от ситуации, когда computeInputs возвращает ложное (falsy) или не‑массивное значение.

Так как inputs используется с .find/.push, возврат не массива или undefined из computeInputs приведёт к ошибке во время выполнения. Рассмотри вариант по умолчанию использовать пустой массив (например, inputs = this.computeInputs(data, context) || [];) и при необходимости дополнительно проверить, что результат действительно является массивом, чтобы защититься от некорректных реализаций.

Suggested change
getInputs(data, context = {}) {
let inputs = [];
if (this.computeInputs) {
return this.computeInputs(data, context);
inputs = this.computeInputs(data, context);
}
return [];
const allVars = new Set();
getInputs(data, context = {}) {
let inputs = [];
if (this.computeInputs) {
const computedInputs = this.computeInputs(data, context);
inputs = Array.isArray(computedInputs) ? computedInputs : [];
}
const allVars = new Set();
Original comment in English

suggestion (bug_risk): Guard against computeInputs returning a falsy or non-array value.

Since inputs is used with .find/.push, a non-array or undefined return from computeInputs will cause a runtime error. Consider defaulting to an empty array (e.g. inputs = this.computeInputs(data, context) || [];) and optionally validating that the result is actually an array to guard against misbehaving implementations.

Suggested change
getInputs(data, context = {}) {
let inputs = [];
if (this.computeInputs) {
return this.computeInputs(data, context);
inputs = this.computeInputs(data, context);
}
return [];
const allVars = new Set();
getInputs(data, context = {}) {
let inputs = [];
if (this.computeInputs) {
const computedInputs = this.computeInputs(data, context);
inputs = Array.isArray(computedInputs) ? computedInputs : [];
}
const allVars = new Set();

Comment on lines +25 to +29
const urlObj = new URL(url);
Object.entries(params).forEach(([key, value]) => {
urlObj.searchParams.append(key, value);
});
url = urlObj.toString();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Использование new URL(url) приведёт к ошибке для относительных URL; стоит предусмотреть запасной вариант или базовый URL.

Так как queryParams теперь парсятся безусловно, любой относительный url (например, /api/users) вызовет исключение в new URL(url) и переведёт запрос в ветку catch, из‑за чего обработка query‑параметров будет тихо пропущена. Чтобы сделать это поведение более надёжным, можно либо поддержать настраиваемый базовый адрес (например, new URL(url, context.baseUrl)), либо определять относительные URL и добавлять query‑параметры через строку/URLSearchParams без new URL, чтобы относительные пути не ломались неожиданно.

Original comment in English

issue: Using new URL(url) will throw for relative URLs; consider a fallback or base.

Since queryParams are now parsed unconditionally, any relative url (e.g. /api/users) will cause new URL(url) to throw and the request to drop into the catch, silently skipping query param handling. To make this more robust, either support a configurable base (e.g. new URL(url, context.baseUrl)) or detect relative URLs and append query parameters via string/URLSearchParams without new URL so relative paths don’t fail unexpectedly.

Comment thread CHANGELOG.md

* дебаг режим для графов ([ffc910b](https://github.com/blockmineJS/blockmine/commit/ffc910b772bccf9b64ca828eb55debddb11715d7))
* добавлен ai помощник в blockmine ide ([d7c5f7e](https://github.com/blockmineJS/blockmine/commit/d7c5f7e555beacf614b6cdc94706339880aac55c))
* добавлен diff для просмотра изменений кода от ии ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Исправить регистр аббревиатуры «ИИ» для единообразия.

Рекомендуется заменить «ии» на «ИИ», чтобы не выглядело как опечатка и соответствовало написанию аббревиатуры в остальных пунктах.

Suggested change
* добавлен diff для просмотра изменений кода от ии ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
* добавлен diff для просмотра изменений кода от ИИ ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
Original comment in English

issue (typo): Исправить регистр аббревиатуры «ИИ» для единообразия.

Рекомендуется заменить «ии» на «ИИ», чтобы не выглядело как опечатка и соответствовало написанию аббревиатуры в остальных пунктах.

Suggested change
* добавлен diff для просмотра изменений кода от ии ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))
* добавлен diff для просмотра изменений кода от ИИ ([d0159f0](https://github.com/blockmineJS/blockmine/commit/d0159f0884863ec10136f4bf32ea7daf0702d476))

Comment thread CHANGELOG.md
Comment on lines +25 to +26
* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
* фиксы и для нод копирование вставка графов ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Уточнить формулировку: сейчас фраза выглядит обрезанной и грамматически невыверенной.

Конкретно, фраза «фиксы и для нод копирование вставка графов» тяжело читается: нет союза или разделителя между «копирование» и «вставка», структура неочевидна. Лучше переформулировать, например: «фиксы копирования и вставки графов для нод» или «фиксы копирования/вставки графов и для нод», чтобы смысл был однозначным.

Suggested change
* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
* фиксы и для нод копирование вставка графов ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
* фиксы копирования и вставки графов для нод ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
Original comment in English

issue (typo): Уточнить формулировку: сейчас фраза выглядит обрезанной и грамматически невыверенной.

Конкретно, фраза «фиксы и для нод копирование вставка графов» тяжело читается: нет союза или разделителя между «копирование» и «вставка», структура неочевидна. Лучше переформулировать, например: «фиксы копирования и вставки графов для нод» или «фиксы копирования/вставки графов и для нод», чтобы смысл был однозначным.

Suggested change
* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
* фиксы и для нод копирование вставка графов ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))
* теперь за бота можно ходить прямо в браузере! ([42f9257](https://github.com/blockmineJS/blockmine/commit/42f9257ee3ce166fda648e9a2ca6947c630a21e2))
* фиксы копирования и вставки графов для нод ([aa1308d](https://github.com/blockmineJS/blockmine/commit/aa1308d19122ebc762ec1ebd3f523e12c2fb5aa2))

Comment on lines +14 to 15
const text = String(await resolvePinValue(node, 'value', ''));
return text;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Инлайнить переменную, которая сразу же возвращается (inline-immediately-returned-variable)

Suggested change
const text = String(await resolvePinValue(node, 'value', ''));
return text;
return String(await resolvePinValue(node, 'value', ''));


ExplanationSomething that we often see in people's code is assigning to a result variable
and then immediately returning it.

Returning the result directly shortens the code and removes an unnecessary
variable, reducing the mental load of reading the function.

Where intermediate variables can be useful is if they then get used as a
parameter or a condition, and the name can act like a comment on what the
variable represents. In the case where you're returning it from a function, the
function name is there to tell you what the result is, so the variable name
is unnecessary.

Original comment in English

suggestion (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)

Suggested change
const text = String(await resolvePinValue(node, 'value', ''));
return text;
return String(await resolvePinValue(node, 'value', ''));


ExplanationSomething that we often see in people's code is assigning to a result variable
and then immediately returning it.

Returning the result directly shortens the code and removes an unnecessary
variable, reducing the mental load of reading the function.

Where intermediate variables can be useful is if they then get used as a
parameter or a condition, and the name can act like a comment on what the
variable represents. In the case where you're returning it from a function, the
function name is there to tell you what the result is, so the variable name
is unnecessary.

@coderabbitai coderabbitai Bot mentioned this pull request May 8, 2026
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