diff src/lib/ai/claude/Ai_chat.luan @ 52:27758f3b2d69

add hide_ruby
author Franklin Schmidt <fschmidt@gmail.com>
date Sat, 16 Aug 2025 09:56:10 +0900
parents 5ecfdf43f72d
children 16e5c14eb800
line wrap: on
line diff
--- a/src/lib/ai/claude/Ai_chat.luan	Fri Aug 15 23:24:38 2025 +0900
+++ b/src/lib/ai/claude/Ai_chat.luan	Sat Aug 16 09:56:10 2025 +0900
@@ -25,7 +25,7 @@
 	%><%=system_prompt%><%
 end
 
-function Ai_chat.output_messages_html(show_text,thread,old_thread)
+function Ai_chat.output_messages_html(assistant_controls,thread,old_thread)
 	thread = json_parse(thread)
 	local messages = thread.messages or error
 	local n = 0
@@ -34,7 +34,6 @@
 		local old_messages = old_thread.messages or error
 		n = #old_messages
 	end
-	local checked = show_text and "checked" or ""
 	for i, message in ipairs(messages) do
 		if i <= n then
 			continue
@@ -55,10 +54,7 @@
 			<div role="<%=role%>">
 				<div message markdown><%=text%></div>
 <%			if role=="assistant" then %>
-				<div controls>
-					<audio controls preload=none></audio>
-					<label clickable><input type=checkbox name=show_text <%=checked%> >Show text</label>
-				</div>
+<%=				assistant_controls %>
 <%			end %>
 			</div>
 <%