mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-07 17:23:05 +02:00
Add trace tool. Closes #130.
This commit is contained in:
@@ -4,7 +4,14 @@ import { parseHashConversation } from './urlHash';
|
||||
export const REOPEN_LAST_CONVERSATION_KEY = 'remoteterm-reopen-last-conversation';
|
||||
export const LAST_VIEWED_CONVERSATION_KEY = 'remoteterm-last-viewed-conversation';
|
||||
|
||||
const SUPPORTED_TYPES: Conversation['type'][] = ['contact', 'channel', 'raw', 'map', 'visualizer'];
|
||||
const SUPPORTED_TYPES: Conversation['type'][] = [
|
||||
'contact',
|
||||
'channel',
|
||||
'raw',
|
||||
'map',
|
||||
'visualizer',
|
||||
'trace',
|
||||
];
|
||||
|
||||
function isSupportedType(value: unknown): value is Conversation['type'] {
|
||||
return typeof value === 'string' && SUPPORTED_TYPES.includes(value as Conversation['type']);
|
||||
@@ -94,6 +101,10 @@ export function captureLastViewedConversationFromHash(): void {
|
||||
saveLastViewedConversation({ type: 'visualizer', id: 'visualizer', name: 'Mesh Visualizer' });
|
||||
return;
|
||||
}
|
||||
if (hashConversation.type === 'trace') {
|
||||
saveLastViewedConversation({ type: 'trace', id: 'trace', name: 'Trace' });
|
||||
return;
|
||||
}
|
||||
|
||||
saveLastViewedConversation({
|
||||
type: hashConversation.type,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getContactDisplayName } from './pubkey';
|
||||
import type { SettingsSection } from '../components/settings/settingsConstants';
|
||||
|
||||
interface ParsedHashConversation {
|
||||
type: 'channel' | 'contact' | 'raw' | 'map' | 'visualizer' | 'search';
|
||||
type: 'channel' | 'contact' | 'raw' | 'map' | 'visualizer' | 'search' | 'trace';
|
||||
/** Conversation identity token (channel key or contact public key, or legacy name token) */
|
||||
name: string;
|
||||
/** Optional human-readable label segment (ignored for identity resolution) */
|
||||
@@ -44,6 +44,10 @@ export function parseHashConversation(): ParsedHashConversation | null {
|
||||
return { type: 'search', name: 'search' };
|
||||
}
|
||||
|
||||
if (hash === 'trace') {
|
||||
return { type: 'trace', name: 'trace' };
|
||||
}
|
||||
|
||||
// Check for map with focus: #map/focus/{pubkey_prefix}
|
||||
if (hash.startsWith('map/focus/')) {
|
||||
const focusKey = hash.slice('map/focus/'.length);
|
||||
@@ -149,6 +153,7 @@ function getConversationHash(conv: Conversation | null): string {
|
||||
if (conv.type === 'map') return '#map';
|
||||
if (conv.type === 'visualizer') return '#visualizer';
|
||||
if (conv.type === 'search') return '#search';
|
||||
if (conv.type === 'trace') return '#trace';
|
||||
|
||||
// Use immutable IDs for identity, append readable label for UX.
|
||||
if (conv.type === 'channel') {
|
||||
|
||||
Reference in New Issue
Block a user