From 3c579d0e275cdaf6f2c9589abade94bde7905c82 Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Sat, 26 Apr 2025 22:36:23 +1000
Subject: clean

Remove everything
---
 src/modules/sidebar/index.tsx | 87 -------------------------------------------
 1 file changed, 87 deletions(-)
 delete mode 100644 src/modules/sidebar/index.tsx

(limited to 'src/modules/sidebar/index.tsx')

diff --git a/src/modules/sidebar/index.tsx b/src/modules/sidebar/index.tsx
deleted file mode 100644
index 7570283..0000000
--- a/src/modules/sidebar/index.tsx
+++ /dev/null
@@ -1,87 +0,0 @@
-import type { Monitor } from "@/services/monitors";
-import { bind, idle, register, Variable } from "astal";
-import { App, Astal, Gdk, Gtk, Widget } from "astal/gtk3";
-import { sidebar as config } from "config";
-import Alerts from "./alerts";
-import Audio from "./audio";
-import Connectivity from "./connectivity";
-import Dashboard from "./dashboard";
-import Packages from "./packages";
-import Time from "./time";
-
-export const paneNames = ["dashboard", "audio", "connectivity", "packages", "alerts", "time"] as const;
-export type PaneName = (typeof paneNames)[number];
-
-export const switchPane = (monitor: Monitor, name: PaneName) => {
-    const sidebar = App.get_window(`sidebar${monitor.id}`) as SideBar | null;
-    if (sidebar) {
-        if (sidebar.visible && sidebar.shown.get() === name) sidebar.hide();
-        else sidebar.show();
-        sidebar.shown.set(name);
-    }
-};
-
-export const awaitSidebar = (monitor: Monitor) =>
-    new Promise<SideBar>(resolve => {
-        let sidebar: SideBar | null = null;
-
-        const awaitSidebar = () => {
-            sidebar = App.get_window(`sidebar${monitor.id}`) as SideBar | null;
-            if (sidebar) resolve(sidebar);
-            else idle(awaitSidebar);
-        };
-        idle(awaitSidebar);
-    });
-
-const getPane = (monitor: Monitor, name: PaneName) => {
-    if (name === "dashboard") return <Dashboard />;
-    if (name === "audio") return <Audio />;
-    if (name === "connectivity") return <Connectivity />;
-    if (name === "packages") return <Packages monitor={monitor} />;
-    if (name === "alerts") return <Alerts monitor={monitor} />;
-    return <Time />;
-};
-
-@register()
-export default class SideBar extends Widget.Window {
-    readonly shown: Variable<PaneName>;
-
-    constructor({ monitor }: { monitor: Monitor }) {
-        super({
-            application: App,
-            name: `sidebar${monitor.id}`,
-            namespace: "caelestia-sidebar",
-            monitor: monitor.id,
-            anchor: Astal.WindowAnchor.LEFT | Astal.WindowAnchor.TOP | Astal.WindowAnchor.BOTTOM,
-            exclusivity: Astal.Exclusivity.EXCLUSIVE,
-            visible: false,
-        });
-
-        this.shown = Variable(paneNames[0]);
-
-        this.add(
-            <eventbox
-                onScroll={(_, event) => {
-                    if (event.modifier & Gdk.ModifierType.BUTTON1_MASK) {
-                        const index = paneNames.indexOf(this.shown.get()) + (event.delta_y < 0 ? -1 : 1);
-                        if (index < 0 || index >= paneNames.length) return;
-                        this.shown.set(paneNames[index]);
-                    }
-                }}
-            >
-                <box vertical className="sidebar">
-                    <stack
-                        vexpand
-                        transitionType={Gtk.StackTransitionType.SLIDE_UP_DOWN}
-                        transitionDuration={200}
-                        shown={bind(this.shown)}
-                    >
-                        {paneNames.map(n => getPane(monitor, n))}
-                    </stack>
-                </box>
-            </eventbox>
-        );
-
-        if (config.showOnStartup.get()) idle(() => this.show());
-    }
-}
-- 
cgit v1.2.3-freya

