meta_workflows 0.9.41 → 0.9.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d243f864ec247e441fb99776933bdd6da36b9659aa67441dce1b2c697c4bddbe
4
- data.tar.gz: 50ebf8d7d05836e527e79e4b33f537a945068025203270969a4da8b434bb87f7
3
+ metadata.gz: a14dc3b40a8ccb891ffc7d073bae5e5954b92dd08a3ac034734b8a2c76eb1a9c
4
+ data.tar.gz: e85f6a55d57561e8fdcf0c5347927d19230ac0527f31fbcb5a7f847714d4db02
5
5
  SHA512:
6
- metadata.gz: dbf074bc5ea6b95655d561e5a6625f39b18411ca25fabf8af7e2606ea32ed4abda22f27b795997bfbb757e6a58ba6e8e65d7526046a63844d9acefb08f94e496
7
- data.tar.gz: a8acca539f74e197ec626d4aa1f9bc7b66da651db2d17a06db7e1404ca3fafe55ccc8a2a17795b49487b323ccff5a8164ad455ec284730f03c31cb83d33be7c5
6
+ metadata.gz: ec2c669e310df63402de184cc11d48ed2a148e11a974f11b06aa62903fed7fe693acb2ee824ead7c7aad9a571a4a3a1fed11b03324cff3a44b17c7ac64c6963c
7
+ data.tar.gz: 0ec6e8a1d65c804234961dd3ee0ce09e970327b5dba0fced3da3e783cbdeefb02e3a7ccebdcf4901a2f2342726c4f759129721e3903d93f76f9e50bd4bccd852
@@ -1,3 +1,4 @@
1
+ // TODO: This shoudl be removable, because it is not shared betwen applications (it is currentl used in the dummy app only)
1
2
  import { Controller } from "@hotwired/stimulus"
2
3
 
3
4
  export default class extends Controller {
@@ -1,67 +1,71 @@
1
- import { Controller } from "@hotwired/stimulus"
1
+ import { Controller } from '@hotwired/stimulus';
2
2
 
3
3
  export default class extends Controller {
4
4
  connect() {
5
- this.setupObserver()
6
- this.setupTurboListener()
7
- this.scrollToBottom()
5
+ this.setupObserver();
6
+ this.setupTurboListener();
7
+ this.scrollToBottom();
8
8
  }
9
9
 
10
10
  disconnect() {
11
11
  if (this.observer) {
12
- this.observer.disconnect()
12
+ this.observer.disconnect();
13
13
  }
14
- document.removeEventListener("turbo:frame-render", this.handleTurboRender)
14
+ document.removeEventListener('turbo:frame-render', this.handleTurboRender);
15
15
  }
16
16
 
17
17
  setupObserver() {
18
18
  this.observer = new MutationObserver((mutations) => {
19
- if (mutations.some(mutation =>
20
- mutation.type === 'childList' ||
21
- mutation.type === 'characterData'
22
- )) {
23
- setTimeout(() => this.scrollToBottom(), 10)
19
+ if (
20
+ mutations.some(
21
+ (mutation) =>
22
+ mutation.type === 'childList' || mutation.type === 'characterData'
23
+ )
24
+ ) {
25
+ setTimeout(() => this.scrollToBottom(), 10);
24
26
  }
25
- })
27
+ });
26
28
 
27
- const contentContainer = this.element.closest('#response-content-container')
29
+ const contentContainer = this.element.closest(
30
+ '#response-content-container'
31
+ );
28
32
  if (contentContainer) {
29
33
  this.observer.observe(contentContainer, {
30
34
  childList: true,
31
35
  subtree: true,
32
36
  characterData: true,
33
- attributes: true
34
- })
37
+ attributes: true,
38
+ });
35
39
  } else {
36
40
  this.observer.observe(this.element, {
37
41
  childList: true,
38
42
  subtree: true,
39
43
  characterData: true,
40
- attributes: true
41
- })
44
+ attributes: true,
45
+ });
42
46
  }
43
47
  }
44
48
 
45
49
  setupTurboListener() {
46
50
  this.handleTurboRender = () => {
47
- setTimeout(() => this.scrollToBottom(), 10)
48
- }
49
- document.addEventListener("turbo:frame-render", this.handleTurboRender)
51
+ setTimeout(() => this.scrollToBottom(), 10);
52
+ };
53
+ document.addEventListener('turbo:frame-render', this.handleTurboRender);
50
54
  }
