turbo_chat 0.1.14 → 0.1.15
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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +32 -0
- data/app/helpers/turbo_chat/application_helper/config_support.rb +8 -0
- data/app/views/turbo_chat/chats/show.html.erb +65 -37
- data/lib/generators/turbo_chat/install/templates/turbo_chat.rb +16 -0
- data/lib/turbo_chat/configuration/defaults.rb +9 -1
- data/lib/turbo_chat/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62e1eb06f88659efb5df1cc8a72f33e669b2a969dd734abc8a977aa4331fe925
|
|
4
|
+
data.tar.gz: 5c40f2095d91a51a69cafd0086553ceab8ecf69894696bc8de2f86498170e52a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a0ebcdf8245e4c726f65071d9da1bb673cbef17ae2327c0e3708e86097bedf90a51a9deaef21b9e28b19aef5552f0071b164a21e571a0e332834775dab54db78
|
|
7
|
+
data.tar.gz: 7e9ede1f0c631f03642b8c9da45a5ec4a15b0880edc85ae3f6ea51b2aa4aaf59e25d91786b2ab3e9a30e4c4ea890c47deee143910978ebcb74793d20cfa203ed
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `turbo_chat` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.1.15] - 2026-02-28
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Configurable chat-header visibility toggles for title, status badge, and close/leave/back actions.
|
|
9
|
+
- Configurable members-area visibility toggles for member list, invite controls, and hidden-members invite fallback.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Updated `rack` to `3.2.5` and `nokogiri` to `1.19.1` to address advisory findings in release audit.
|
|
13
|
+
|
|
5
14
|
## [0.1.14] - 2026-02-28
|
|
6
15
|
|
|
7
16
|
### Added
|
data/README.md
CHANGED
|
@@ -129,6 +129,15 @@ TurboChat.configure do |config|
|
|
|
129
129
|
config.style.chat_style = "chat_style_bounded"
|
|
130
130
|
config.chat_message.message_insert_position = "append_end" # or "append_start"
|
|
131
131
|
config.chat.disable_input = false
|
|
132
|
+
config.chat.show_members = true
|
|
133
|
+
config.chat.show_members_list = true
|
|
134
|
+
config.chat.show_members_invite_controls = true
|
|
135
|
+
config.chat.show_invite_fallback_when_members_hidden = true
|
|
136
|
+
config.chat.show_header_title = true
|
|
137
|
+
config.chat.show_header_status = true
|
|
138
|
+
config.chat.show_header_close_action = true
|
|
139
|
+
config.chat.show_header_leave_action = true
|
|
140
|
+
config.chat.show_header_back_action = true
|
|
132
141
|
config.signals.signal_ttl_seconds = 60
|
|
133
142
|
config.style.signal_text_sheen = true
|
|
134
143
|
|
|
@@ -204,6 +213,29 @@ TurboChat.configure do |config|
|
|
|
204
213
|
end
|
|
205
214
|
```
|
|
206
215
|
|
|
216
|
+
Chat header elements can also be disabled globally:
|
|
217
|
+
|
|
218
|
+
```ruby
|
|
219
|
+
TurboChat.configure do |config|
|
|
220
|
+
config.chat.show_header_title = false
|
|
221
|
+
config.chat.show_header_status = false
|
|
222
|
+
config.chat.show_header_close_action = false
|
|
223
|
+
config.chat.show_header_leave_action = false
|
|
224
|
+
config.chat.show_header_back_action = false
|
|
225
|
+
end
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Members area visibility can be tuned independently:
|
|
229
|
+
|
|
230
|
+
```ruby
|
|
231
|
+
TurboChat.configure do |config|
|
|
232
|
+
config.chat.show_members = true
|
|
233
|
+
config.chat.show_members_list = true
|
|
234
|
+
config.chat.show_members_invite_controls = true
|
|
235
|
+
config.chat.show_invite_fallback_when_members_hidden = true
|
|
236
|
+
end
|
|
237
|
+
```
|
|
238
|
+
|
|
207
239
|
## Roles
|
|
208
240
|
|
|
209
241
|
Built-in roles:
|
|
@@ -8,8 +8,16 @@ module TurboChat
|
|
|
8
8
|
emit_invitation_events: false,
|
|
9
9
|
emit_chat_lifecycle_events: false,
|
|
10
10
|
show_members: true,
|
|
11
|
+
show_members_list: true,
|
|
12
|
+
show_members_invite_controls: true,
|
|
13
|
+
show_invite_fallback_when_members_hidden: true,
|
|
11
14
|
show_self_signals: false,
|
|
12
15
|
disable_input: false,
|
|
16
|
+
show_header_title: true,
|
|
17
|
+
show_header_status: true,
|
|
18
|
+
show_header_close_action: true,
|
|
19
|
+
show_header_leave_action: true,
|
|
20
|
+
show_header_back_action: true,
|
|
13
21
|
composer_add_files_display: false,
|
|
14
22
|
composer_add_files_active: false,
|
|
15
23
|
composer_microphone_display: false,
|
|
@@ -14,6 +14,18 @@
|
|
|
14
14
|
<% chat_messages = @chat_messages.to_a %>
|
|
15
15
|
<% chat_messages.reverse! if message_insert_position == "append_start" %>
|
|
16
16
|
<% can_render_composer = @can_post_message && !chat_disable_input? %>
|
|
17
|
+
<% show_header_title = chat_show_header_title? %>
|
|
18
|
+
<% show_header_status = chat_show_header_status? %>
|
|
19
|
+
<% show_header_close_action = chat_show_header_close_action? %>
|
|
20
|
+
<% show_header_leave_action = chat_show_header_leave_action? %>
|
|
21
|
+
<% show_header_back_action = chat_show_header_back_action? %>
|
|
22
|
+
<% show_header_actions = show_header_close_action || show_header_leave_action || show_header_back_action %>
|
|
23
|
+
<% show_members_list = chat_show_members_list? %>
|
|
24
|
+
<% show_members_invite_controls = chat_show_members_invite_controls? %>
|
|
25
|
+
<% show_invite_fallback_when_members_hidden = chat_show_invite_fallback_when_members_hidden? %>
|
|
26
|
+
<% show_members_invite_block = show_members_invite_controls && @can_invite_member %>
|
|
27
|
+
<% show_members_panel = @show_members && (show_members_list || show_members_invite_block) %>
|
|
28
|
+
<% show_invite_fallback = !@show_members && show_members_invite_block && show_invite_fallback_when_members_hidden %>
|
|
17
29
|
<section class="<%= chat_shell_classes %>"
|
|
18
30
|
data-chat-id="<%= @chat.id %>"
|
|
19
31
|
data-chat-style="<%= chat_style_key %>"
|
|
@@ -36,47 +48,61 @@
|
|
|
36
48
|
<header class="chat-header">
|
|
37
49
|
<div class="chat-header-copy">
|
|
38
50
|
<p class="chat-header-kicker"><%= @chat.closed? ? "Conversation closed" : "Conversation active" %></p>
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
method: :patch,
|
|
51
|
-
form_class: "chat-inline-form",
|
|
52
|
-
class: "chat-btn chat-btn--danger",
|
|
53
|
-
data: { turbo_confirm: "Close this chat?" } %>
|
|
54
|
-
<% elsif @chat.closed? && @can_reopen_chat %>
|
|
55
|
-
<%= button_to "Reopen",
|
|
56
|
-
reopen_chat_path(@chat),
|
|
57
|
-
method: :patch,
|
|
58
|
-
form_class: "chat-inline-form",
|
|
59
|
-
class: "chat-btn chat-btn--success" %>
|
|
51
|
+
<% if show_header_title || show_header_status %>
|
|
52
|
+
<div class="chat-header-title-row">
|
|
53
|
+
<% if show_header_title %>
|
|
54
|
+
<h1><%= @chat.title %></h1>
|
|
55
|
+
<% end %>
|
|
56
|
+
<% if show_header_status %>
|
|
57
|
+
<span class="chat-status <%= @chat.closed? ? "chat-status--closed" : "chat-status--open" %>">
|
|
58
|
+
<%= @chat.closed? ? "Closed" : "Open" %>
|
|
59
|
+
</span>
|
|
60
|
+
<% end %>
|
|
61
|
+
</div>
|
|
60
62
|
<% end %>
|
|
61
|
-
|
|
62
|
-
<%= button_to "Leave",
|
|
63
|
-
leave_chat_path(@chat),
|
|
64
|
-
method: :patch,
|
|
65
|
-
form_class: "chat-inline-form",
|
|
66
|
-
class: "chat-btn chat-btn--danger",
|
|
67
|
-
data: { turbo_confirm: "Leave this chat?" } %>
|
|
68
|
-
<%= link_to "Back", chats_path, class: "chat-btn chat-btn--ghost" %>
|
|
69
63
|
</div>
|
|
64
|
+
<% if show_header_actions %>
|
|
65
|
+
<div class="chat-header-actions">
|
|
66
|
+
<% if show_header_close_action %>
|
|
67
|
+
<% if @chat.opened? && @can_close_chat %>
|
|
68
|
+
<%= button_to "Close",
|
|
69
|
+
close_chat_path(@chat),
|
|
70
|
+
method: :patch,
|
|
71
|
+
form_class: "chat-inline-form",
|
|
72
|
+
class: "chat-btn chat-btn--danger",
|
|
73
|
+
data: { turbo_confirm: "Close this chat?" } %>
|
|
74
|
+
<% elsif @chat.closed? && @can_reopen_chat %>
|
|
75
|
+
<%= button_to "Reopen",
|
|
76
|
+
reopen_chat_path(@chat),
|
|
77
|
+
method: :patch,
|
|
78
|
+
form_class: "chat-inline-form",
|
|
79
|
+
class: "chat-btn chat-btn--success" %>
|
|
80
|
+
<% end %>
|
|
81
|
+
<% end %>
|
|
82
|
+
|
|
83
|
+
<% if show_header_leave_action %>
|
|
84
|
+
<%= button_to "Leave",
|
|
85
|
+
leave_chat_path(@chat),
|
|
86
|
+
method: :patch,
|
|
87
|
+
form_class: "chat-inline-form",
|
|
88
|
+
class: "chat-btn chat-btn--danger",
|
|
89
|
+
data: { turbo_confirm: "Leave this chat?" } %>
|
|
90
|
+
<% end %>
|
|
91
|
+
<% if show_header_back_action %>
|
|
92
|
+
<%= link_to "Back", chats_path, class: "chat-btn chat-btn--ghost" %>
|
|
93
|
+
<% end %>
|
|
94
|
+
</div>
|
|
95
|
+
<% end %>
|
|
70
96
|
</header>
|
|
71
97
|
|
|
72
|
-
<% if
|
|
98
|
+
<% if show_members_panel %>
|
|
73
99
|
<section class="chat-members">
|
|
74
100
|
<details class="chat-members-panel">
|
|
75
101
|
<summary class="chat-members-summary">
|
|
76
102
|
<span>Members</span>
|
|
77
103
|
</summary>
|
|
78
104
|
<div class="chat-members-content">
|
|
79
|
-
<% if
|
|
105
|
+
<% if show_members_invite_block %>
|
|
80
106
|
<div class="chat-members-invite <%= invite_option_rows.present? ? "chat-members-invite--active" : "chat-members-invite--hint" %>">
|
|
81
107
|
<% if invite_option_rows.present? %>
|
|
82
108
|
<%= render "turbo_chat/chats/invite_form",
|
|
@@ -89,15 +115,17 @@
|
|
|
89
115
|
<% end %>
|
|
90
116
|
</div>
|
|
91
117
|
<% end %>
|
|
92
|
-
|
|
93
|
-
<
|
|
94
|
-
<%=
|
|
95
|
-
|
|
96
|
-
|
|
118
|
+
<% if show_members_list %>
|
|
119
|
+
<div class="chat-members-list-shell">
|
|
120
|
+
<ul id="<%= dom_id(@chat, :member_entries) %>" class="chat-members-list" data-chat-member-list="true" data-chat-id="<%= @chat.id %>">
|
|
121
|
+
<%= render "turbo_chat/chats/member_entries", chat: @chat %>
|
|
122
|
+
</ul>
|
|
123
|
+
</div>
|
|
124
|
+
<% end %>
|
|
97
125
|
</div>
|
|
98
126
|
</details>
|
|
99
127
|
</section>
|
|
100
|
-
<% elsif
|
|
128
|
+
<% elsif show_invite_fallback %>
|
|
101
129
|
<div class="chat-invite">
|
|
102
130
|
<% if invite_option_rows.present? %>
|
|
103
131
|
<%= render "turbo_chat/chats/invite_form",
|
|
@@ -18,10 +18,26 @@ TurboChat.configure do |config|
|
|
|
18
18
|
# Duration used to classify chats as active.
|
|
19
19
|
config.chat.show_members = true
|
|
20
20
|
# Shows member list panel in chat UI.
|
|
21
|
+
config.chat.show_members_list = true
|
|
22
|
+
# Shows member entries list inside the members panel.
|
|
23
|
+
config.chat.show_members_invite_controls = true
|
|
24
|
+
# Shows invite controls in members panel (and in fallback invite area when enabled).
|
|
25
|
+
config.chat.show_invite_fallback_when_members_hidden = true
|
|
26
|
+
# Shows fallback invite area when members panel is hidden.
|
|
21
27
|
config.chat.system_messages = true
|
|
22
28
|
# Shows system timeline messages (joins, invites, moderation).
|
|
23
29
|
# config.chat.disable_input = true
|
|
24
30
|
# Disables composer rendering and blocks message submissions.
|
|
31
|
+
# config.chat.show_header_title = false
|
|
32
|
+
# Hides the chat title in the conversation header.
|
|
33
|
+
# config.chat.show_header_status = false
|
|
34
|
+
# Hides the Open/Closed status tag in the conversation header.
|
|
35
|
+
# config.chat.show_header_close_action = false
|
|
36
|
+
# Hides the Close/Reopen action in the conversation header.
|
|
37
|
+
# config.chat.show_header_leave_action = false
|
|
38
|
+
# Hides the Leave action in the conversation header.
|
|
39
|
+
# config.chat.show_header_back_action = false
|
|
40
|
+
# Hides the Back action in the conversation header.
|
|
25
41
|
|
|
26
42
|
# Chat message behavior
|
|
27
43
|
config.chat_message.enable_mentions = true
|
|
@@ -71,8 +71,16 @@ class TurboChat::Configuration
|
|
|
71
71
|
max_chat_participants: 10,
|
|
72
72
|
active_chat_window: -> { 5.minutes },
|
|
73
73
|
show_members: true,
|
|
74
|
+
show_members_list: true,
|
|
75
|
+
show_members_invite_controls: true,
|
|
76
|
+
show_invite_fallback_when_members_hidden: true,
|
|
74
77
|
system_messages: true,
|
|
75
|
-
disable_input: false
|
|
78
|
+
disable_input: false,
|
|
79
|
+
show_header_title: true,
|
|
80
|
+
show_header_status: true,
|
|
81
|
+
show_header_close_action: true,
|
|
82
|
+
show_header_leave_action: true,
|
|
83
|
+
show_header_back_action: true
|
|
76
84
|
}.freeze
|
|
77
85
|
|
|
78
86
|
CHAT_MESSAGE_DEFAULTS = {
|
data/lib/turbo_chat/version.rb
CHANGED