Skip to content

Commit 820d126

Browse files
committed
fix: 5 GUI issues — people 500, modal backdrop, device UX, audit
Issue #4: Fix People page 500 error — add ::timestamptz cast to consent_grants query and use .isoformat() on datetime parameter. Issue #5: Audit page verified working (200 OK) — no crash found. Issue #3: Add .modal-overlay CSS with dark backdrop for action/memory/event modals. Add .modal-close button styles. Issue #1: Add collapsible 'Launch Agent Worker' setup guide to device registration success card with copy-pasteable commands. Issue #2: Add 'Next Steps — Using Your Device' section to device detail page explaining device capabilities and linking to related pages.
1 parent eb7276e commit 820d126

File tree

4 files changed

+98
-3
lines changed

4 files changed

+98
-3
lines changed

functions/hub_api/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,9 +1902,9 @@ def gui_people(request: Request) -> Response:
19021902
SELECT consent_type, expires_at
19031903
FROM consent_grants
19041904
WHERE person_id = :person_id::uuid AND revoked_at IS NULL
1905-
AND (expires_at IS NULL OR expires_at > :now)
1905+
AND (expires_at IS NULL OR expires_at > :now::timestamptz)
19061906
""",
1907-
{"person_id": person_id, "now": datetime.now(timezone.utc)},
1907+
{"person_id": person_id, "now": datetime.now(timezone.utc).isoformat()},
19081908
)
19091909

19101910
voice_consent = None

functions/hub_api/static/css/marvain.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,41 @@ pre {
626626
border-top: 1px solid var(--color-gray-600);
627627
}
628628

629+
/* Modal overlay — used by actions.html and other inline modals */
630+
.modal-overlay {
631+
position: fixed;
632+
inset: 0;
633+
display: flex;
634+
align-items: center;
635+
justify-content: center;
636+
background: rgba(0, 0, 0, 0.7);
637+
z-index: 1000;
638+
}
639+
640+
.modal-overlay .modal {
641+
position: relative;
642+
background: var(--color-gray-800);
643+
border-radius: var(--radius-lg);
644+
width: 100%;
645+
max-height: 90vh;
646+
overflow: auto;
647+
box-shadow: var(--shadow-lg);
648+
}
649+
650+
.modal-close {
651+
background: none;
652+
border: none;
653+
color: var(--color-gray-400);
654+
font-size: 1.5rem;
655+
cursor: pointer;
656+
line-height: 1;
657+
padding: 0;
658+
}
659+
660+
.modal-close:hover {
661+
color: var(--color-white);
662+
}
663+
629664
/* ==================== Page Header ==================== */
630665
.page-header {
631666
display: flex;

functions/hub_api/templates/device_detail.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,24 @@ <h4 style="margin-bottom: var(--spacing-sm);">3. Run the Satellite Daemon</h4>
142142
--device-token YOUR_DEVICE_TOKEN</code></pre>
143143

144144
<h4 style="margin-bottom: var(--spacing-sm);">4. Verify</h4>
145-
<p style="color: var(--color-gray-300);">Once the daemon connects, this device's status will change to <span class="badge badge-success" style="font-size: 0.75rem;"><i class="fas fa-circle"></i> Online</span> and the <strong>Ping Device</strong> button above will receive a response.</p>
145+
<p style="color: var(--color-gray-300); margin-bottom: var(--spacing-md);">Once the daemon connects, this device's status will change to <span class="badge badge-success" style="font-size: 0.75rem;"><i class="fas fa-circle"></i> Online</span> and the <strong>Ping Device</strong> button above will receive a response.</p>
146+
147+
<h4 style="margin-bottom: var(--spacing-sm);">5. Next Steps — Using Your Device</h4>
148+
<p style="color: var(--color-gray-300); margin-bottom: var(--spacing-sm);">
149+
Devices are satellite nodes in the Marvain agent hub. Once online, a device can:
150+
</p>
151+
<ul style="margin-left: var(--spacing-lg); margin-bottom: var(--spacing-md); color: var(--color-gray-300);">
152+
<li><strong>Receive commands</strong> — The hub sends real-time instructions via WebSocket (e.g., play audio, capture data)</li>
153+
<li><strong>Emit events</strong> — The daemon pushes events (sensor data, voice transcripts, presence changes) back to the hub</li>
154+
<li><strong>Execute actions</strong> — Approved actions on the <a href="/actions" style="color: var(--color-highlight);">Actions</a> page can target this device</li>
155+
</ul>
156+
<p style="color: var(--color-gray-300); margin-bottom: var(--spacing-sm);"><strong>Explore further:</strong></p>
157+
<ul style="margin-left: var(--spacing-lg); color: var(--color-gray-300);">
158+
<li><a href="/events" style="color: var(--color-highlight);"><i class="fas fa-bolt"></i> Events</a> — View events emitted by this device</li>
159+
<li><a href="/actions" style="color: var(--color-highlight);"><i class="fas fa-cogs"></i> Actions</a> — Create actions that target this device</li>
160+
<li><a href="/memories" style="color: var(--color-highlight);"><i class="fas fa-brain"></i> Memories</a> — Browse memories derived from device interactions</li>
161+
<li><a href="/livekit-test" style="color: var(--color-highlight);"><i class="fas fa-microphone"></i> LiveKit Test</a> — Test voice interaction with the agent</li>
162+
</ul>
146163
</div>
147164
</details>
148165
{% endif %}

functions/hub_api/templates/devices.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,49 @@ <h3 class="card-title" style="color: white;"><i class="fas fa-check-circle"></i>
333333
</div>
334334
</div>
335335
336+
<details style="margin-top: 1.5rem; background: var(--color-gray-700); border-radius: var(--radius-md); padding: 0;">
337+
<summary style="cursor: pointer; color: var(--color-highlight); font-weight: 600; padding: var(--spacing-md); list-style: none; display: flex; align-items: center; gap: 0.5rem;">
338+
<i class="fas fa-rocket"></i> Launch Agent Worker — Full Setup Guide
339+
<i class="fas fa-chevron-down" style="margin-left: auto; font-size: 0.75rem;"></i>
340+
</summary>
341+
<div style="padding: 0 var(--spacing-md) var(--spacing-md);">
342+
<h4 style="margin-bottom: var(--spacing-sm); margin-top: var(--spacing-sm);">1. Prerequisites</h4>
343+
<ul style="margin-left: var(--spacing-lg); margin-bottom: var(--spacing-md); color: var(--color-gray-300);">
344+
<li>Python 3.11+ with the <code>marvain</code> conda environment</li>
345+
<li>LiveKit and OpenAI credentials configured in AWS Secrets Manager</li>
346+
<li>Network access to the Hub WebSocket endpoint</li>
347+
</ul>
348+
349+
<h4 style="margin-bottom: var(--spacing-sm);">2. Activate Environment</h4>
350+
<div class="input-group" style="margin-bottom: var(--spacing-md);">
351+
<textarea class="form-control" readonly id="device-env-cmd" rows="2"
352+
style="font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; resize: none; background: var(--color-gray-900);">cd /path/to/marvain
353+
source marvain_activate</textarea>
354+
<button type="button" class="btn btn-outline" onclick="copyToClipboard('device-env-cmd', 'Env command')">
355+
<i class="fas fa-copy"></i>
356+
</button>
357+
</div>
358+
359+
<h4 style="margin-bottom: var(--spacing-sm);">3. Start the Satellite Daemon</h4>
360+
<div class="input-group" style="margin-bottom: var(--spacing-md);">
361+
<textarea class="form-control" readonly id="device-daemon-cmd" rows="3"
362+
style="font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; resize: none; background: var(--color-gray-900);">python apps/remote_satellite/daemon.py \\
363+
--hub-ws-url {{ ws_url }} \\
364+
--device-token ${result.token}</textarea>
365+
<button type="button" class="btn btn-outline" onclick="copyToClipboard('device-daemon-cmd', 'Daemon command')">
366+
<i class="fas fa-copy"></i>
367+
</button>
368+
</div>
369+
370+
<h4 style="margin-bottom: var(--spacing-sm);">4. Verify Connection</h4>
371+
<p style="color: var(--color-gray-300); margin-bottom: var(--spacing-sm);">
372+
Once the daemon connects, the device status will change to
373+
<span class="badge badge-success" style="font-size: 0.75rem;"><i class="fas fa-circle"></i> Online</span>
374+
on this page. You can also use the <strong>Ping Device</strong> button on the device detail page to confirm connectivity.
375+
</p>
376+
</div>
377+
</details>
378+
336379
<div style="margin-top: 1.5rem; text-align: right;">
337380
<button type="button" class="btn btn-primary" onclick="dismissTokenResult()">
338381
<i class="fas fa-check"></i> Done - I've Copied the Token

0 commit comments

Comments
 (0)