fix: prioritize outbox relays and fix tab switching layout

Relay selection fixes:
- Change priority: outbox-selected relays > explicit relays > fallback
- For profile spells, ALWAYS use author's NIP-65 outbox relays first
- Only fall back to explicit spell relays if outbox selection yields nothing
- Ensures queries go to where the author actually publishes (their write relays)

Layout fixes:
- Change TabsContent from flex-1 to h-full in all viewers
- Prevents inactive tabs from participating in flex layout calculations
- Fixes header stacking/height issues when switching between spell tabs
- Each tab now properly fills parent height without layout shifts
This commit is contained in:
Claude
2026-01-23 12:13:18 +00:00
parent b439780b3f
commit 9bf0019e35
3 changed files with 24 additions and 15 deletions

View File

@@ -222,7 +222,7 @@ function SpellTabContent({
return (
<TabsContent
value={spellId}
className="flex-1 overflow-hidden m-0 flex flex-col"
className="h-full overflow-hidden m-0 flex flex-col"
>
{!appliedFilter ? (
<div className="flex items-center justify-center h-full p-8 text-center text-muted-foreground">

View File

@@ -241,15 +241,6 @@ function SpellTabContent({
return [];
}
// Use explicit relays from spell if provided
if (parsed?.relays && parsed.relays.length > 0) {
console.log(
`[SpellTabContent:${spell.name || spellId}] Using explicit relays:`,
parsed.relays,
);
return parsed.relays;
}
// Wait for outbox relay selection to complete
if (relaySelectionPhase !== "ready") {
console.log(
@@ -258,11 +249,29 @@ function SpellTabContent({
return [];
}
// For profile spells, ALWAYS prefer outbox-selected relays over explicit relays
// This ensures we query from the author's write relays (NIP-65)
if (selectedRelays && selectedRelays.length > 0) {
console.log(
`[SpellTabContent:${spell.name || spellId}] Using outbox-selected relays:`,
selectedRelays,
);
return selectedRelays;
}
// Fallback to explicit relays from spell if outbox selection yielded nothing
if (parsed?.relays && parsed.relays.length > 0) {
console.log(
`[SpellTabContent:${spell.name || spellId}] Fallback to explicit relays:`,
parsed.relays,
);
return parsed.relays;
}
console.log(
`[SpellTabContent:${spell.name || spellId}] Using outbox-selected relays:`,
selectedRelays,
`[SpellTabContent:${spell.name || spellId}] No relays available`,
);
return selectedRelays;
return [];
}, [
appliedFilter,
parsed?.relays,
@@ -306,7 +315,7 @@ function SpellTabContent({
return (
<TabsContent
value={spellId}
className="flex-1 overflow-hidden m-0 flex flex-col"
className="h-full overflow-hidden m-0 flex flex-col"
>
{!appliedFilter ? (
<div className="flex items-center justify-center h-full p-8 text-center text-muted-foreground">

View File

@@ -193,7 +193,7 @@ function SpellTabContent({
return (
<TabsContent
value={spellId}
className="flex-1 overflow-hidden m-0 flex flex-col"
className="h-full overflow-hidden m-0 flex flex-col"
>
{!appliedFilter ? (
<div className="flex items-center justify-center h-full p-8 text-center text-muted-foreground">