Reactive Architecture Refactor for Rule Builder#274
Conversation
- Implemented centralized `watchEffect` in `RuleBuilder` controller for reactive Page API synchronization. - Decoupled Pinia stores from Frappe Page API (moved breadcrumbs to controller). - Removed manual DOM manipulation for title badges in favor of standard `set_indicator`. - Implemented dynamic primary actions (Save, Activate, Edit) based on document state. - Brokered all Page chrome interactions through the controller. - Produced architecture report and migration plan in `report/architecture_report_v1.md`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Fixed bug where UI (indicators/toolbar) wouldn't update after Activation/Deactivation without a hard refresh. - Removed blocking `is_loading` guard in `fetch()` to allow forced refreshes from lifecycle actions. - Enhanced `watchEffect` in `RuleBuilder` controller to track `ruleStore.rule_doc` directly. - Ensured `toggle_rule_active` is the single source of truth for Activation/Deactivation flows in the UI. - Maintained architectural separation between stores (data) and controller (integration).
This refactor aligns the FlexiRule Rule Builder with modern Frappe v15 architecture patterns. It establishes a clear reactive bridge between Pinia application state and the jQuery-based Frappe Page API, managed exclusively by the RuleBuilder controller.
Key changes:
RuleBuilder.watch_changes()using Vue'swatchEffect.useRuleStorefrom thepageobject, ensuring stores remain pure.PR created automatically by Jules for task 15955121329178845529 started by @ruzaqiarkan-eng