livechat 0.4.4 → 0.4.6

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: fd6a72ade19436355c068f67d4c036f6f84b66e32cd163e36f3022619fa1587c
4
- data.tar.gz: c7936d6b60c1bdc5f509f44e186a16e21368b1b2328d54ac7dc7918ee2ab7893
3
+ metadata.gz: daa490b0c4d70500971447e501bd9a8a83bbdf6c0d9d73e093becc84319b3988
4
+ data.tar.gz: 1199336c0fa8ab2ee68d338d01a5c80e60361611e257fdaff5228b3eb8f577c2
5
5
  SHA512:
6
- metadata.gz: 44f6a47b5879c17554031dc0d0f5a1e92943c180aaa08c855edc803682b3a558a3b232ab9fac16982f6bf2423505a72ca83e3173ad4e07491dc618bda43e24ef
7
- data.tar.gz: 9c025865ff9824eac83660af0775e74e08a508472056ca29dffc5c129f6b69f3c291db006a31a1f8b26a43ba0dfea9f29bdfb992eb0f30ee6a91b5db4cf1d8bd
6
+ metadata.gz: 12e47c2e8b8ff3c412531cbb88033aebde6aaebea5cd0f9fd28cc64ee16e79c32e8448a7e0b2f3d8b951e3f176d2e83566e280b6401d8897c765fd6b76428e7a
7
+ data.tar.gz: e32220e0923be59ccabdf99fb3ea93816c203dbecaae4faa769b84aeb36a3f96735f8719b1d8d2e3a1ca23f841ebc0d8b12b6ea66562f8c3e82ebb7e3484cb20
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.6
4
+
5
+ - Inbox conversation page no longer scrolls the whole page. It now fills the
6
+ viewport with the message thread as the only scrolling region and the reply
7
+ composer pinned at the bottom — so sending a reply keeps you at the newest
8
+ message instead of jumping the page up to the redirect anchor. (A real
9
+ chat-app layout, matching the visitor widget.)
10
+
11
+ ## 0.4.5
12
+
13
+ - The widget's injected stylesheet now refreshes itself when its content
14
+ changes, instead of being injected once and never replaced. Turbo keeps
15
+ `<head>` across visits, so a tab that moved from an old widget build to a new
16
+ one (after you ship an update) could keep the stale `<style>` and show new
17
+ markup with old CSS until a full reload — now the styles are as
18
+ self-freshening as the fingerprinted script URL. (Fixes 0.4.4's composer and
19
+ header CSS not taking effect until a hard reload.)
20
+
3
21
  ## 0.4.4
4
22
 
5
23
  - Expand / collapse the chat on desktop. A new header control grows the panel
@@ -115,9 +115,19 @@
115
115
  display: flex; align-items: center; justify-content: center;
116
116
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
117
117
  border-radius: 10px; }
118
+ /* Conversation page: fill the viewport and scroll the THREAD, not the
119
+ page — so a reply never jumps the page, and the composer stays put. */
120
+ .lvc-convo, .lvc-convo .container { height: 100vh; height: 100dvh; }
121
+ .lvc-convo { overflow: hidden; }
122
+ .lvc-convo .container { display: flex; flex-direction: column; padding-bottom: 16px; }
123
+ .lvc-convo .breadcrumb, .lvc-convo .head-row, .lvc-convo .context-line,
124
+ .lvc-convo .flash { flex: 0 0 auto; }
125
+ .lvc-convo .card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
126
+ .lvc-convo .thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
127
+ .lvc-convo .reply { flex: 0 0 auto; }
118
128
  </style>
119
129
  </head>
120
- <body>
130
+ <body class="<%= yield(:body_class) %>">
121
131
  <div class="container">
122
132
  <% if flash[:alert].present? %>
123
133
  <p class="flash alert"><%= flash[:alert] %></p>
@@ -1,3 +1,6 @@
1
+ <%# Fill the viewport and scroll only the thread (see .lvc-convo in the layout). %>
2
+ <% content_for :body_class, 'lvc-convo' %>
3
+
1
4
  <p class="breadcrumb">
2
5
  <%= link_to "← #{t('livechat.dashboard.back', default: 'All conversations')}", conversations_path %>
3
6
  </p>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Livechat
4
- VERSION = '0.4.4'
4
+ VERSION = '0.4.6'
5
5
  end
@@ -831,7 +831,6 @@
831
831
  // --- styles -------------------------------------------------------------------
832
832
 
833
833
  function injectStyles() {
834
- if (document.getElementById("lvc-styles")) return;
835
834
  var css =
836
835
  "#lvc-root{--lvc-accent:#2563eb;--lvc-accent-text:#fff;--lvc-surface:#fff;" +
837
836
  "--lvc-text:#1c2024;--lvc-muted:#6b7280;--lvc-border:#e5e7eb;--lvc-bg:#f6f7f9;" +
@@ -963,6 +962,15 @@
963
962
  "font-size:11px;font-weight:700;line-height:18px;align-items:center;" +
964
963
  "justify-content:center;vertical-align:middle}";
965
964
 
965
+ // Re-inject only when the stylesheet content actually changed. Turbo keeps
966
+ // <head> across visits, so a tab that transitions from an old widget build
967
+ // to a new one (a shipped update) would otherwise keep the stale <style>
968
+ // and pin old CSS even while fresh widget.js runs. Comparing content makes
969
+ // the styles as self-freshening as the fingerprinted script URL.
970
+ var existing = document.getElementById("lvc-styles");
971
+ if (existing && existing.textContent === css) return;
972
+ if (existing) existing.remove();
973
+
966
974
  var style = document.createElement("style");
967
975
  style.id = "lvc-styles";
968
976
  style.textContent = css;
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.4.4
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shmarov