mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-24 22:09:08 +08:00
fix(electron): optimize tab switching (#12518)
fix AF-2670 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Style** - Updated styling so that opacity and transition effects apply only when a translucent background is present, enhancing visual precision. - **Chores** - Renamed a data attribute in the app container for improved consistency. - Disabled background throttling for specific views to maintain performance when running in the background. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -10,20 +10,16 @@ textarea
|
|||||||
-webkit-app-region: no-drag;
|
-webkit-app-region: no-drag;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-active='true'] {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
html:is([data-active='false'], [data-dragging='true']) * {
|
html:is([data-active='false'], [data-dragging='true']) * {
|
||||||
-webkit-app-region: no-drag !important;
|
-webkit-app-region: no-drag !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-active='false'] {
|
html[data-active='false']:has([data-translucent='true']) {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.2s 0.1s;
|
transition: opacity 0.2s 0.1s;
|
||||||
}
|
}
|
||||||
|
|
||||||
html[data-active='true']:has([data-blur-background='true']) {
|
html[data-active='true']:has([data-translucent='true']) {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: opacity 0.2s;
|
transition: opacity 0.2s;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -818,6 +818,7 @@ export class WebContentViewsManager {
|
|||||||
preload: join(__dirname, './preload.js'), // this points to the bundled preload module
|
preload: join(__dirname, './preload.js'), // this points to the bundled preload module
|
||||||
// serialize exposed meta that to be used in preload
|
// serialize exposed meta that to be used in preload
|
||||||
additionalArguments: additionalArguments,
|
additionalArguments: additionalArguments,
|
||||||
|
backgroundThrottling: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ export const AppContainer = ({
|
|||||||
'blur-background': blurBackground,
|
'blur-background': blurBackground,
|
||||||
})}
|
})}
|
||||||
data-noise-background={noisyBackground}
|
data-noise-background={noisyBackground}
|
||||||
data-blur-background={blurBackground}
|
data-translucent={blurBackground}
|
||||||
>
|
>
|
||||||
<LayoutComponent fallback={fallback}>{children}</LayoutComponent>
|
<LayoutComponent fallback={fallback}>{children}</LayoutComponent>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user