Add Observation Count to channel messages and some more git ignore

This commit is contained in:
MrAlders0n
2026-05-29 16:20:12 -04:00
parent a5b08891c6
commit ea5767b757
4 changed files with 14 additions and 6 deletions
+4
View File
@@ -6,6 +6,10 @@ dist/
build/
.next/
.nuxt/
scripts/
# Dev server helper runtime files
.scripts/
# Environment
.env
+6 -1
View File
@@ -7,7 +7,12 @@
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
"preview": "vite preview",
"start": "./scripts/devserver.sh start",
"stop": "./scripts/devserver.sh stop",
"restart": "./scripts/devserver.sh restart",
"dev:status": "./scripts/devserver.sh status",
"dev:stop-all": "./scripts/devserver.sh stop-all"
},
"dependencies": {
"@tanstack/react-query": "^5.100.11",
+3 -5
View File
@@ -30,6 +30,8 @@ function formatMessageTime(iso: string): string {
}
function MessageRow({ msg, heardCount, onAnalyze }: { msg: ChannelMessage; heardCount?: number; onAnalyze?: (hash: string) => void }) {
// REST carries the server-side total; the live WS counter augments it during the session
const reach = Math.max(msg.observationCount ?? 0, heardCount ?? 0);
return (
<div
className={`px-3 py-2${onAnalyze ? " cursor-pointer hover:bg-bg-surface transition-colors" : ""}`}
@@ -40,13 +42,9 @@ function MessageRow({ msg, heardCount, onAnalyze }: { msg: ChannelMessage; heard
{msg.senderName}
</span>
<span className="text-[11px] text-text-dim">{formatMessageTime(msg.sentAt)}</span>
{reach > 0 && <Badge variant="text">×{reach}</Badge>}
</div>
<div className="text-text-normal text-xs mt-0.5">{msg.content}</div>
{heardCount != null && heardCount > 1 && (
<div className="text-[11px] text-text-dim mt-0.5 font-mono">
heard {heardCount}×
</div>
)}
</div>
);
}
+1
View File
@@ -26,4 +26,5 @@ export interface ChannelMessage {
senderName: string;
content: string;
sentAt: string;
observationCount?: number;
}