meta_workflows 0.9.29 → 0.9.31

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: 236fbbb0daa94f64ff23edee6643c93e31483620abbbcf3b1290141db9a352a0
4
- data.tar.gz: f22d67ce0bce5fd5c5f6f268aace75c0179a66ef59c2e88a61918a9ca34434e0
3
+ metadata.gz: '082bc115fde4da66c333a64ed7f8ab9ae036097687297d12813e604cbd907bbc'
4
+ data.tar.gz: 4b8ae8d4f4f3ca60cdd6afb6a658cdcaa9c312bcd26f20d5f600abf3ea6edf79
5
5
  SHA512:
6
- metadata.gz: 7cbcfb8fbf2fa69920f4605d79f2ab73f1ced4486709c2d14d2ed9f8180ed3c8417346545de0e5d98946ce6b075b2ad17ee95e1e3dbfc82d7d51a5ecc4a0acbb
7
- data.tar.gz: b3eef7ce30cb896b830ecf08d570c184b58ce0c892a21fdde739a3f36bd8a14c9531b79d3ec67ed8978844cbaaf0654a714e26a2b82b6afc796c1ac58c7d4a90
6
+ metadata.gz: e5412dbe3df1a2e872de904fdc80569802bedce14f5656cb3192878df024058ccc32c92d52ad7cd90b57ad550f4f69c49401a51e3637dd01b64937aabd918180
7
+ data.tar.gz: b49065a8e236c76a4a50655c462ecb02ee54ae65a0275b2bec9e9807a1da8b58d14101fdf0047089e2db2b76bea5b6e9b8d62730f3d47cb83f24aa7a6729320f
data/README.md CHANGED
@@ -746,7 +746,8 @@ MetaWorkflows provides a flexible tray system for building modern, multi-pane la
746
746
  | Delta | Bottom tray | Optional collapsible tray at the bottom |
747
747
 
748
748
  ### How It Works
749
- - The tray system is controlled by a `TrayConfigurable` concern included in your controllers.
749
+ - The tray system is controlled by a `MetaWorkflows::TrayConfigurable` concern included in your `ApplicationController`.
750
+ - The concern requires your `ApplicationController` to implement a `configure_trays` method - it will raise `NotImplementedError` if not implemented.
750
751
  - By default, all trays are hidden. You must explicitly set `visible: true` for any tray you want to show.
751
752
  - The engine's layout will automatically respect your tray configuration.
752
753
 
@@ -756,8 +757,17 @@ MetaWorkflows provides a flexible tray system for building modern, multi-pane la
756
757
 
757
758
  ```ruby
758
759
  class ApplicationController < ActionController::Base
759
- include TrayConfigurable
760
+ include MetaWorkflows::TrayConfigurable
760
761
  before_action :configure_trays
762
+
763
+ private
764
+
765
+ def configure_trays
766
+ # ApplicationController must implement this method - it will raise NotImplementedError if not defined
767
+ tray_config[:beta][:visible] = false
768
+ tray_config[:gamma][:visible] = false
769
+ tray_config[:delta][:visible] = false
770
+ end
761
771
  end
762
772
  ```
763
773
 
@@ -765,8 +775,10 @@ MetaWorkflows provides a flexible tray system for building modern, multi-pane la
765
775
 
766
776
  ```ruby
767
777
  class PostsController < ApplicationController
778
+ private
779
+
768
780
  def configure_trays
769
- super
781
+ super # Call parent implementation first
770
782
  tray_config[:beta][:visible] = true # Show Beta (left) tray
771
783
  tray_config[:gamma][:visible] = false # Hide Gamma (right) tray
772
784
  tray_config[:delta][:collapsible] = false # Make Delta (bottom) tray not collapsible
@@ -775,6 +787,7 @@ MetaWorkflows provides a flexible tray system for building modern, multi-pane la
775
787
  ```
776
788
 
777
789
  3. **Default Behavior:**
790
+ - Your `ApplicationController` must implement the `configure_trays` method or a `NotImplementedError` will be raised.
778
791
  - All trays are hidden unless set to `visible: true`.
779
792
  - Trays are collapsible by default; set `collapsible: false` to disable collapsing.
780
793
 
@@ -785,8 +798,10 @@ MetaWorkflows provides a flexible tray system for building modern, multi-pane la
785
798
 
