livechat 0.6.0 → 0.6.1

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: aee50137fc34157ea3fff75a2095055b4224c2d0ced2524ea13278135256b07f
4
- data.tar.gz: 358aa67a9cb0a4b30ee961078cf4d8ae740da6fbbe04cbdcba987fc68c7e866f
3
+ metadata.gz: 89fb2589ac2b07d722d95c48bf0de22dcdcaa21ebcc8e691ffa4a3eb862fcd3d
4
+ data.tar.gz: cbb878a7a0c0794459468f3f857473ad1f29b6b92a477572be99797166eeefcf
5
5
  SHA512:
6
- metadata.gz: 45f8656ac4857d04970159bfc75052b75da1152b993d83a4c7c743589cda5e78cf5e47c2de7607c2c94d4fafdce880c50dd36b02000dcc2ec1e4a16343c4821e
7
- data.tar.gz: c7e6e959cd01488ca58a8e59ed943da3233d9e9e3b6670aac19be11915a8595e8ec680bac0b4ad262a19b755be42da7bbf16af007e56815fed7f8aaffd7e5683
6
+ metadata.gz: b9fc7e79282e70099732ac379632844d12601b61c438598f39551ed3fca91e635ce424c97786afd51ecdd18a814f10bab3c14d6fc53ad3f6bda54c22eeb78688
7
+ data.tar.gz: 14812aa4533f89bf621688036929e0d6bb9e13d2e9bef4339d59c83a62300ed3cefe5f382f928d8d91ab46cfc084a8a47e467adfa15d0ee43921c9cedf238264
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1
4
+
5
+ - Repositioned the docs around in-app support messaging for Rails: users ask
6
+ for help from the page where they got stuck, and teams answer from the
7
+ mounted inbox without SaaS, third-party scripts, or a separate support app.
8
+ - Added `message:` to `livechat_button`, so contextual support buttons can open
9
+ the widget and prefill the composer in one helper call.
10
+ - Updated the PRD to match the current shipped feature set through 0.6.0.
11
+
3
12
  ## 0.6.0
4
13
 
5
14
  - Improved unread notification emails. Team emails now summarize the unread
data/README.md CHANGED
@@ -5,9 +5,13 @@
5
5
  [![CI](https://github.com/yshmarov/livechat/actions/workflows/ci.yml/badge.svg)](https://github.com/yshmarov/livechat/actions/workflows/ci.yml)
6
6
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](MIT-LICENSE)
7
7
 
8
- **Open-source live chat for Rails.** A chat bubble for your users, an inbox for
9
- your team as a gem, not another service to deploy. Alternative to Crisp,
10
- Intercom and Chatwoot.
8
+ **In-app support messaging for Rails.** Add a chat button so users can ask for
9
+ help from the page where they got stuck. Your team answers from a mounted inbox.
10
+ No SaaS account, no third-party script, no separate app, no customer data leaving
11
+ your database.
12
+
13
+ Use it when email is too detached, Intercom is too much, and Chatwoot is another
14
+ app you do not want to deploy.
11
15
 
12
16
  ![The livechat widget open over a running Rails app](docs/screenshots/01-widget.png)
13
17
 
@@ -232,11 +236,35 @@ to a stream the server signed for it. Under a strict CSP, allow the socket with
232
236
  | `data-livechat-open` | Any element opens the panel on click |
233
237
  | `data-livechat-message="…"` | Prefill from that element — great for contextual buttons |
234
238
  | `<%= livechat_button %>` | A plain, unstyled opener button |
239
+ | `<%= livechat_button("Ask about this order", message: "I need help with order ##{@order.id}") %>` | Open and prefill in one helper |
235
240
  | `config.show_launcher = false` | Hide the bubble entirely |
236
241
 
237
242
  While replies are unread, every `data-livechat-open` element carries a small
238
243
  count badge — so hiding the launcher never hides the answer.
239
244
 
245
+ Contextual buttons are where a Rails app beats a generic support widget:
246
+
247
+ ```erb
248
+ <%= livechat_button("Ask about this order",
249
+ message: "I need help with order ##{@order.id}") %>
250
+
251
+ <%= livechat_button("Ask about this invoice",
252
+ message: "I need help with invoice ##{@invoice.number}") %>
253
+
254
+ <button data-livechat-open
255
+ data-livechat-message="I need help with project <%= @project.name %>">
256
+ Contact support
257
+ </button>
258
+ ```
259
+
260
+ ## Use cases
261
+
262
+ - SaaS apps: answer billing, onboarding and account questions from inside the app.
263
+ - Customer portals: let users ask about orders, invoices, documents or bookings.
264
+ - Marketplaces: keep buyer, seller and admin support tied to the current page.
265
+ - Internal tools: give non-technical teammates a direct line from admin screens.
266
+ - Course and member apps: handle access, lesson and subscription questions in context.
267
+
240
268
  ## What it doesn't do
241
269
 
242
270
  No AI bots, no canned responses, no omnichannel (WhatsApp, Messenger…), no
@@ -18,12 +18,17 @@ module Livechat
18
18
  end
19
19
 
20
20
  # A plain, unstyled <button> that opens the chat — it picks up the host's
21
- # own styles. Put it anywhere on a page that also renders livechat_tag.
22
- def livechat_button(label: nil, **)
21
+ # own styles. Pass message: to prefill the composer with page-specific
22
+ # context. Put it anywhere on a page that also renders livechat_tag.
23
+ def livechat_button(label = nil, message: nil, **options)
23
24
  return unless Livechat.enabled?(request)
24
25
 
26
+ label ||= options.delete(:label)
25
27
  label ||= I18n.t(:launcher, scope: :livechat, default: 'Chat with us')
26
- tag.button(label, type: 'button', 'data-livechat-open': '', **)
28
+ data = (options.delete(:data) { {} } || {}).merge(livechat_open: '')
29
+ data[:livechat_message] = message if message.present?
30
+
31
+ tag.button(label, type: 'button', data: data, **options)
27
32
  end
28
33
 
29
34
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Livechat
4
- VERSION = '0.6.0'
4
+ VERSION = '0.6.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livechat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov