fix(ui): chat background covers full screen regardless of glassmorphism
Previously the background was applied directly to <Page> (room view only) when glassmorphism was off, and to document.body only when glassmorphism was on. This caused two bugs: - Without glassmorphism: background only visible in the chat panel, not behind the sidebar - With glassmorphism: Page reverted to its opaque theme surface color, so the body background only showed through the glass sidebar Fix: SidebarNav now always applies the active background to document.body (regardless of glassmorphism). RoomView's <Page> is made transparent whenever a background is active so the body background shows through both the sidebar and the chat area. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,9 @@ export function SidebarNav() {
|
||||
// Fix: mirror the active chat background onto document.body so the sidebar blurs through it.
|
||||
useEffect(() => {
|
||||
const { style } = document.body;
|
||||
if (!glassmorphismSidebar) {
|
||||
const hasBg = chatBackground !== 'none' || glassmorphismSidebar || lotusTerminal;
|
||||
|
||||
if (!hasBg) {
|
||||
style.removeProperty('background-image');
|
||||
style.removeProperty('background-color');
|
||||
style.removeProperty('background-size');
|
||||
@@ -48,13 +50,15 @@ export function SidebarNav() {
|
||||
style.removeProperty('animation');
|
||||
return;
|
||||
}
|
||||
const effectiveBg = chatBackground === 'none' ? 'tactical' : chatBackground;
|
||||
|
||||
const effectiveBg = chatBackground !== 'none' ? chatBackground : 'tactical';
|
||||
const bgStyle = getChatBg(effectiveBg, isDark, pauseAnimations);
|
||||
style.backgroundImage = (bgStyle.backgroundImage as string | undefined) ?? '';
|
||||
style.backgroundColor = (bgStyle.backgroundColor as string | undefined) ?? '';
|
||||
style.backgroundSize = (bgStyle.backgroundSize as string | undefined) ?? '';
|
||||
style.backgroundPosition = (bgStyle.backgroundPosition as string | undefined) ?? '';
|
||||
style.animation = (bgStyle.animation as string | undefined) ?? '';
|
||||
|
||||
return () => {
|
||||
style.removeProperty('background-image');
|
||||
style.removeProperty('background-color');
|
||||
|
||||
Reference in New Issue
Block a user