Draft 1 of the homebaked visualizer

This commit is contained in:
Jack Kingsman
2026-01-19 16:10:07 -08:00
parent d6f6913ef2
commit 52319a8863
16 changed files with 2556 additions and 584 deletions
+6 -1
View File
@@ -1,7 +1,7 @@
import type { Conversation } from '../types';
export interface ParsedHashConversation {
type: 'channel' | 'contact' | 'raw' | 'map';
type: 'channel' | 'contact' | 'raw' | 'map' | 'visualizer';
name: string;
/** For map view: public key prefix to focus on */
mapFocusKey?: string;
@@ -20,6 +20,10 @@ export function parseHashConversation(): ParsedHashConversation | null {
return { type: 'map', name: 'map' };
}
if (hash === 'visualizer') {
return { type: 'visualizer', name: 'visualizer' };
}
// Check for map with focus: #map/focus/{pubkey_prefix}
if (hash.startsWith('map/focus/')) {
const focusKey = hash.slice('map/focus/'.length);
@@ -54,6 +58,7 @@ export function getConversationHash(conv: Conversation | null): string {
if (!conv) return '';
if (conv.type === 'raw') return '#raw';
if (conv.type === 'map') return '#map';
if (conv.type === 'visualizer') return '#visualizer';
// Strip leading # from channel names for cleaner URLs
const name =
conv.type === 'channel' && conv.name.startsWith('#') ? conv.name.slice(1) : conv.name;