Skip to content

Reactive Architecture Refactor for Rule Builder#274

Merged
ruzaqiarkan-eng merged 2 commits into
developfrom
refactor/reactive-page-integration-15955121329178845529
Jul 9, 2026
Merged

Reactive Architecture Refactor for Rule Builder#274
ruzaqiarkan-eng merged 2 commits into
developfrom
refactor/reactive-page-integration-15955121329178845529

Conversation

@ruzaqiarkan-eng

Copy link
Copy Markdown
Collaborator

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:

  • Centralized UI synchronization in RuleBuilder.watch_changes() using Vue's watchEffect.
  • Decoupled useRuleStore from the page object, ensuring stores remain pure.
  • Migrated from custom jQuery title hacks to standard Frappe indicator pills.
  • Added support for both legacy and modern Frappe breadcrumb APIs.
  • Established a 'Controller-Broker' pattern where Vue components update state and the Controller responds to that state by updating the Frappe chrome.

PR created automatically by Jules for task 15955121329178845529 started by @ruzaqiarkan-eng

- 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`.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

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).
@ruzaqiarkan-eng ruzaqiarkan-eng merged commit d4bf8a4 into develop Jul 9, 2026
5 checks passed
@ruzaqiarkan-eng ruzaqiarkan-eng deleted the refactor/reactive-page-integration-15955121329178845529 branch July 9, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant