Skip to content

Conversation

@DuckyOnQuack-999
Copy link
Owner

@DuckyOnQuack-999 DuckyOnQuack-999 commented Aug 9, 2025

Complete Hypr-Ricer UI functionality by implementing missing configuration, tab logic, Hyprland modules, and an enhanced live preview system.


Open in Cursor Open in Web

Summary by Sourcery

Implement complete Hypr-Ricer UI functionality by adding full-featured preview components, tab logic for clipboard and lockscreen settings, new configuration classes, and real Hyprland window and animation managers, while improving event handling, logging, and validation.

New Features:

  • Add comprehensive live preview window with modular previews for Waybar, Desktop, Rofi, Notifications, Clipboard, and Lockscreen.
  • Implement ClipboardTab and LockscreenTab with full UI controls, configuration binding, and apply/test integration for cliphist, wl-clipboard, clipman, hyprlock, and swaylock.
  • Introduce WindowManager and AnimationManager with real Hyprland config parsing, file writing, and live application via hyprctl commands.
  • Add ClipboardConfig and LockscreenConfig classes to main configuration with serialization and validation support.

Enhancements:

  • Rework preview UI layout with scrollable content, debounced updates, signals, logging, and error handling.
  • Improve GUI event flow by connecting config_changed and preview_update_requested signals for all tabs and dispatching theme and plugin events.
  • Extend configuration validation for clipboard and lockscreen settings.

Documentation:

  • Add DUCKYCODER_UI_EXECUTION_COMPLETE.md report summarizing UI logic execution and fixes.

@cursor
Copy link

cursor bot commented Aug 9, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@sourcery-ai
Copy link

sourcery-ai bot commented Aug 9, 2025

Reviewer's Guide

This PR fleshes out the Hypr-Ricer application by adding full configuration support for clipboard and lockscreen, implementing real Hyprland window and animation manager methods with live hyprctl integration, completing ClipboardTab and LockscreenTab UI and system-apply logic, enhancing the PreviewWindow to display debounced live previews of multiple components, and correcting GUI signal wiring for responsive event handling.

Sequence diagram for configuration change and live preview update

sequenceDiagram
    actor User
    participant ClipboardTab
    participant Config
    participant PreviewWindow
    participant GUI
    User->>ClipboardTab: Change clipboard settings
    ClipboardTab->>Config: Update clipboard config
    ClipboardTab->>PreviewWindow: Emit config_changed signal
    PreviewWindow->>PreviewWindow: schedule_update()
    PreviewWindow->>PreviewWindow: update_preview()
    PreviewWindow->>GUI: Emit preview_updated signal
    GUI->>GUI: Update status bar
    GUI->>Config: Auto-save if enabled
Loading

Sequence diagram for applying lockscreen configuration and testing lock

sequenceDiagram
    actor User
    participant LockscreenTab
    participant Config
    participant System
    User->>LockscreenTab: Change lockscreen settings
    LockscreenTab->>Config: Update lockscreen config
    User->>LockscreenTab: Click 'Apply to System'
    LockscreenTab->>System: Write config file / script
    LockscreenTab->>System: Apply settings
    User->>LockscreenTab: Click 'Test Lock'
    LockscreenTab->>System: Launch lockscreen
    System->>User: Show lockscreen
Loading

Class diagram for new and updated configuration classes

classDiagram
    class Config {
        +WaybarConfig waybar
        +RofiConfig rofi
        +NotificationConfig notifications
        +ClipboardConfig clipboard
        +LockscreenConfig lockscreen
        +_to_dict()
        +_from_dict()
        +validate()
    }
    class ClipboardConfig {
        +str manager
        +int history_size
        +int max_item_size
        +bool enable_images
        +bool enable_primary_selection
        +bool persist_history
        +List[str] exclude_patterns
    }
    class LockscreenConfig {
        +str locker
        +str background_type
        +str background_path
        +str background_color
        +int timeout
        +int grace_period
        +bool show_failed_attempts
        +str keyboard_layout
        +str input_field_color
        +str text_color
        +str font_family
        +int font_size
    }
    Config --> ClipboardConfig
    Config --> LockscreenConfig
