Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

ui: citation chips use the theme accent tint for contrast with the bubble; timestamps show h:mm:ss past sixty minutes

Murtaza Nasir962cd4de1e70
diff --git a/src/services/inquire_agent.py b/src/services/inquire_agent.py
index 18d8ed1f..ff8c23d5 100644
--- a/src/services/inquire_agent.py
+++ b/src/services/inquire_agent.py
@@ -199,6 +199,8 @@ def _fmt_time(seconds):
if seconds is None:
return None
seconds = int(seconds)
+ if seconds >= 3600:
+ return f"{seconds // 3600}:{(seconds % 3600) // 60:02d}:{seconds % 60:02d}"
return f"{seconds // 60}:{seconds % 60:02d}"
@@ -567,8 +569,10 @@ Never invent content that is not in the tool results; say clearly when something
{tool_mode_prompt_block}When you give your final answer:
- Use clear markdown (headings per recording where it helps, bullets, **bold** speaker names).
- Cite sources inline as markdown links. When the supporting search result has a time and \
-seek_seconds, link directly to that moment: [Title @ m:ss](/recordings/<recording_id>?t=<seek_seconds>) \
-— for example [Weekly Sync @ 12:34](/recordings/73?t=754). Without a timestamp, link the recording: \
+seek_seconds, link directly to that moment using the result's `time` value verbatim: \
+[Title @ time](/recordings/<recording_id>?t=<seek_seconds>) — for example \
+[Weekly Sync @ 12:34](/recordings/73?t=754) or [Board Meeting @ 1:31:03](/recordings/80?t=5463). \
+Without a timestamp, link the recording: \
[Title](/recordings/<recording_id>). Cite the recording each substantive point came from, at most \
one citation per bullet or paragraph. These links open the recording and start playback at that \
moment. The interface renders citations as compact numbered markers with a source list at the end, \
diff --git a/templates/inquire.html b/templates/inquire.html
index 943c2f10..0d325df5 100644
--- a/templates/inquire.html
+++ b/templates/inquire.html
@@ -146,9 +146,12 @@
as references rather than inline hyperlinks. */
.chat-message .prose a[href^="/recordings/"] {
display: inline-block;
- background-color: var(--bg-tertiary);
+ /* Theme accent tint (same pairing as selected options/highlights)
+ so the chip contrasts slightly with the bubble in every color
+ scheme, light and dark. */
+ background-color: var(--bg-accent);
color: var(--text-accent);
- border: 1px solid var(--border-secondary);
+ border: 1px solid var(--border-accent, var(--border-secondary));
border-radius: 9999px;
padding: 0 0.55em;
font-size: 0.78em;
diff --git a/tests/test_inquire_agent.py b/tests/test_inquire_agent.py
index 700d4bb9..0711842a 100644
--- a/tests/test_inquire_agent.py
+++ b/tests/test_inquire_agent.py
@@ -365,6 +365,14 @@ def test_api_embed_cooldown(monkeypatch):
emb._api_embed_down_until = 0
+def test_fmt_time_shows_hours_past_sixty_minutes():
+ assert ia._fmt_time(63) == '1:03'
+ assert ia._fmt_time(3599) == '59:59'
+ assert ia._fmt_time(3600) == '1:00:00'
+ assert ia._fmt_time(5463) == '1:31:03'
+ assert ia._fmt_time(None) is None
+
+
def test_truncation_marker():
text = 'x' * 100000
out = ia._truncate_to_tokens(text, 100, 'More available.')