refactor: reorganize shell modules and lifecycle management - #3
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the shell by reorganizing stores/widgets into clearer domains, extracting UI/state helpers, and tightening lifecycle/cleanup behavior (especially around panels, notifications, and media). It also updates the build pipeline to produce a production bundle via esbuild and documents local check expectations.
Changes:
- Reorganized feature stores (system/media/connectivity/panel/shell) and refactored multiple widgets to consume the new state APIs.
- Extracted reusable UI/state helpers (e.g.,
AnimatedList, connectivity shared components, media helpers, screen-capture actions, coverflow animation/geometry). - Added production bundling (
scripts/build-js.mjs, updatedbuild.sh/deploy) and introduced a typecheck wrapper that filters known upstream AGS/Gnim errors.
Reviewed changes
Copilot reviewed 172 out of 176 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| styles/scss/_notifications.scss | Adds notification icon/image sizing styles. |
| styles/scss/_date_weather.scss | Adds empty-state/weather/world-clock/profile styling refinements. |
| styles/scss/_control_center.scss | Updates control-center layout/typography and introduces new utility classes. |
| styles/scss/_connectivity.scss | Adds modal title styling for connectivity dialogs. |
| styles/scss/_bar.scss | Updates bar typography/layout for clock, metrics, weather, indicators. |
| src/widget/wallpaper-selector/widget/WallpaperCard.ts | Refactors wallpaper card controller into a class and constants. |
| src/widget/wallpaper-selector/widget/coverFlowAnimation.ts | Adds tick-based coverflow animation controller. |
| src/widget/wallpaper-selector/coverFlowGeometry.ts | Adds geometry helpers for coverflow transforms/opacity/easing. |
| src/widget/power-menu/widget/PowerMenuMainView.tsx | Adds main power-menu view component. |
| src/widget/power-menu/widget/PowerMenuItemButton.tsx | Adds power-menu item button with confirmation motion styling. |
| src/widget/power-menu/widget/PowerMenuConfirmationView.tsx | Adds confirmation UI for power actions. |
| src/widget/power-menu/items.ts | Removes legacy power-menu item definitions. |
| src/widget/notification-popups/index.tsx | Refactors notification popups to store-driven state + AnimatedList. |
| src/widget/date-weather/widget/WorldClockRow.tsx | Adds extracted world clock row component. |
| src/widget/date-weather/widget/WorldClockCard.tsx | Refactors world clock card to use extracted row component. |
| src/widget/date-weather/widget/WeatherCard.tsx | Refactors forecast rendering into ForecastItem and new styles. |
| src/widget/date-weather/widget/ProfileCard.tsx | Refactors profile handling; normalizes avatar resolution/loading. |
| src/widget/date-weather/widget/NotificationList.tsx | Refactors notifications/DND state to centralized notification store + empty state styles. |
| src/widget/date-weather/widget/ForecastItem.tsx | Adds extracted forecast item component. |
| src/widget/date-weather/widget/ClockCard.tsx | Updates time store import and removes inline CSS margin. |
| src/widget/date-weather/utils.ts | Adds extracted world-clock formatting utilities. |
| src/widget/date-weather/DateWeatherContent.tsx | Adds extracted date-weather panel content container. |
| src/widget/control-center/widget/VolumeSliderContent.tsx | Adds extracted volume slider UI content. |
| src/widget/control-center/widget/VolumeSlider.tsx | Refactors volume slider to use system audio store/default speaker. |
| src/widget/control-center/widget/UpdatesCard.tsx | Refactors update card to system update store + SCSS classes. |
| src/widget/control-center/widget/SystemMetrics.tsx | Refactors metrics to system store + shared button class. |
| src/widget/control-center/widget/Sound/VolumeControls.tsx | Adds volume controls component for sound page devices. |
| src/widget/control-center/widget/Sound/utils.ts | Adds sound label helpers for endpoint/route. |
| src/widget/control-center/widget/Sound/types.ts | Adds shared type for sound device kind. |
| src/widget/control-center/widget/Sound/SoundDeviceSection.tsx | Adds composable section for sound device selection + controls. |
| src/widget/control-center/widget/Sound/DeviceSelector.tsx | Refactors device selector into typed component + shared utils. |
| src/widget/control-center/widget/ScreenCapture/ScreenshotActions.tsx | Adds extracted screenshot actions. |
| src/widget/control-center/widget/ScreenCapture/RecordingActions.tsx | Adds extracted recording actions driven by capture stores. |
| src/widget/control-center/widget/ScreenCapture/index.tsx | Adds new screen capture card composing extracted actions. |
| src/widget/control-center/widget/ScreenCapture.tsx | Removes legacy monolithic screen capture widget. |
| src/widget/control-center/widget/QuickToggles/WifiToggle.tsx | Adds Wi‑Fi quick toggle with status label and manage button. |
| src/widget/control-center/widget/QuickToggles/PowerProfileToggle.tsx | Adds power profile quick toggle backed by system power profile store. |
| src/widget/control-center/widget/QuickToggles/index.tsx | Adds quick toggles container composing individual toggles. |
| src/widget/control-center/widget/QuickToggles/CaffeineToggle.tsx | Adds caffeine quick toggle backed by new caffeine store. |
| src/widget/control-center/widget/QuickToggles/BluetoothToggle.tsx | Adds Bluetooth quick toggle with manage button. |
| src/widget/control-center/widget/MediaCard/utils.ts | Adds media source resolution helper. |
| src/widget/control-center/widget/MediaCard/PlayerControls.tsx | Adds extracted player controls component. |
| src/widget/control-center/widget/MediaCard/PlayerArtwork.tsx | Adds extracted artwork component with overlay/picture handling. |
| src/widget/control-center/widget/MediaCard/index.tsx | Refactors media card state handling to store-driven state. |
| src/widget/control-center/widget/MediaCard/CavaWidget.tsx | Refactors cava lifecycle management to store-managed acquisition/release. |
| src/widget/control-center/widget/Connectivity/WifiPage/utils.ts | Adds Wi‑Fi page helpers for AP IDs/labels. |
| src/widget/control-center/widget/Connectivity/WifiPage/ConnectedNetworkRow.tsx | Adds connected network row UI with detail menu. |
| src/widget/control-center/widget/Connectivity/WifiPage/AvailableNetworkRow.tsx | Adds available network row UI with security indicator. |
| src/widget/control-center/widget/Connectivity/Shared/types.ts | Adds shared connectivity types and re-exports. |
| src/widget/control-center/widget/Connectivity/Shared/PageHeader.tsx | Adds shared page header with back button and synced switch. |
| src/widget/control-center/widget/Connectivity/Shared/index.ts | Adds shared connectivity exports barrel. |
| src/widget/control-center/widget/Connectivity/Shared/ErrorLabel.tsx | Adds shared error label component for connectivity flows. |
| src/widget/control-center/widget/Connectivity/Shared/DetailMenuButton.tsx | Adds shared detail menu popover button. |
| src/widget/control-center/widget/Connectivity/Shared/ConfirmOverlay.tsx | Adds shared confirm modal overlay with busy/error handling. |
| src/widget/control-center/widget/Connectivity/index.tsx | Updates connectivity module exports. |
| src/widget/control-center/widget/Connectivity/BluetoothPage/utils.ts | Adds Bluetooth detail formatting helper. |
| src/widget/control-center/widget/Connectivity/BluetoothPage/ConnectedDeviceRow.tsx | Adds connected Bluetooth device row with detail menu. |
| src/widget/control-center/widget/Connectivity/BluetoothPage/AvailableDeviceRow.tsx | Adds available Bluetooth device row UI. |
| src/widget/control-center/widget/BrightnessSlider.tsx | Refactors brightness slider to system brightness store + shared button class. |
| src/widget/control-center/PageContainer.tsx | Adds shared animated page container for control center pages. |
| src/widget/control-center/ControlCenterPages.tsx | Adds stack-based control center page navigator. |
| src/widget/control-center/ControlCenterContent.tsx | Adds extracted main control center content composition. |
| src/widget/common/lucide.tsx | Refactors Lucide icon component typing and reactive support logic. |
| src/widget/common/ClickCatcher.tsx | Adds generic click-catcher widget. |
| src/widget/common/AnimatedList.tsx | Refactors animated list implementation to store-driven entry management. |
| src/widget/bar/widget/Workspaces.tsx | Refactors workspaces to monitor-scoped workspace store. |
| src/widget/bar/widget/Weather.tsx | Refactors weather widget to typed props + system store + SCSS classes. |
| src/widget/bar/widget/VolumeButton.tsx | Adds extracted volume button component with scroll volume adjust. |
| src/widget/bar/widget/Volume.tsx | Refactors bar volume to system audio store and extracted button. |
| src/widget/bar/widget/Updates.tsx | Refactors updates widget to system update store + typed props. |
| src/widget/bar/widget/TrayItemButton.tsx | Extracts tray item handling (click/menus/action groups) into component. |
| src/widget/bar/widget/Tray.tsx | Refactors tray to reuse extracted tray item button and cleanup hooks. |
| src/widget/bar/widget/SysMetrics.tsx | Refactors metrics to system store + SCSS classes and typed props. |
| src/widget/bar/widget/ScrollerIndicator.tsx | Refactors scrolling indicator logic into shell scrolling layout store. |
| src/widget/bar/widget/RecordIndicator.tsx | Refactors recording indicator to capture recording store + SCSS class. |
| src/widget/bar/widget/Clock.tsx | Refactors clock widget to system time store + SCSS-based styling. |
| src/widget/bar/BarReserve.tsx | Refactors bar reserve window to typed props object signature. |
| src/widget/app-launcher/widget/SearchInput.tsx | Refactors search input props/state typing and store imports. |
| src/widget/app-launcher/widget/SearchGoogleBtn.tsx | Refactors Google search button typing and store imports. |
| src/widget/app-launcher/widget/AppItem.tsx | Adds TSX app item component and removes imperative GTK builder version. |
| src/widget/app-launcher/widget/AppItem.ts | Removes legacy imperative app item builder. |
| src/stores/wifiPasswordDialog.ts | Removes legacy wifi password dialog store path (moved under connectivity). |
| src/stores/wallpaper/wallpaperSelector.ts | Adds wallpaper selector panel state with animation + cleanup. |
| src/stores/update.ts | Removes legacy update store (moved under system). |
| src/stores/system/update.ts | Adds update polling store using createExternal + refresh scheduling/cleanup. |
| src/stores/system/time.ts | Refactors time store to createExternal with cancellable timers. |
| src/stores/system/powerProfile.ts | Adds power profile integration and IPC-friendly setter helpers. |
| src/stores/system/idleDaemon.ts | Adds idle daemon adapter to safely start/stop known idle daemons. |
| src/stores/system/caffeine.ts | Adds queued/robust caffeine state machine with remote inhibit file management. |
| src/stores/shell/workspace.ts | Adds monitor-scoped workspace state and focus action. |
| src/stores/shell/style.ts | Refactors CSS compilation/reload, provider lifecycle, and bar color reload. |
| src/stores/shell/scrollingLayout.ts | Adds scrolling-layout info store and overview toggle action. |
| src/stores/shell/barBackground.ts | Adds bar background geometry and bar color extraction from theme SCSS. |
| src/stores/recording.ts | Removes legacy recording store (moved under capture). |
| src/stores/powerMenu.ts | Removes legacy power menu store (moved under panel domain). |
| src/stores/panel/dateWeather.ts | Adds date-weather panel show/hide state with lifecycle cleanup. |
| src/stores/panel/controlCenter.ts | Adds control-center panel show/hide state and lazy page loading flags. |
| src/stores/notification/send.ts | Updates paths import and error variable naming. |
| src/stores/notification/notificationPopup.ts | Adds monitor-aware notification popups store with timers and cleanup. |
| src/stores/notification/notification.ts | Refactors notification store (DND binding, dedupe, helper toggles). |
| src/stores/network.ts | Removes legacy connectivity commands store (moved under connectivity). |
| src/stores/mprisThumbnail.ts | Removes legacy mpris thumbnail fetcher (moved under media). |
| src/stores/media/mprisThumbnail.ts | Adds cancellable, validated YouTube thumbnail fetcher with Soup timeout. |
| src/stores/media/cava.ts | Adds cava acquisition/release helper to manage shared cava activation. |
| src/stores/connectivity/wifiPasswordDialog.ts | Adds connectivity-scoped wifi password dialog state with busy/error handling. |
| src/stores/connectivity/network.ts | Adds connectivity command helpers using direct exec args (nmcli/rfkill). |
| src/stores/common/animatedList.ts | Adds reusable animated list entry store with reveal/remove timers. |
| src/stores/capture/screenCapture.ts | Adds capture scheduling + screenshot/recording kickoff helpers. |
| src/stores/caffeine.ts | Removes legacy caffeine store (replaced by system caffeine + idle daemon adapter). |
| src/stores/audio.ts | Removes legacy audio store (refactored to system audio + lib helpers). |
| src/stores/application/query.ts | Adds URL detection + query opening/search helpers. |
| src/stores/application/launcherBackground.ts | Updates imports for launcher background texture loader. |
| src/stores/application/applicationHistory.ts | Adds persistent app launch scoring/history with migration logic. |
| src/stores/application/applicationCatalog.ts | Adds app catalog search + de-dup + history boosting. |
| src/stores/application/appLauncher.ts | Adds app launcher state (text/selection/results) using computed search. |
| src/lib/image.ts | Simplifies texture loader signature (removes caching flag/cache map). |
| src/lib/audio.ts | Adds reusable volume icon mapping helper. |
| src/ipc/types.ts | Adds shared IPC handler and callback types. |
| src/ipc/recording.ts | Adds IPC handler for recording start/stop/toggle with status messaging. |
| src/ipc/powerProfile.ts | Adds IPC handler for power-profile get/set. |
| src/ipc/panels.ts | Adds IPC handlers for toggling panels and listing windows. |
| src/ipc/notifications.ts | Adds IPC handlers for DND toggle and clearing notifications. |
| src/ipc/index.ts | Adds centralized IPC request dispatcher composed from handler maps. |
| src/ipc/css.ts | Adds IPC handler for CSS reload with launcher background refresh. |
| src/ipc/brightness.ts | Adds IPC handler for brightness actions and backend refresh. |
| src/ipc.ts | Removes legacy monolithic IPC handler file. |
| src/app.ts | Updates app startup to new widgets API, initializes CSS via store, adds shutdown cleanup for recording. |
| scripts/typecheck.sh | Adds typecheck wrapper that filters known upstream errors. |
| scripts/start-ags.sh | Adds start wrapper for gjs with gtk4-layer-shell preload. |
| scripts/deploy-user.sh | Ensures dist/app.js is deployed for runtime start script. |
| scripts/build.sh | Refactors build to esbuild bundling + start script install + sass flags. |
| scripts/build-js.mjs | Adds esbuild bundling configuration for production JS output. |
| README.md | Documents minimum check workflow and clarifies upstream typecheck exceptions. |
| pnpm-workspace.yaml | Allows building esbuild under pnpm workspace build restrictions. |
| package.json | Adds esbuild, new check/typecheck scripts, and pins pnpm version. |
| knip.json | Updates knip entry points and ignored dependencies for new build script. |
| .gitignore | Ignores JSX-related generated outputs. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
pnpm checkpnpm buildgit diff --checkKnown limitations
pnpm typecheckignores the two known upstream AGS/Gnim errors documented inREADME.md