livechat 0.8.1 → 0.8.2
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/AGENTS.md +8 -1
- data/README.md +19 -0
- data/lib/livechat/dashboard.css +19 -18
- data/lib/livechat/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: fae79e3391f4f16e1823d4d9b8755061c5ae66a4651d36f19b47448cae320f25
|
|
4
|
+
data.tar.gz: a65a2fad39a547c6ce06c4b9d6d25cea355868ae848819f155e01038fe6d1ee4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 812f2d09748da467a8d79d1921520f03b643d3430d1e53b159e3d1801a5fb79e9e64310db905edb2332ce4f8a5b6dfbcdfdaf2a68bb0efc4d4c017df9337c35c
|
|
7
|
+
data.tar.gz: 0417f271610f0139a39e9b921d16a59c30b6bda3f226563dca618a3d6405b928675755c6a7ece46c677e3cab516dcbe20e8d1b3e3c394592fe901fe7c1cd717a
|
data/AGENTS.md
CHANGED
|
@@ -107,7 +107,7 @@ Leave it off unless the app already has Action Cable working. Polling is not a d
|
|
|
107
107
|
### Do not
|
|
108
108
|
|
|
109
109
|
- **Do not copy the widget JavaScript into `app/javascript`, or add a `<script>` tag for it.** `livechat_tag` renders what is needed, and the engine serves the code with a content fingerprint. There is no build step and nothing for esbuild/importmap/Tailwind to know about.
|
|
110
|
-
- **Do not
|
|
110
|
+
- **Do not rebuild the inbox, and do not edit views inside the gem.** To put it inside an admin you already have, set `config.base_controller_class = "Admin::BaseController"` — it inherits that controller's layout, helpers, authentication and request context. For the shell alone, `config.agent_layout = "admin/application"`. Both work with nothing else wired up: the inbox's own assets are declared by its views, not the layout.
|
|
111
111
|
- **Do not add an Action Cable mount to "make chat realtime"** unless you also set `config.action_cable = true`. Polling is the default and is not broken.
|
|
112
112
|
- **Do not set config outside the initializer.** `rate_limit` in particular is read when the controller class loads; assigning config per-request mutates it process-wide.
|
|
113
113
|
- **Do not expose attachments by blob URL** — the engine's gated route exists so a leaked signed URL cannot hand over a customer's file.
|
|
@@ -119,6 +119,7 @@ Everything is optional; a fresh install works with zero config. Full list with c
|
|
|
119
119
|
| Option | Default | Note |
|
|
120
120
|
| --- | --- | --- |
|
|
121
121
|
| `authorize_agent` | development only | **Who can read the inbox. Set before deploying.** |
|
|
122
|
+
| `base_controller_class` | `ActionController::Base` | Controller the inbox inherits. Name your admin's and it adopts that layout, helpers, authentication and request context. Public endpoints never inherit it. |
|
|
122
123
|
| `enabled` | everyone | Per-request gate for the widget and its endpoints |
|
|
123
124
|
| `current_user` | `nil` | Receives the request; nil means guest-by-cookie |
|
|
124
125
|
| `visitor_label`, `agent_label` | name/email/to_s | Receive the user |
|
|
@@ -143,6 +144,8 @@ Turbo Drive and strict nonce-based CSP work out of the box. 26 locales ship with
|
|
|
143
144
|
|
|
144
145
|
| Symptom | Cause |
|
|
145
146
|
| --- | --- |
|
|
147
|
+
| `NameError` for one of your own helpers in the inbox | `isolate_namespace` scopes `helper` to the engine. Use `config.base_controller_class` so the inbox inherits your helpers, rather than `agent_layout` alone. |
|
|
148
|
+
| `NotNullViolation` attaching a file on a uuid-keyed app | The tables were generated bigint. Set `primary_key_type` in `config.generators` before installing, or migrate them to uuid. |
|
|
146
149
|
| `/livechat` returns 403 "Set Livechat.config.authorize_agent to grant access" | Exactly what it says: still at the development-only default |
|
|
147
150
|
| No bubble on the page | `livechat_tag` missing from the rendered layout, `config.enabled` false, or `show_launcher = false` with no opener of your own |
|
|
148
151
|
| No notification emails | `mailer_from` not set — `agent_emails` alone does nothing |
|
|
@@ -152,6 +155,10 @@ Turbo Drive and strict nonce-based CSP work out of the box. 26 locales ship with
|
|
|
152
155
|
|
|
153
156
|
---
|
|
154
157
|
|
|
158
|
+
## One family
|
|
159
|
+
|
|
160
|
+
`testimonials`, `ideasbugs`, `product_tours`, `i18n_proofreading` are the sibling engines. Same install shape, same host hooks (`base_controller_class`, `agent_layout`), same scoped dashboard CSS, same `primary_key_type`-aware migrations — so what you learn here transfers.
|
|
161
|
+
|
|
155
162
|
## Working on the gem itself
|
|
156
163
|
|
|
157
164
|
```bash
|
data/README.md
CHANGED
|
@@ -326,6 +326,25 @@ bundle exec rubocop
|
|
|
326
326
|
translation proofreading.
|
|
327
327
|
- [SupeRails](https://superails.com) — Rails screencasts.
|
|
328
328
|
|
|
329
|
+
## One family
|
|
330
|
+
|
|
331
|
+
Five Rails engines built on the same backbone, so adopting a second one is
|
|
332
|
+
mostly muscle memory:
|
|
333
|
+
|
|
334
|
+
| Gem | What it does |
|
|
335
|
+
| --- | --- |
|
|
336
|
+
| [testimonials](https://github.com/yshmarov/testimonials) | Testimonials, reviews and NPS — text and video, collected in your own app |
|
|
337
|
+
| [ideasbugs](https://github.com/yshmarov/ideasbugs) | In-app bug reports and feature requests, with a triage queue |
|
|
338
|
+
| **livechat** *(this gem)* | Live chat between your visitors and your agents, self-hosted |
|
|
339
|
+
| [product_tours](https://github.com/yshmarov/product_tours) | Product tours and video tutorials, shown in-app at the right moment |
|
|
340
|
+
| [i18n_proofreading](https://github.com/yshmarov/i18n_proofreading) | In-context translation fixes suggested by your own users |
|
|
341
|
+
|
|
342
|
+
They share the install shape (`generate <gem>:install`, mount, one initializer),
|
|
343
|
+
the same host hooks (`base_controller_class` to inherit your admin's controller,
|
|
344
|
+
`agent_layout` for just the shell), a dashboard stylesheet scoped so it
|
|
345
|
+
cannot touch your own CSS, and migrations that follow your app's
|
|
346
|
+
`primary_key_type`.
|
|
347
|
+
|
|
329
348
|
## License
|
|
330
349
|
|
|
331
350
|
MIT.
|
data/lib/livechat/dashboard.css
CHANGED
|
@@ -52,24 +52,6 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/* Page frame — the gem's own layout only. */
|
|
56
|
-
.lvc-page { margin: 0; background: var(--lvc-bg); color: var(--lvc-text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
57
|
-
/* Desktop inbox: a durable conversation list on the left and the active thread on the right, with each pane owning its own scroll. */
|
|
58
|
-
.lvc-inbox, .lvc-inbox .container { height: 100vh; height: 100dvh; }
|
|
59
|
-
.lvc-inbox { overflow: hidden; }
|
|
60
|
-
.lvc-inbox .container { max-width: 1280px; display: flex; flex-direction: column; padding-bottom: 16px; }
|
|
61
|
-
.lvc-inbox .container h1 { flex: 0 0 auto; margin-bottom: 14px; }
|
|
62
|
-
/* Conversation page: fill the viewport and scroll the THREAD, not the page — so a reply never jumps the page, and the composer stays put. */
|
|
63
|
-
.lvc-convo, .lvc-convo .container { height: 100vh; height: 100dvh; }
|
|
64
|
-
.lvc-convo { overflow: hidden; }
|
|
65
|
-
.lvc-convo .container { display: flex; flex-direction: column; padding-bottom: 16px; }
|
|
66
|
-
.lvc-convo .breadcrumb, .lvc-convo .head-row, .lvc-convo .context-line,
|
|
67
|
-
.lvc-convo .flash { flex: 0 0 auto; }
|
|
68
|
-
.lvc-convo .conversation-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
|
69
|
-
.lvc-convo .card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
|
70
|
-
.lvc-convo .thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
|
|
71
|
-
.lvc-convo .reply { flex: 0 0 auto; }
|
|
72
|
-
|
|
73
55
|
/* Dashboard components — any layout. */
|
|
74
56
|
.lvc-dashboard {
|
|
75
57
|
/* A scoping device, not a layout one: without this the wrapper would
|
|
@@ -216,3 +198,22 @@
|
|
|
216
198
|
& .empty-state p { margin: 0; }
|
|
217
199
|
& .mobile-back { display: none; }
|
|
218
200
|
}
|
|
201
|
+
|
|
202
|
+
/* Page frame — the gem's own layout only. Last, so it wins the
|
|
203
|
+
specificity ties against the component layer above. */
|
|
204
|
+
.lvc-page { margin: 0; background: var(--lvc-bg); color: var(--lvc-text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
205
|
+
/* Desktop inbox: a durable conversation list on the left and the active thread on the right, with each pane owning its own scroll. */
|
|
206
|
+
.lvc-inbox, .lvc-inbox .container { height: 100vh; height: 100dvh; }
|
|
207
|
+
.lvc-inbox { overflow: hidden; }
|
|
208
|
+
.lvc-inbox .container { max-width: 1280px; display: flex; flex-direction: column; padding-bottom: 16px; }
|
|
209
|
+
.lvc-inbox .container h1 { flex: 0 0 auto; margin-bottom: 14px; }
|
|
210
|
+
/* Conversation page: fill the viewport and scroll the THREAD, not the page — so a reply never jumps the page, and the composer stays put. */
|
|
211
|
+
.lvc-convo, .lvc-convo .container { height: 100vh; height: 100dvh; }
|
|
212
|
+
.lvc-convo { overflow: hidden; }
|
|
213
|
+
.lvc-convo .container { display: flex; flex-direction: column; padding-bottom: 16px; }
|
|
214
|
+
.lvc-convo .breadcrumb, .lvc-convo .head-row, .lvc-convo .context-line,
|
|
215
|
+
.lvc-convo .flash { flex: 0 0 auto; }
|
|
216
|
+
.lvc-convo .conversation-panel { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
|
217
|
+
.lvc-convo .card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
|
|
218
|
+
.lvc-convo .thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
|
|
219
|
+
.lvc-convo .reply { flex: 0 0 auto; }
|
data/lib/livechat/version.rb
CHANGED