From ed9fedfa287ddd0b145bda0be76f33fba54689f9 Mon Sep 17 00:00:00 2001 From: Tarcio Date: Thu, 21 May 2026 14:55:42 -0300 Subject: [PATCH] fix(triggers): use absolute import for constants module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The component scanner (lfx.interface.components._process_single_module) discovers a component class, instantiates it, and then re-evaluates the class's *source code* via lfx.custom.validate.create_class to extract its frontend template. That re-evaluation runs the module body in a flat namespace — there is no package context, so relative imports ('from .constants import …') resolve to a non-existent top-level 'constants' module and raise ModuleNotFoundError. The exception is swallowed silently inside _process_single_module (it appends to a per-module failed_count and continues), so the scanner returns an EMPTY component dict for the triggers package and the entire category disappears from the frontend palette — exactly the symptom: build_component_index / LFX_DEV scans complete with no 'triggers' key in the result. Fix: switch to absolute import (lfx.components.triggers.constants). Mirrors the convention used by every other built-in component; relative imports of sibling helpers are not safe in this codebase because of how the validator re-evaluates the source. Verified via _process_single_module('lfx.components.triggers.cron_trigger'): returns ('triggers', {'CronTrigger':