786
799
  ```ruby
787
800
  class DashboardController < ApplicationController
801
+ private
802
+
788
803
  def configure_trays
789
- super
804
+ super # Call parent implementation first
790
805
  tray_config[:beta][:visible] = true
791
806
  tray_config[:gamma][:visible] = false
792
807
  tray_config[:delta][:visible] = false
@@ -799,7 +814,7 @@ end
799
814
  - You can override tray configuration per controller or per action as needed.
800
815
  - The main content area (Alpha tray) is always visible and holds your page content.
801
816
 
802
- For more advanced usage or to contribute improvements, see the tray logic in `TrayConfigurable` and the engine layout file.
817
+ For more advanced usage or to contribute improvements, see the tray logic in `MetaWorkflows::TrayConfigurable` and the engine layout file.
803
818
 
804
819
  ## Confluence Documentation
805
820
 
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MetaWorkflows
4
+ module TrayConfigurable
5
+ extend ActiveSupport::Concern
6
+
7
+ included do
8
+ helper_method :tray_config
9
+ end
10
+
11
+ def tray_config
12
+ @tray_config ||= {
13
+ beta: {
14
+ visible: true,
15
+ collapsible: true,
16
+ lexi: false
17
+ },
18
+ gamma: {
19
+ visible: true,
20
+ collapsible: true,
21
+ lexi: false
22
+ },
23
+ delta: {
24
+ visible: true,
25
+ collapsible: true,
26
+ lexi: false
27
+ }
28
+ }
29
+ end
30
+
31
+ # Override in controllers to customize tray configuration
32
+ # This method should be called as a before_action in the application controller.
33
+ def configure_trays
34
+ raise NotImplementedError, "#{self.class.name} must implement #configure_trays to define tray configuration"
35
+ end
36
+ end
37
+ end
@@ -4,15 +4,6 @@ module MetaWorkflows
4
4
  class ApplicationController < ActionController::Base
5
5
  protect_from_forgery with: :exception
6
6
 
7
- include TrayConfigurable
8
- before_action :configure_trays
9
-
10
- def configure_trays
11
- super
12
- tray_config[:beta][:visible] = false
13
- tray_config[:gamma][:visible] = false
14
- tray_config[:delta][:visible] = false
15
- end
16
7
  # Add any MetaWorkflows-specific controller functionality here
17
8
  # This ensures proper engine isolation
18
9
  end
@@ -58,17 +58,6 @@ module MetaWorkflows
58
58
  'meta_workflows/lexi_chat_alpha_tray'
59
59
  end
60
60
 
61
- def random_chat_placeholder
62
- [
63
- 'What would you like to improve?',
64
- 'Suggest an edit or ask for changes...',
65
- 'Let me know how I can improve this.',
66
- 'Not quite right? Let me know.',
67
- 'Edit, clarify, or request a change.',
68
- 'Happy with this, or want changes?'
69
- ].sample
70
- end
71
-
72
61
  def tray_state(tray)
73
62
  (cookies['tray_'] && cookies['tray_'][tray.to_s]) || cookies["tray_#{tray}"] || 'expanded'
74
63
  end
@@ -13,7 +13,7 @@
13
13
  <div class="lexi-input-container lexi-input-max-height">
14
14
  <!-- Text Input -->
15
15
  <div class="lexi-textarea-wrapper">
16
- <%= form.text_area :message, rows: 1, placeholder: random_chat_placeholder, disabled: local_assigns[:responding] || !local_assigns[:response_enabled], class: "lexi-textarea lexi-textarea-min-height", data: { action: "keypress.enter->meta-workflows--lexi-form-submit#handleKeyDown", "meta-workflows--lexi-form-submit-target": "textarea" } %>
16
+ <%= form.text_area :message, rows: 1, placeholder: 'Reply to Lexi...', disabled: local_assigns[:responding] || !local_assigns[:response_enabled], class: "lexi-textarea lexi-textarea-min-height", data: { action: "keypress.enter->meta-workflows--lexi-form-submit#handleKeyDown", "meta-workflows--lexi-form-submit-target": "textarea" } %>
17
17
  </div>
18
18
 
19
19
  <div class="lexi-input-controls">
@@ -3,7 +3,7 @@
3
3
  module MetaWorkflows
4
4
  MAJOR = 0
5
5
  MINOR = 9
6
- PATCH = 29 # this is automatically incremented by the build process
6
+ PATCH = 31 # this is automatically incremented by the build process
7
7
 
8
8
  VERSION = "#{MetaWorkflows::MAJOR}.#{MetaWorkflows::MINOR}.#{MetaWorkflows::PATCH}".freeze
9
9
  end
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.29
4
+ version: 0.9.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonid Medovyy
@@ -130,7 +130,7 @@ files:
130
130
  - app/assets/javascripts/meta_workflows_manifest.js
131
131
  - app/assets/stylesheets/meta_workflows/application.css
132
132
  - app/controllers/concerns/meta_workflows/streamable.rb
133
- - app/controllers/concerns/tray_configurable.rb
133
+ - app/controllers/concerns/meta_workflows/tray_configurable.rb
134
134
  - app/controllers/meta_workflows/application_controller.rb
135
135
  - app/controllers/meta_workflows/base_debug_controller.rb
136
136
  - app/controllers/meta_workflows/debug_controller.rb
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module TrayConfigurable
4
- extend ActiveSupport::Concern
5
-
6
- included do
7
- helper_method :tray_config
8
- end
9
-
10
- def tray_config
11
- @tray_config ||= {
12
- beta: {
13
- visible: true,
14
- collapsible: true,
15
- lexi: false
16
- },
17
- gamma: {
18
- visible: true,
19
- collapsible: true,
20
- lexi: false
21
- },
22
- delta: {
23
- visible: true,
24
- collapsible: true,
25
- lexi: false
26
- }
27
- }
28
- end
29
-
30
- # Override in controllers to customize tray configuration
31
- def configure_trays
32
- # Example:
33
- # tray_config[:beta][:visible] = true
34
- # tray_config[:gamma][:collapsible] = false
35
- end
36
- end