Skip to content

Conversation

@Kasper24
Copy link
Owner

  • feat: implement structured logging with Pino across application

    • Add Pino logger with pretty printing and environment-based log levels
    • Replace all console.log/error/warn calls with structured logging
    • Add comprehensive logging to all TRPC routes and main process
      functions:
      • API routes: pexels, pixabay, unsplash, wallhaven, wallpaper-engine
      • Core functionality: file operations, monitor detection, settings
        management
      • Wallpaper operations: search, set, thumbnail generation, theme
        generation
    • Include contextual metadata (input parameters, error details,
      execution status)
    • Add operation start/success/failure logging patterns for better
      observability
    • Fix error message in unsplash router (was incorrectly showing "Pexels
      API")
    • Improve error handling in wallpaper search and thumbnail generation
  • docs: update screenshot

  • fix: rename Pixabay filter key and title from color to colors in images and videos tabs

  • refactor: add scalingOptions support to all discover wallpaper source tabs

    • Added scaling options (stretch, fit, fill, center, tile) to
      Pexels, Pixabay, Unsplash, Wallhaven, and Wallpaper Engine tabs.
  • chore: remove react-intersection-observer dependency and related imports

  • fix: ensure API key is typed as string when retrieving from settings

  • refactor: improve generic type naming for wallpaper-related components and utilities

    • Renamed generic T to more descriptive TWallpaper across
      wallpaper-related components, hooks, and types.
    • Updated OnWallpaperApply and OnWallpaperDownload to use TWallpaper for
      better readability and clarity.
    • Applied changes consistently in paginateData, dialog components, grid
      components, and TRPC route types.
  • fix(types): add explicit generics to useQuery calls for settings and configuration hooks

    • Ensured useQuery in useConfiguration and useSettings explicitly specifies the return type.
    • Cast client.settings.get.query results to the appropriate DotNotationValueOf<SettingsSchema, TConfigKey> or generic T.
    • Updated configValue in useWallpaperData params to be optional for better type safety.
  • refactor: use env-paths for cache, log, and temp directories

    • Added env-paths dependency.
    • Updated logger, wallpaper set, and thumbnail modules to use
      platform-appropriate directories from env-paths("walltone").
    • Replaced hardcoded os.homedir() + .cache paths with paths.cache,
      paths.log, and paths.temp.
    • Removed unnecessary os imports.
  • refactor: set explicit log levels for streams and enable debug in development

    • Added level to each stream in pino.multistream for both production and
      development.
    • Changed default log level from info to debug in development for more
      verbose output
  • refactor: Implement direct download via steamcmd
    This commit introduces direct downloading for Wallpaper Engine
    wallpapers using steamcmd and overhauls the app's logging and error
    handling.

    Wallpaper Engine Direct Downloads

    • Replaces the previous "subscribe" method with a direct download flow.
    • When applying a Wallpaper Engine wallpaper, a new dialog prompts the
      user for their Steam credentials (username, password, and guard code).
    • The backend now uses steamcmd to download the workshop item
      directly, providing a more reliable way to acquire wallpapers.
    • The steamcmd dependency has been added to the packaging
      configurations.

    Centralized Logging and Error Handling

    • Implemented a global tRPC logging middleware that automatically
      logs all API calls, including duration and sanitized inputs (redacting
      keys like password and apiKey). This removes redundant logging
      statements throughout the codebase.
    • A new event-based error system has been added. If a wallpaper
      fails to apply on the backend, an event is emitted to the frontend,
      which displays a toast notification to the user with the error details.

    Refactoring and Other Improvements

    • Remote Wallpaper Caching: Wallpapers from all remote sources
      (Pexels, Unsplash, etc.) are now downloaded to a local cache before
      being applied, improving reliability.
    • Code Organization:
      • Centralized all application paths into a new lib/paths.ts
        module.
      • Extracted the DynamicControls component and
        useMonitorSelection hook into their own files for better code
        structure.
    • New Setting: Added a "Kill Wallpaper on Exit" option in the
      settings to terminate wallpaper processes when the application is
      closed.
    • Improved execute Utility: The command execution utility has been
      refactored for cleaner logging and adds support for stdout/stderr
      callbacks.

- Add Pino logger with pretty printing and environment-based log levels
- Replace all console.log/error/warn calls with structured logging
- Add comprehensive logging to all TRPC routes and main process
functions:
  - API routes: pexels, pixabay, unsplash, wallhaven, wallpaper-engine
  - Core functionality: file operations, monitor detection, settings
management
  - Wallpaper operations: search, set, thumbnail generation, theme
generation
- Include contextual metadata (input parameters, error details,
execution status)
- Add operation start/success/failure logging patterns for better
observability
- Fix error message in unsplash router (was incorrectly showing "Pexels
API")
- Improve error handling in wallpaper search and thumbnail generation
… tabs

- Added scaling options (stretch, fit, fill, center, tile) to
Pexels, Pixabay, Unsplash, Wallhaven, and Wallpaper Engine tabs.
…s and utilities

- Renamed generic T to more descriptive TWallpaper across
wallpaper-related components, hooks, and types.
- Updated OnWallpaperApply and OnWallpaperDownload to use TWallpaper for
better readability and clarity.
- Applied changes consistently in paginateData, dialog components, grid
components, and TRPC route types.
…configuration hooks

* Ensured `useQuery` in `useConfiguration` and `useSettings` explicitly specifies the return type.
* Cast `client.settings.get.query` results to the appropriate `DotNotationValueOf<SettingsSchema, TConfigKey>` or generic `T`.
* Updated `configValue` in `useWallpaperData` params to be optional for better type safety.
- Added `env-paths` dependency.
- Updated logger, wallpaper set, and thumbnail modules to use
platform-appropriate directories from `env-paths("walltone")`.
- Replaced hardcoded `os.homedir()` + `.cache` paths with `paths.cache`,
`paths.log`, and `paths.temp`.
- Removed unnecessary `os` imports.
…elopment

- Added level to each stream in pino.multistream for both production and
development.
- Changed default log level from info to debug in development for more
verbose output
This commit introduces direct downloading for Wallpaper Engine
wallpapers using `steamcmd` and overhauls the app's logging and error
handling.

### Wallpaper Engine Direct Downloads
- Replaces the previous "subscribe" method with a direct download flow.
- When applying a Wallpaper Engine wallpaper, a new dialog prompts the
user for their Steam credentials (username, password, and guard code).
- The backend now uses `steamcmd` to download the workshop item
directly, providing a more reliable way to acquire wallpapers.
- The `steamcmd` dependency has been added to the packaging
configurations.

### Centralized Logging and Error Handling
- Implemented a global **tRPC logging middleware** that automatically
logs all API calls, including duration and sanitized inputs (redacting
keys like `password` and `apiKey`). This removes redundant logging
statements throughout the codebase.
- A new **event-based error system** has been added. If a wallpaper
fails to apply on the backend, an event is emitted to the frontend,
which displays a toast notification to the user with the error details.

### Refactoring and Other Improvements
- **Remote Wallpaper Caching**: Wallpapers from all remote sources
(Pexels, Unsplash, etc.) are now downloaded to a local cache before
being applied, improving reliability.
- **Code Organization**:
    - Centralized all application paths into a new `lib/paths.ts`
module.
    - Extracted the `DynamicControls` component and
`useMonitorSelection` hook into their own files for better code
structure.
- **New Setting**: Added a "Kill Wallpaper on Exit" option in the
settings to terminate wallpaper processes when the application is
closed.
- **Improved `execute` Utility**: The command execution utility has been
refactored for cleaner logging and adds support for stdout/stderr
callbacks.
@Kasper24 Kasper24 changed the title dev Centralized structured logging, enhanced error handling, and direct Wallpaper Engine downloads via steamcmd Aug 11, 2025
- Remove unused logger import from monitor route
- Refactor wallpaper error subscription to emit error string directly
- Update error emission in setWallpaper to send error message string
instead of wrapped object
- Adjust renderer subscription to handle error as string and show toast
accordingly
- Clean up unused imports in wallpaper-dialog hooks
Set NIXPKGS_ALLOW_UNFREE=1 in the GitHub Actions nix-build job to enable
building packages with unfree licenses (e.g.,
@Kasper24 Kasper24 merged commit 7062843 into main Aug 11, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants