refactor: further trim PR #458 debloat across patches, notices, Select, music, archive, search

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-19 08:58:31 +09:30
parent 4fda63dedd
commit 3bac45032d
21 changed files with 497 additions and 924 deletions
@@ -29,7 +29,6 @@ class AnimatedBackgroundPluginClass extends BasePlugin<typeof settings> {
}
const instance = new AnimatedBackgroundPluginClass();
const resync = (api: PluginAPI<typeof settings>) => () => void syncAnimatedBackground(api);
const animatedBackgroundPlugin: Plugin<typeof settings> = {
id: "animated-background",
@@ -42,22 +41,20 @@ const animatedBackgroundPlugin: Plugin<typeof settings> = {
run: async (api) => {
await syncAnimatedBackground(api);
const resync = () => void syncAnimatedBackground(api);
const speedUnregister = api.settings.onChange("speed", updateAnimationSpeed);
const pageChangeUnregister = api.seqta.onPageChange(resync(api));
const pageshowHandler = (event: PageTransitionEvent) => {
if (event.persisted) void syncAnimatedBackground(api);
};
window.addEventListener("pageshow", pageshowHandler);
const pageChangeUnregister = api.seqta.onPageChange(resync);
window.addEventListener("pageshow", resync);
const containerObserver = new MutationObserver(resync(api));
const containerObserver = new MutationObserver(resync);
const container = document.getElementById("container");
if (container) containerObserver.observe(container, { childList: true });
return () => {
speedUnregister.unregister();
pageChangeUnregister.unregister();
window.removeEventListener("pageshow", pageshowHandler);
window.removeEventListener("pageshow", resync);
containerObserver.disconnect();
removeAnimatedBackgroundLayers();
};