fixes + theme

This commit is contained in:
th committed 2026-04-11 13:01:27 +02:00
1 parent 5af49655d6
commit 22f73ab3b9
25 files changed
+1004 -206

No files matched your search

+8 -2
View File
@@ -132,7 +132,8 @@ PluginManager::instance()->onApiRoute(function (string $route, string $method) {
}
$envelope = chatEncrypt($body, $r['key']);
$ch = curl_init(rtrim($r['url'], '/') . '/api/chat');
$relayChatUrl = rtrim($r['url'], '/') . '/api/chat';
$ch = curl_init($relayChatUrl);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
@@ -152,7 +153,12 @@ PluginManager::instance()->onApiRoute(function (string $route, string $method) {
$relayErr = '';
$decoded = json_decode($response, true);
if (is_array($decoded) && !empty($decoded['error'])) $relayErr = ' — ' . $decoded['error'];
chatJson(['ok' => false, 'error' => "relay returned HTTP $status$relayErr"]);
chatJson([
'ok' => false,
'error' => "relay returned HTTP $status$relayErr",
'url' => $relayChatUrl,
'response_body' => is_string($response) ? substr($response, 0, 500) : null,
]);
}
$resData = json_decode($response, true);
+3 -1
View File
@@ -9,7 +9,8 @@
max-height: calc(100vh - 100px);
background: var(--t-surface);
border: 1px solid var(--t-border);
box-shadow: 0 8px 32px rgba(0,0,0,0.5);
border-radius: var(--ui-radius-modal);
box-shadow: var(--ui-shadow-modal);
z-index: 100;
display: flex;
flex-direction: column;
@@ -277,6 +278,7 @@
padding: 4px 10px;
font-size: 12px;
border: 1px solid var(--t-border);
border-radius: var(--ui-radius-button);
color: var(--t-muted);
background: transparent;
cursor: pointer;
+1 -1
View File
@@ -15,7 +15,7 @@
<div id="chat-empty" class="hidden chat-empty">
<i class="ph ph-chats text-2xl text-t-dim mb-2"></i>
<p class="font-pixel text-[10px] text-t-dim">no conversations yet</p>
<button id="chat-empty-start" class="mt-3 px-2 py-1 text-[10px] font-pixel border border-t-accent text-t-accent hover:bg-t-accent/10 transition-colors">start chat</button>
<button id="chat-empty-start" class="mt-3 px-2 py-1 text-[10px] font-pixel border border-t-accent text-t-accent hover:bg-t-accent/10 transition-colors">Start chat</button>
</div>
</div>
+19 -2
View File
@@ -235,14 +235,31 @@ async function sendMessage(e) {
body: { peer: currentPeer, body },
});
if (!res.ok) {
alert('Send failed: ' + (res.error || 'unknown'));
const detail = [
res.error || 'unknown',
res.url ? `URL: ${res.url}` : null,
res.response_body ? `Body: ${res.response_body}` : null,
].filter(Boolean).join('\n');
await hyprcrd.dialog.show({
title: 'send failed',
message: detail,
danger: true,
okLabel: 'Ok',
cancelLabel: '',
});
return;
}
input.value = '';
await loadThread(currentPeer);
await loadConversations();
} catch (err) {
alert('Send error: ' + err.message);
await hyprcrd.dialog.show({
title: 'send error',
message: String(err?.message || err),
danger: true,
okLabel: 'Ok',
cancelLabel: '',
});
} finally {
sendBtn.disabled = false;
input.disabled = false;