fix: fixed behaviour of bundled app for decrypt and ai chat

This commit is contained in:
2026-05-31 17:26:50 +02:00
parent 040b5db37b
commit 5e99cb7a09
16 changed files with 189 additions and 49 deletions

View File

@@ -90,10 +90,12 @@ defmodule BDS.Desktop.ShellLive.ChatEditor do
end
def handle_event("send_chat_editor_message", _params, socket) do
Logger.info("CHAT send_chat_editor_message called, input=#{inspect(socket.assigns.input)}")
{:noreply, do_send_message(socket)}
end
def handle_event("abort_chat_editor_message", _params, socket) do
Logger.info("CHAT abort_chat_editor_message called")
{:noreply, do_abort_message(socket)}
end

View File

@@ -154,7 +154,7 @@
<form class="chat-input-wrapper flex items-end gap-2" phx-change="change_chat_editor_input" phx-submit="send_chat_editor_message" phx-target={@myself}>
<textarea class="chat-input chat-surface-input ui-textarea" name="message" rows="1" placeholder={dgettext("ui", "Type a message...")} disabled={@chat_editor.is_streaming}><%= @chat_editor.input %></textarea>
<button class="chat-send-button ui-button ui-button-primary" data-testid="chat-send-button" type="button" phx-click="send_chat_editor_message" phx-target={@myself} disabled={@chat_editor.send_disabled?}>↑</button>
<button class="chat-send-button ui-button ui-button-primary" data-testid="chat-send-button" type="button" phx-click="send_chat_editor_message" phx-target={@myself}>↑</button>
</form>
<%= if @chat_editor.action_error do %>

View File

@@ -9,8 +9,8 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.AISettings do
@spec ai_form(term()) :: term()
def ai_form(assigns) do
{:ok, online_endpoint} = AI.get_endpoint(:online)
{:ok, airplane_endpoint} = AI.get_endpoint(:airplane)
online_endpoint = safe_endpoint(:online)
airplane_endpoint = safe_endpoint(:airplane)
%{
"online_url" => Map.get(online_endpoint || %{}, :url, ""),
@@ -168,6 +168,13 @@ defmodule BDS.Desktop.ShellLive.SettingsEditor.AISettings do
end
end
defp safe_endpoint(kind) do
case AI.get_endpoint(kind) do
{:ok, ep} -> ep
_error -> nil
end
end
defp ai_attrs(assigns) do
draft = Map.get(assigns, :settings_editor_ai_draft, %{})