chat_manager 1.0.0 → 1.1.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 +4 -4
- data/CHANGELOG.md +17 -0
- data/README.md +6 -4
- data/app/assets/stylesheets/chat_manager/chat.css +31 -0
- data/app/views/chat_manager/_chat_card.html.erb +11 -0
- data/app/views/chat_manager/_chat_list.html.erb +2 -1
- data/lib/chat_manager/csv_downloadable.rb +3 -3
- data/lib/chat_manager/helpers.rb +2 -2
- data/lib/chat_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16edfae01384fd803fd52f1babba84126ff981a49f2d86377742068d676c8dd8
|
|
4
|
+
data.tar.gz: 6ddb3cd61d6d759ec835a6454de8ef02b28cbed5b5c4db1513cf8089af3e3967
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 057d03aa7ac342ae540112510d452f23f18d9a8d8bdae7378f49818a33354efc963911933c5e3376849fa5691ad65e44bc629d6527622843fb4dfff7f285c148
|
|
7
|
+
data.tar.gz: 05fcf885384c8caa57492464f11260d182cd1a46a9418f3342b06f32f62e362fd333a8d4877a81d1b617b06a01b9129f8350249a78d290890e4b6fb9c0287063
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
7
7
|
|
|
8
|
+
## [1.1.1] - 2026-05-11
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `ChatManager::CsvDownloadable` referenced the old `prompt_manager_prompt_execution` association name, raising `ActiveRecord::AssociationNotFoundError` when host apps had migrated to `prompt_navigator`. The concern (and README/CLAUDE.md docs) now use `prompt_navigator_prompt_execution`.
|
|
13
|
+
|
|
14
|
+
## [1.1.0] - 2026-04-22
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Optional `delete_path:` keyword argument to the `chat_list` helper. When provided, each chat card renders a delete button (trash icon) next to the download button. The host app still owns the destroy route and action; the gem only renders the button when a path is supplied.
|
|
19
|
+
- CSS styles for `.chat-card-delete` and `.chat-card-delete-form` matching the existing icon-button visual language (red hover for destructive intent).
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Revert Ruby version to 3.4.9 (from 4.0.1). README requirement updated to "Ruby 3.4+".
|
|
24
|
+
|
|
8
25
|
## [1.0.0] - 2026-03-25
|
|
9
26
|
|
|
10
27
|
### Changed
|
data/README.md
CHANGED
|
@@ -13,7 +13,7 @@ A Rails engine for managing LLM chat conversations with CSV export, auto-titling
|
|
|
13
13
|
|
|
14
14
|
## Requirements
|
|
15
15
|
|
|
16
|
-
- Ruby 4
|
|
16
|
+
- Ruby 3.4+
|
|
17
17
|
- Rails 8.1+
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
@@ -110,9 +110,9 @@ CSV output includes the following columns: `Chat Title`, `Role`, `Message Conten
|
|
|
110
110
|
**Prerequisites:** The host application must provide:
|
|
111
111
|
|
|
112
112
|
- `current_user` method in the controller (returning an object with a `chats` association)
|
|
113
|
-
- `chats` association that supports `.includes(messages: :
|
|
113
|
+
- `chats` association that supports `.includes(messages: :prompt_navigator_prompt_execution)`
|
|
114
114
|
- `ordered_messages` method on the Chat model
|
|
115
|
-
- Each message must have a `role` attribute and a `
|
|
115
|
+
- Each message must have a `role` attribute and a `prompt_navigator_prompt_execution` association with `prompt` and `response` attributes
|
|
116
116
|
|
|
117
117
|
### TitleGeneratable (Model Concern)
|
|
118
118
|
|
|
@@ -133,7 +133,8 @@ Use the `chat_list` helper in your views to render the chat list UI:
|
|
|
133
133
|
->(uuid) { chat_path(uuid) },
|
|
134
134
|
active_uuid: @active_uuid,
|
|
135
135
|
download_csv_path: ->(uuid) { download_csv_chat_path(uuid) },
|
|
136
|
-
download_all_csv_path: download_all_csv_chats_path
|
|
136
|
+
download_all_csv_path: download_all_csv_chats_path,
|
|
137
|
+
delete_path: ->(uuid) { chat_path(uuid) }
|
|
137
138
|
) %>
|
|
138
139
|
```
|
|
139
140
|
|
|
@@ -145,6 +146,7 @@ Parameters:
|
|
|
145
146
|
| `active_uuid` | Keyword | No | ID of the currently active chat (for highlighting) |
|
|
146
147
|
| `download_csv_path` | Keyword | No | Proc/lambda that receives a UUID string and returns the CSV download path for each chat |
|
|
147
148
|
| `download_all_csv_path` | Keyword | No | Path for the "Download All Chats CSV" button |
|
|
149
|
+
| `delete_path` | Keyword | No | Proc/lambda that receives a UUID string and returns the delete path for each chat. When provided, a delete button (trash icon) appears on each card. The host app must provide a `DELETE` route and controller action. |
|
|
148
150
|
|
|
149
151
|
### UI Components
|
|
150
152
|
|
|
@@ -86,6 +86,37 @@
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
.chat-card-delete-form {
|
|
90
|
+
margin: 0;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.chat-card-delete {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
justify-content: center;
|
|
99
|
+
width: 24px;
|
|
100
|
+
height: 24px;
|
|
101
|
+
padding: 0;
|
|
102
|
+
border: none;
|
|
103
|
+
background: transparent;
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
color: #888;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
flex-shrink: 0;
|
|
108
|
+
transition: color 0.15s ease, background-color 0.15s ease;
|
|
109
|
+
|
|
110
|
+
&:hover {
|
|
111
|
+
color: #dc2626;
|
|
112
|
+
background-color: rgba(220, 38, 38, 0.1);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
i {
|
|
116
|
+
font-size: 12px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
89
120
|
.chat-download-all {
|
|
90
121
|
margin-top: 12px;
|
|
91
122
|
padding-left: 32px;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
is_active = locals[:is_active]
|
|
4
4
|
card_path = locals[:card_path]
|
|
5
5
|
download_csv_path = locals[:download_csv_path]
|
|
6
|
+
delete_path = locals[:delete_path]
|
|
6
7
|
%>
|
|
7
8
|
|
|
8
9
|
<div class="chat-card<%= ' is-active' if is_active %>"
|
|
@@ -21,6 +22,16 @@
|
|
|
21
22
|
<i class="bi bi-download"></i>
|
|
22
23
|
<% end %>
|
|
23
24
|
<% end %>
|
|
25
|
+
<% if delete_path %>
|
|
26
|
+
<%= button_to delete_path.call(ann.uuid),
|
|
27
|
+
method: :delete,
|
|
28
|
+
class: "chat-card-delete",
|
|
29
|
+
title: "Delete chat",
|
|
30
|
+
form: { class: "chat-card-delete-form" },
|
|
31
|
+
data: { turbo_confirm: "Delete this chat? This cannot be undone." } do %>
|
|
32
|
+
<i class="bi bi-trash"></i>
|
|
33
|
+
<% end %>
|
|
34
|
+
<% end %>
|
|
24
35
|
</div>
|
|
25
36
|
<input type="text" class="chat-card-title-input"
|
|
26
37
|
data-chat-title-edit-target="input"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
card_path = locals[:card_path]
|
|
4
4
|
download_csv_path = locals[:download_csv_path]
|
|
5
5
|
download_all_csv_path = locals[:download_all_csv_path]
|
|
6
|
+
delete_path = locals[:delete_path]
|
|
6
7
|
titled_chats = @chats.select { |c| c.title.present? }
|
|
7
8
|
%>
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
<% if titled_chats.present? %>
|
|
11
12
|
<div class="chat-stack" data-controller="chat">
|
|
12
13
|
<% titled_chats.each_with_index do |ann, idx| %>
|
|
13
|
-
<%= render 'chat_manager/chat_card', locals: { ann: ann, next_ann: titled_chats[idx + 1], is_active: ann.id == active_uuid, card_path: card_path, download_csv_path: download_csv_path } %>
|
|
14
|
+
<%= render 'chat_manager/chat_card', locals: { ann: ann, next_ann: titled_chats[idx + 1], is_active: ann.id == active_uuid, card_path: card_path, download_csv_path: download_csv_path, delete_path: delete_path } %>
|
|
14
15
|
<% end %>
|
|
15
16
|
</div>
|
|
16
17
|
<% if download_all_csv_path %>
|
|
@@ -9,7 +9,7 @@ module ChatManager
|
|
|
9
9
|
CSV_HEADERS = [ "Chat Title", "Role", "Message Content", "Sent At", "Model" ].freeze
|
|
10
10
|
|
|
11
11
|
def download_csv
|
|
12
|
-
chat = current_user.chats.includes(messages: :
|
|
12
|
+
chat = current_user.chats.includes(messages: :prompt_navigator_prompt_execution).find_by!(uuid: params[:id])
|
|
13
13
|
|
|
14
14
|
csv_data = generate_csv_for_chats([ chat ])
|
|
15
15
|
|
|
@@ -18,7 +18,7 @@ module ChatManager
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def download_all_csv
|
|
21
|
-
chats = current_user.chats.includes(messages: :
|
|
21
|
+
chats = current_user.chats.includes(messages: :prompt_navigator_prompt_execution)
|
|
22
22
|
|
|
23
23
|
csv_data = generate_csv_for_chats(chats)
|
|
24
24
|
|
|
@@ -32,7 +32,7 @@ module ChatManager
|
|
|
32
32
|
csv << CSV_HEADERS
|
|
33
33
|
chats.each do |chat|
|
|
34
34
|
chat.ordered_messages.each do |msg|
|
|
35
|
-
pe = msg.
|
|
35
|
+
pe = msg.prompt_navigator_prompt_execution
|
|
36
36
|
content = msg.role == "user" ? pe&.prompt : pe&.response
|
|
37
37
|
csv << [ chat.title, msg.role, content, msg.created_at, chat.model ]
|
|
38
38
|
end
|
data/lib/chat_manager/helpers.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module ChatManager
|
|
2
2
|
module Helpers
|
|
3
|
-
def chat_list(card_path, active_uuid: nil, download_csv_path: nil, download_all_csv_path: nil)
|
|
4
|
-
render "chat_manager/chat_list", locals: { card_path: card_path, active_uuid: active_uuid, download_csv_path: download_csv_path, download_all_csv_path: download_all_csv_path }
|
|
3
|
+
def chat_list(card_path, active_uuid: nil, download_csv_path: nil, download_all_csv_path: nil, delete_path: nil)
|
|
4
|
+
render "chat_manager/chat_list", locals: { card_path: card_path, active_uuid: active_uuid, download_csv_path: download_csv_path, download_all_csv_path: download_all_csv_path, delete_path: delete_path }
|
|
5
5
|
end
|
|
6
6
|
end
|
|
7
7
|
end
|
data/lib/chat_manager/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: chat_manager
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- dhq_boiler
|
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
95
|
version: '0'
|
|
96
96
|
requirements: []
|
|
97
|
-
rubygems_version:
|
|
97
|
+
rubygems_version: 3.6.9
|
|
98
98
|
specification_version: 4
|
|
99
99
|
summary: A Rails engine for managing LLM chat conversations with CSV export and auto-titling.
|
|
100
100
|
test_files: []
|