Loading

Class diagram for Hyprland WindowManager and AnimationManager

classDiagram
    class WindowManager {
        +str config_path
        +get_window_config()
        +set_window_config(config)
        +apply_window_config(config)
        +set_window_opacity(opacity)
        +set_border_size(size)
        +set_border_color(color)
        +set_gaps(gaps_in, gaps_out)
        +toggle_smart_gaps(enabled)
        +toggle_blur(enabled)
        +set_blur_size(size)
        +get_window_list()
        +focus_window(window_address)
        +close_window(window_address)
        +toggle_floating(window_address)
        +set_window_opacity_rule(window_class, opacity)
        +get_window_rules()
        +add_window_rule(rule, window_criteria, version)
        +remove_window_rule(rule_pattern)
        +get_active_window()
        +_reload_hyprland_config()
    }
    class AnimationManager {
        +str config_path
        +get_animation_config()
        +set_animation_config(config)
        +apply_animations(config)
        +get_available_curves()
        +get_animation_presets()
        +apply_preset(preset_name)
        +_reload_hyprland_config()
        +test_animation(animation_type)
    }
Loading

Class diagram for enhanced PreviewWindow and preview components

classDiagram
    class PreviewWindow {
        +Config config
        +WaybarPreview waybar_preview
        +DesktopPreview desktop_preview
        +RofiPreview rofi_preview
        +NotificationPreview notification_preview
        +ClipboardPreview clipboard_preview
        +LockscreenPreview lockscreen_preview
        +update_preview()
        +schedule_update()
        +setup_ui()
    }
    class WaybarPreview {
        +update_preview(config)
        +setup_ui()
    }
    class DesktopPreview {
        +update_preview(config)
        +setup_ui()
    }
    class RofiPreview {
        +update_preview(config)
        +setup_ui()
    }
    class NotificationPreview {
        +update_preview(config)
        +setup_ui()
    }
    class ClipboardPreview {
        +update_preview(config)
        +setup_ui()
    }
    class LockscreenPreview {
        +update_preview(config)
        +setup_ui()
    }
    PreviewWindow --> WaybarPreview
    PreviewWindow --> DesktopPreview
    PreviewWindow --> RofiPreview
    PreviewWindow --> NotificationPreview
    PreviewWindow --> ClipboardPreview
    PreviewWindow --> LockscreenPreview
Loading

File-Level Changes

Change Details Files
Enhanced live preview system with multiple components
  • Refactored PreviewWindow setup and added QTimer for debounced updates
  • Introduced scrollable area and header with refresh button
  • Added WaybarPreview, DesktopPreview, RofiPreview, NotificationPreview, ClipboardPreview, LockscreenPreview classes
  • Implemented update_preview logic to propagate config to all components
src/hyprrice/gui/preview.py
Implement real Hyprland window and animation managers
  • Completed WindowManager methods: get/set/apply config, rule management, hyprctl commands
  • Completed AnimationManager methods: get/set/apply animations, bezier curves, presets, testing
  • Added config parsing/writing and error handling with logging
src/hyprrice/hyprland/windows.py
src/hyprrice/hyprland/animations.py
Add ClipboardConfig and LockscreenConfig to main Config
  • Defined ClipboardConfig and LockscreenConfig dataclasses with full fields
  • Integrated into Config class, serialization (_to_dict, _from_dict) and validation rules
src/hyprrice/config.py
Fully implement ClipboardTab and LockscreenTab UI and logic
  • Added UI controls and layout for all clipboard and lockscreen settings
  • Bound controls to config, implemented _save_to_config and _apply_to_system methods
  • Emitted config_changed signals and provided test/apply functionality
src/hyprrice/gui/tabs.py
Fix GUI signal connections and event handling
  • Connected config_changed and preview_update signals for all tabs
  • Hooked up theme_manager and plugin_manager signals
  • Enhanced on_config_changed to save, schedule preview updates, emit plugin events
src/hyprrice/gui.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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.

3 participants