51
55
 
52
56
  scrollToBottom() {
53
- const mainContainer = document.querySelector('#main-scroll-container')
54
- if (!mainContainer) return
57
+ const mainContainer = document.querySelector('#main-scroll-container');
58
+ if (!mainContainer) return;
55
59
 
56
- const scrollHeight = mainContainer.scrollHeight
57
- const clientHeight = mainContainer.clientHeight
58
- const maxScroll = scrollHeight - clientHeight
60
+ const scrollHeight = mainContainer.scrollHeight;
61
+ const clientHeight = mainContainer.clientHeight;
62
+ const maxScroll = scrollHeight - clientHeight;
59
63
 
60
64
  if (maxScroll > 0) {
61
65
  mainContainer.scrollTo({
62
66
  top: maxScroll,
63
- behavior: 'smooth'
64
- })
67
+ behavior: 'smooth',
68
+ });
65
69
  }
66
70
  }
67
- }
71
+ }
@@ -135,15 +135,12 @@ export default class extends Controller {
135
135
  }
136
136
 
137
137
  updateGammaTray(hasChevron, trayElement) {
138
- console.log(`Updating gamma tray - expanded: ${this.expanded}`);
139
138
  // Gamma: open=right, collapsed=left
140
139
  if (this.expanded) {
141
- console.log('Expanding gamma tray');
142
140
  trayElement.classList.remove("collapsed");
143
141
  trayElement.classList.add("w-[300px]");
144
142
  this.updateChevronClasses(hasChevron, "fa-chevron-left", "fa-chevron-right");
145
143
  } else {
146
- console.log('Collapsing gamma tray');
147
144
  trayElement.classList.remove("w-[300px]");
148
145
  trayElement.classList.add("collapsed");
149
146
  this.updateChevronClasses(hasChevron, "fa-chevron-right", "fa-chevron-left");
@@ -342,8 +342,7 @@
342
342
 
343
343
  .lexi-input-container {
344
344
  display: flex;
345
- flex-direction: row;
346
- gap: 0.5rem;
345
+ flex-direction: column;
347
346
  border: 1px solid var(--gray-300);
348
347
  border-radius: 0.5rem;
349
348
  background-color: rgba(255, 255, 255, 0.8);
@@ -374,7 +373,7 @@
374
373
 
375
374
  .lexi-input-controls {
376
375
  display: flex;
377
- justify-content: space-between;
376
+ justify-content: flex-end;
378
377
  align-items: flex-end;
379
378
  }
380
379
 
@@ -576,7 +575,13 @@
576
575
  transition: all 500ms ease-in-out;
577
576
  }
578
577
 
579
- /* Beta Tray (Left) */
578
+ /* Common content transitions */
579
+ .tray-content {
580
+ transition: opacity 300ms ease-in-out, transform 500ms ease-in-out;
581
+ opacity: 1;
582
+ transform: translate(0);
583
+ }
584
+
580
585
  .beta-tray {
581
586
  transition: width 500ms ease-in-out;
582
587
  }
@@ -606,28 +611,6 @@
606
611
  pointer-events: none;
607
612
  }
608
613
 
609
- /* Delta Tray (Bottom) */
610
- .delta-tray {
611
- transition: height 500ms ease-in-out;
612
- }
613
-
614
- .delta-tray.collapsed {
615
- height: 50px;
616
- }
617
-
618
- .delta-tray.collapsed .tray-content {
619
- opacity: 0;
620
- transform: translateY(1rem);
621
- pointer-events: none;
622
- }
623
-
624
- /* Common content transitions */
625
- .tray-content {
626
- transition: opacity 300ms ease-in-out, transform 500ms ease-in-out;
627
- opacity: 1;
628
- transform: translate(0);
629
- }
630
-
631
614
  /* Lexi Tray Overrides */
632
615
  .gamma-tray.lexi-tray.collapsed {
633
616
  width: 0px; /* Completely hide the tray */
@@ -683,6 +666,21 @@
683
666
  display: none;
684
667
  }
685
668
 
669
+ /* Delta Tray (Bottom) */
670
+ .delta-tray {
671
+ transition: height 500ms ease-in-out;
672
+ }
673
+
674
+ .delta-tray.collapsed {
675
+ height: 50px;
676
+ }
677
+
678
+ .delta-tray.collapsed .tray-content {
679
+ opacity: 0;
680
+ transform: translateY(1rem);
681
+ pointer-events: none;
682
+ }
683
+
686
684
  /* Onboarding Screen Grid Stacking Animations */
687
685
  .onboarding-container {
688
686
  display: grid;
@@ -735,7 +733,7 @@
735
733
 
736
734
  /* Alpha Tray Lexi Avatar Size */
737
735
  .lexi-avatar-large {
738
- height: 35rem;
736
+ height: 30rem;
739
737
  width: auto;
740
738
  }
741
739
 
@@ -746,7 +744,7 @@
746
744
  flex-direction: column;
747
745
  background-color: white;
748
746
  padding: 1rem 1rem 0 1rem;
749
- height: 95vh;
747
+ height: 100%;
750
748
  }
751
749
 
752
750
  .lexi-chat-alpha-header {
@@ -840,7 +838,6 @@
840
838
  padding: 1rem;
841
839
  background-color: rgba(255, 255, 255, 0.9);
842
840
  border-radius: 0.75rem;
843
- margin-bottom: .5rem;
844
841
  }
845
842
 
846
843
  .structured-input-options {
@@ -860,13 +857,15 @@
860
857
  background-color: white;
861
858
  cursor: pointer;
862
859
  transition: all 0.2s ease;
863
- background-image: linear-gradient(white, white), linear-gradient(var(--gray-300), var(--gray-300));
860
+ background-image: linear-gradient(white, white),
861
+ linear-gradient(var(--gray-300), var(--gray-300));
864
862
  background-origin: border-box;
865
863
  background-clip: padding-box, border-box;
866
864
  }
867
865
 
868
866
  .structured-radio-option:hover {
869
- background-image: linear-gradient(white, white), linear-gradient(45deg, #F3B51C, #E87C66, #F3B51C, #E87C66);
867
+ background-image: linear-gradient(white, white),
868
+ linear-gradient(45deg, #f3b51c, #e87c66, #f3b51c, #e87c66);
870
869
  background-size: auto, 300% 300%;
871
870
  animation: animatedgradient 3s ease alternate infinite;
872
871
  }
@@ -898,23 +897,24 @@
898
897
  background-color: white;
899
898
  cursor: pointer;
900
899
  transition: all 0.2s ease;
901
- background-image: linear-gradient(white, white), linear-gradient(var(--gray-300), var(--gray-300));
900
+ background-image: linear-gradient(white, white),
901
+ linear-gradient(var(--gray-300), var(--gray-300));
902
902
  background-origin: border-box;
903
903
  background-clip: padding-box, border-box;
904
904
  }
905
905
 
906
906
  .structured-checkbox-option:hover {
907
- background-image: linear-gradient(white, white), linear-gradient(45deg, #F3B51C, #E87C66, #F3B51C, #E87C66);
907
+ background-image: linear-gradient(white, white),
908
+ linear-gradient(45deg, #f3b51c, #e87c66, #f3b51c, #e87c66);
908
909
  background-size: auto, 300% 300%;
909
910
  animation: animatedgradient 3s ease alternate infinite;
910
911
  }
911
912
 
912
913
  .structured-checkbox-option:has(.structured-checkbox-input:checked) {
913
- background-image: linear-gradient(white, white), linear-gradient(45deg, #F3B51C, #E87C66);
914
+ background-image: linear-gradient(white, white),
915
+ linear-gradient(45deg, #f3b51c, #e87c66);
914
916
  }
915
917
 
916
-
917
-
918
918
  .structured-checkbox-input {
919
919
  width: 1.25rem;
920
920
  height: 1.25rem;
@@ -969,10 +969,11 @@
969
969
  width: 100%;
970
970
  height: 1rem;
971
971
  border-radius: 0.25rem;
972
- background: linear-gradient(90deg,
973
- #F3B51C 0%,
974
- #E87C66 var(--slider-fill),
975
- #e5e7eb var(--slider-fill),
972
+ background: linear-gradient(
973
+ 90deg,
974
+ #f3b51c 0%,
975
+ #e87c66 var(--slider-fill),
976
+ #e5e7eb var(--slider-fill),
976
977
  #e5e7eb 100%
977
978
  );
978
979
  background-size: 100% 100%;
@@ -985,10 +986,11 @@
985
986
  width: 100%;
986
987
  height: 1rem;
987
988
  border-radius: 0.25rem;
988
- background: linear-gradient(90deg,
989
- #F3B51C 0%,
990
- #E87C66 var(--slider-fill),
991
- #e5e7eb var(--slider-fill),
989
+ background: linear-gradient(
990
+ 90deg,
991
+ #f3b51c 0%,
992
+ #e87c66 var(--slider-fill),
993
+ #e5e7eb var(--slider-fill),
992
994
  #e5e7eb 100%
993
995
  );
994
996
  background-size: 100% 100%;
@@ -12,7 +12,7 @@ module MetaWorkflows
12
12
 
13
13
  # Broadcasts loader message with step progress
14
14
  def broadcast_loader_stream(workflow_execution)
15
- step_progress = workflow_execution.step_progress(workflow_execution.current_step) || default_step_progress
15
+ step_progress = workflow_execution.current_step_progress
16
16
  record = workflow_execution.record
17
17
 
18
18
  Turbo::StreamsChannel.broadcast_replace_to(
@@ -86,7 +86,7 @@ module MetaWorkflows
86
86
  locals: {
87
87
  record: record,
88
88
  show_loader: show_loader,
89
- step_progress: step_progress || default_step_progress,
89
+ step_progress: step_progress || RecipeAccessible::DEFAULT_STEP_PROGRESS,
90
90
  full_response: nil
91
91
  }
92
92
  )
@@ -9,19 +9,18 @@ module MetaWorkflows
9
9
  @workflow_execution = MetaWorkflows::WorkflowExecution.includes(:record, :workflow,
10
10
  :workflow_steps).find(params[:id])
11
11
  @record = @workflow_execution.record
12
- @workflow_step = @workflow_execution.workflow_steps.find_by(step: @workflow_execution.current_step)
13
- @prompt_id = @workflow_execution.prompt_id(@workflow_execution.current_step)
12
+ @workflow_step = @workflow_execution.current_workflow_step
13
+ @prompt_id = @workflow_execution.current_prompt_id
14
14
  end
15
15
 
16
16
  protected
17
17
 
18
18
  def fetch_step_progress
19
- @workflow_execution.step_progress(@workflow_execution.current_step) || default_step_progress
19
+ @workflow_execution.current_step_progress
20
20
  end
21
21
 
22
22
  def current_step_repetitions
23
- # TODO: we should be albe to refactor this into a model method that does this internally
24
- @workflow_execution.step_repetitions(@workflow_execution.current_step)
23
+ @workflow_execution.current_step_repetitions
25
24
  end
26
25
 
27
26
  def append_user_message_to_history(user_message)
@@ -31,10 +31,6 @@ module MetaWorkflows
31
31
  end
32
32
  end
33
33
 
34
- def default_step_progress
35
- ['Thinking']
36
- end
37
-
38
34
  def show_next_button?(workflow_execution)
39
35
  return false if current_step_has_repetitions?(workflow_execution)
40
36
 
@@ -57,7 +53,7 @@ module MetaWorkflows
57
53
  private
58
54
 
59
55
  def current_step_has_repetitions?(workflow_execution)
60
- workflow_execution.step_repetitions(workflow_execution.current_step).present?
56
+ workflow_execution.current_step_repetitions.present?
61
57
  end
62
58
  end
63
59
  end
@@ -93,7 +93,7 @@ module MetaWorkflows
93
93
  def current_workflow_step(workflow_execution)
94
94
  return nil unless workflow_execution
95
95
 
96
- workflow_execution.workflow_steps.find_by(step: workflow_execution.current_step)
96
+ workflow_execution.current_workflow_step
97
97
  end
98
98
 
99
99
  def broadcast_form(chat)
@@ -3,6 +3,8 @@
3
3
  module RecipeAccessible
4
4
  extend ActiveSupport::Concern
5
5
 
6
+ DEFAULT_STEP_PROGRESS = ['Thinking'].freeze
7
+
6
8
  def step_progress(step)
7
9
  recipe&.dig('steps', step, 'step_progress')
8
10
  end
@@ -23,6 +25,18 @@ module RecipeAccessible
23
25
  recipe&.dig('steps', step, 'repetitions')
24
26
  end
25
27
 
28
+ def current_step_repetitions
29
+ step_repetitions(current_step)
30
+ end
31
+
32
+ def current_step_progress
33
+ step_progress(current_step) || DEFAULT_STEP_PROGRESS
34
+ end
35
+
36
+ def current_prompt_id
37
+ prompt_id(current_step)
38
+ end
39
+
26
40
  def step_advanceable?(step)
27
41
  recipe&.dig('steps', step, 'advanceable') || false
28
42
  end
@@ -22,14 +22,16 @@ module MetaWorkflows
22
22
  update(current_step: current_step + 1)
23
23
  end
24
24
 
25
- # Get the latest workflow step with its chat (optimized for preloaded data)
26
25
  def latest_workflow_step
27
26
  workflow_steps.max_by(&:step)
28
27
  end
29
28
 
30
- # Get the chat from the latest step (optimized for preloaded data)
31
29
  def latest_chat
32
30
  latest_workflow_step&.chat
33
31
  end
32
+
33
+ def current_workflow_step
34
+ workflow_steps.find_by(step: current_step)
35
+ end
34
36
  end
35
37
  end
@@ -20,7 +20,7 @@ module MetaWorkflows
20
20
 
21
21
  # Initial execution methods
22
22
  def initial_execution?
23
- initial_execution
23
+ initial_execution != false || chat&.messages&.blank?
24
24
  end
25
25
 
26
26
  # Error handling methods
@@ -21,7 +21,7 @@
21
21
  <div class="lexi-chat-alpha-left-column">
22
22
  <%= image_tag("lexi-expanded2.png", alt: "Lexi Avatar", class: "lexi-avatar-large") %>
23
23
  </div>
24
-
24
+
25
25
  <!-- Main content area (chat + input) -->
26
26
  <%# Right column - Chat and Input %>
27
27
  <div class="lexi-chat-alpha-right-column">
@@ -29,7 +29,11 @@
29
29
  <%= render partial: meta_lexi_chat_messages, locals: {
30
30
  record: local_assigns[:record],
31
31
  chat_history: chat_data[:chat_history],
32
- container_class: 'lexi-chat-alpha-messages'
32
+ container_class: 'lexi-chat-alpha-messages',
33
+ workflow_execution: chat_data[:active_execution],
34
+ current_step: chat_data[:current_step],
35
+ structured_input_config: chat_data[:structured_input_config],
36
+ initial_load: true
33
37
  } %>
34
38
 
35
39
  <%# Input area (fixed at bottom) %>
@@ -38,4 +42,4 @@
38
42
  </div>
39
43
  </div>
40
44
  </div>
41
- </div>
45
+ </div>
@@ -1,20 +1,13 @@
1
1
  <%# Shared input area %>
2
2
  <div class="<%= local_assigns[:wrapper_class] || 'lexi-input-wrapper' %>" data-controller="meta-workflows--lexi-form-submit">
3
- <%= render meta_structured_input,
4
- record: local_assigns[:record],
5
- workflow_execution: local_assigns[:workflow_execution],
6
- current_step: local_assigns[:current_step],
7
- structured_input_config: local_assigns[:structured_input_config],
8
- initial_load: true %>
9
-
10
3
  <%= render partial: meta_response_form, locals: {
11
- record: local_assigns[:record],
12
- response_enabled: true,
4
+ record: local_assigns[:record],
5
+ response_enabled: true,
13
6
  workflow_execution_id: local_assigns[:workflow_execution]&.id,
14
7
  chat_id: local_assigns[:chat_id],
15
8
  step_has_repetitions: true,
16
9
  is_structured_input: local_assigns[:is_structured_input],
17
- show_skip_button: false,
18
- show_next_button: false
10
+ show_skip_button: false,
11
+ show_next_button: false
19
12
  } %>
20
- </div>
13
+ </div>
@@ -1,5 +1,5 @@
1
1
  <%# Shared chat messages area %>
2
- <div id="main-scroll-container" class="<%= local_assigns[:container_class] || 'lexi-chat-messages' %>">
2
+ <div id="main-scroll-container" class="<%= local_assigns[:container_class] || 'lexi-chat-messages' %>" data-controller="response-scroll">
3
3
  <%= render partial: meta_response, locals: {
4
4
  record: local_assigns[:record],
5
5
  chat_history: local_assigns[:chat_history],
@@ -10,4 +10,14 @@
10
10
  full_response: nil,
11
11
  error_message: nil
12
12
  } %>
13
- </div>
13
+
14
+ <%# Structured input area (inside scrollable chat container) %>
15
+ <div class="lexi-chat-structured-input-area">
16
+ <%= render meta_structured_input,
17
+ record: local_assigns[:record],
18
+ workflow_execution: local_assigns[:workflow_execution],
19
+ current_step: local_assigns[:current_step],
20
+ structured_input_config: local_assigns[:structured_input_config],
21
+ initial_load: local_assigns[:initial_load] %>
22
+ </div>
23
+ </div>
@@ -22,17 +22,16 @@
22
22
  <%= render partial: meta_lexi_chat_messages, locals: {
23
23
  record: local_assigns[:record],
24
24
  chat_history: chat_data[:chat_history],
25
- container_class: 'lexi-chat-messages'
25
+ container_class: 'lexi-chat-messages',
26
+ workflow_execution: chat_data[:active_execution],
27
+ current_step: chat_data[:current_step],
28
+ structured_input_config: chat_data[:structured_input_config],
29
+ initial_load: true
26
30
  } %>
27
31
 
28
- <!-- Structured inputs area (above avatar) -->
29
- <div class="structured-input-area" data-controller="meta-workflows--lexi-form-submit">
30
- <%= render meta_structured_input, record: local_assigns[:record], structured_input_config: false, is_structured_input: false %>
31
- </div>
32
-
33
32
  <!-- Avatar and input area pinned to bottom -->
34
33
  <div class="lexi-chat-bottom">
35
34
  <%= image_tag("lexi-expanded.png", alt: "Lexi Avatar", class: "lexi-avatar") %>
36
35
  <%= render partial: meta_lexi_chat_input_area, locals: lexi_chat_input_locals(local_assigns[:record], chat_data, 'lexi-input-wrapper') %>
37
36
  </div>
38
- </div>
37
+ </div>
@@ -3,9 +3,9 @@
3
3
  <div class="lexi-loader-bubble">
4
4
  <div class="lexi-message-content-assistant"
5
5
  data-controller="loading-phrases"
6
- data-loading-phrases-phrases-value="<%= (local_assigns[:step_progress] || default_step_progress).to_json %>">
6
+ data-loading-phrases-phrases-value="<%= (local_assigns[:step_progress]).to_json %>">
7
7
  <span data-loading-phrases-target="message" class="lexi-loader-text">
8
- <%= default_step_progress.first %>
8
+ <%= local_assigns[:step_progress].first %>
9
9
  </span>
10
10
  <span class="lexi-loader-ellipses">
11
11
  <span class="lexi-dot lexi-dot-1">.</span>
@@ -1,16 +1,16 @@
1
- <div class="structured-input-container"
2
- role="radiogroup"
1
+ <div class="structured-input-container"
2
+ role="radiogroup"
3
3
  aria-labelledby="structured-radio-legend"
4
4
  aria-required="true">
5
5
  <legend id="structured-radio-legend" class="sr-only">Select one option</legend>
6
6
  <div class="structured-input-options">
7
7
  <% options.each_with_index do |option, index| %>
8
8
  <div class="structured-radio-option">
9
- <input
10
- type="radio"
11
- id="single_choice_<%= index %>"
12
- name="single_choice_selection"
13
- value="<%= option['value'] %>"
9
+ <input
10
+ type="radio"
11
+ id="single_choice_<%= index %>"
12
+ name="single_choice_selection"
13
+ value="<%= option['value'] %>"
14
14
  class="structured-radio-input"
15
15
  data-meta-workflows--lexi-form-submit-target="structuredInput"
16
16
  data-action="change->meta-workflows--structured-form-submit#handleSubmit"
@@ -24,4 +24,4 @@
24
24
  <% end %>
25
25
  </div>
26
26
  <div id="structured-radio-help" class="sr-only">Use arrow keys to navigate between options</div>
27
- </div>
27
+ </div>
@@ -1,6 +1,6 @@
1
1
  <%= turbo_frame_tag target_frame_id(record) do %>
2
- <div id="response-content-container" class="lexi-response-container" data-controller="response-scroll">
3
-
2
+ <div id="response-content-container" class="lexi-response-container">
3
+
4
4
  <!-- Persistent Chat History Frame -->
5
5
  <%= render partial: meta_chat_history, locals: {
6
6
  record: record,
@@ -19,4 +19,4 @@
19
19
  } %>
20
20
 
21
21
  </div>
22
- <% end %>
22
+ <% end %>
@@ -1,17 +1,15 @@
1
1
  <%= turbo_frame_tag target_frame_id(record, structured_input: true) do %>
2
-
3
2
  <% if show_structured_input?(local_assigns, structured_input_config) %>
4
-
5
3
  <%= form_with url: structured_form_url(local_assigns[:workflow_execution]),
6
4
  method: :patch,
7
5
  id: "#{target_frame_id(record, structured_input: true)}_form",
8
- data: {
9
- controller: "meta-workflows--structured-form-submit",
6
+ data: {
7
+ controller: "meta-workflows--structured-form-submit",
10
8
  "meta-workflows--structured-form-submit-target": "form",
11
9
  "meta-workflows--lexi-form-submit-target": "structuredInputForm"
12
10
  } do |form| %>
13
11
  <%= form.hidden_field :chat_id, value: structured_chat_id(local_assigns) %>
14
-
12
+
15
13
  <div class="structured-input-wrapper">
16
14
  <% case structured_input_config['type'] %>
17
15
  <% when 'single_choice' %>
@@ -24,4 +22,4 @@
24
22
  </div>
25
23
  <% end %>
26
24
  <% end %>
27
- <% end %>
25
+ <% end %>
@@ -145,8 +145,8 @@
145
145
  Step <%= execution.total_steps %>
146
146
  <% else %>
147
147
  Step <%= execution.current_step + 1 %>
148
- <% current_step_obj = execution.workflow_steps.find_by(step: execution.current_step) %>
149
- <% max_repetitions = execution.step_repetitions(execution.current_step) if current_step_obj %>
148
+ <% current_step_obj = execution.current_workflow_step %>
149
+ <% max_repetitions = execution.current_step_repetitions if current_step_obj %>
150
150
  <% step_data = safe_step_data(execution, execution.current_step) %>
151
151
 
152
152
  <% if current_step_obj&.repetition.present? && max_repetitions.present? %>
@@ -3,7 +3,7 @@
3
3
  module MetaWorkflows
4
4
  MAJOR = 0
5
5
  MINOR = 9
6
- PATCH = 41 # this is automatically incremented by the build process
6
+ PATCH = 43 # this is automatically incremented by the build process
7
7
 
8
8
  VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
9
9
  end
@@ -11,9 +11,7 @@ module Services
11
11
 
12
12
  attr_reader :record, :workflow_name, :user, :inputs, :workflow_params
13
13
 
14
- # TODO: inputs should be a an empty hash by default
15
- # Once everything is working we can change the default value from nil to {}
16
- def initialize(record:, workflow_name: nil, user: nil, inputs: nil, workflow_params: nil)
14
+ def initialize(record:, workflow_name: nil, user: nil, inputs: {}, workflow_params: nil)
17
15
  @record = record
18
16
  @workflow_name = workflow_name
19
17
  @user = user
@@ -73,7 +71,7 @@ module Services
73
71
  end
74
72
 
75
73
  def find_workflow_step(workflow_execution)
76
- workflow_execution.workflow_steps.find_by(step: workflow_execution.current_step)
74
+ workflow_execution.current_workflow_step
77
75
  end
78
76
 
79
77
  def clear_previous_errors(workflow_step)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_workflows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.41
4
+ version: 0.9.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Medovyy
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-07-29 00:00:00.000000000 Z
12
+ date: 2025-07-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails