debug: add comprehensive logging for profile loading states and article refresh

- Add logs to useProfileLabels for loading state tracking
- Add logs to markdown processing to track when content is cleared/reprocessed
- Add logs to article loader for refresh behavior
- Add logs to ResolvedMention and NostrMentionLink for loading detection
- Add logs to nostr URI resolver when loading state is shown
- All logs prefixed with meaningful tags for easy filtering
This commit is contained in:
Gigi
2025-11-02 22:39:07 +01:00
parent 7e5972a6e2
commit 51a4b545e9
6 changed files with 45 additions and 6 deletions

View File

@@ -56,6 +56,8 @@ export const useMarkdownToHTML = (
// Process markdown with progressive profile labels and article titles
useEffect(() => {
console.log(`[markdown-to-html] Processing markdown, profileLabels=${profileLabels.size}, profileLoading=${profileLoading.size}, articleTitles=${articleTitles.size}`)
console.log(`[markdown-to-html] Clearing rendered HTML and processed markdown`)
// Always clear previous render immediately to avoid showing stale content while processing
setRenderedHtml('')
setProcessedMarkdown('')
@@ -78,6 +80,7 @@ export const useMarkdownToHTML = (
if (isCancelled) return
console.log(`[markdown-to-html] Processed markdown, loading states:`, Array.from(profileLoading.entries()).filter(([_, l]) => l).map(([e, _]) => e.slice(0, 16) + '...'))
setProcessedMarkdown(processed)
} catch (error) {
console.error(`[markdown-to-html] Error processing markdown:`, error)