refactor(layout): implement background color management in DashboardClientLayout; streamline RightPanel and LayoutShell styles for consistency

This commit is contained in:
Anish Sarkar 2026-05-04 02:05:20 +05:30
parent 147be71238
commit c1c34eb916
4 changed files with 23 additions and 9 deletions

View file

@ -144,6 +144,19 @@ export function DashboardClientLayout({
const electronAPI = useElectronAPI();
useEffect(() => {
const htmlBackground = document.documentElement.style.backgroundColor;
const bodyBackground = document.body.style.backgroundColor;
document.documentElement.style.backgroundColor = "var(--panel)";
document.body.style.backgroundColor = "var(--panel)";
return () => {
document.documentElement.style.backgroundColor = htmlBackground;
document.body.style.backgroundColor = bodyBackground;
};
}, []);
useEffect(() => {
if (!electronAPI?.onChatScreenCapture) return;
return electronAPI.onChatScreenCapture((dataUrl: string) => {
@ -163,12 +176,13 @@ export function DashboardClientLayout({
setActiveSearchSpaceIdState(activeSeacrhSpaceId);
// Sync to Electron store if stored value is null (first navigation)
if (electronAPI?.setActiveSearchSpace) {
if (electronAPI?.getActiveSearchSpace && electronAPI.setActiveSearchSpace) {
const setActiveSearchSpace = electronAPI.setActiveSearchSpace;
electronAPI
.getActiveSearchSpace?.()
.then((stored) => {
.getActiveSearchSpace()
.then((stored: string | null) => {
if (!stored) {
electronAPI.setActiveSearchSpace!(activeSeacrhSpaceId);
setActiveSearchSpace(activeSeacrhSpaceId);
}
})
.catch(() => {});