about summary refs log tree commit diff stats
path: root/internal/components/dev.templ
diff options
context:
space:
mode:
authorAlan Pearce2024-12-31 14:56:37 +0100
committerAlan Pearce2025-01-02 15:05:56 +0100
commit58643f38bdd62dc538a03865b1f81eb77d957779 (patch)
treebf2c5ccce1592ae8bc30508be38510f15fe31b5e /internal/components/dev.templ
parent1872c47e393e9c4c811f3b90ec2e0ac4cd8767b2 (diff)
downloadsearchix-58643f38bdd62dc538a03865b1f81eb77d957779.tar.lz
searchix-58643f38bdd62dc538a03865b1f81eb77d957779.tar.zst
searchix-58643f38bdd62dc538a03865b1f81eb77d957779.zip
feat: show scores in results table in dev mode
Diffstat (limited to 'internal/components/dev.templ')
-rw-r--r--internal/components/dev.templ18
1 files changed, 18 insertions, 0 deletions
diff --git a/internal/components/dev.templ b/internal/components/dev.templ
new file mode 100644
index 0000000..a03eb4b
--- /dev/null
+++ b/internal/components/dev.templ
@@ -0,0 +1,18 @@
+package components
+
+import (
+	"go.alanpearce.eu/searchix/internal/index"
+	"strconv"
+)
+
+templ score(h index.DocumentMatch) {
+	<a class="open-sibling-dialog">
+		{ strconv.FormatFloat(h.Score, 'f', 2, 64) }
+	</a>
+	<dialog>
+		<button autofocus>Close</button>
+		<pre>
+			{ h.Expl.String() }
+		</pre>
+	</dialog>
+}