Skip to content

refactor: simplyfied and improved notification sender and its usage#27

Closed
sbalghari wants to merge 4 commits into
mainfrom
dev
Closed

refactor: simplyfied and improved notification sender and its usage#27
sbalghari wants to merge 4 commits into
mainfrom
dev

Conversation

@sbalghari

@sbalghari sbalghari commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added volume control action supporting up, down, and toggle operations
    • Added brightness control action supporting incremental adjustments
  • Changed

    • Refactored notification system architecture
    • Updated multimedia keybindings to use new volume and brightness actions
  • Chores

    • Fixed JSONC formatting in system configuration

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces Volume and Brightness system actions that replace direct command-line media control with a centralized sbdots-actions dispatch. It refactors the notification system from a context-manager class to a typed functional API, updates existing code to the new notification interface, and wires the actions into Hyprland keybindings.

Changes

Volume and Brightness Actions with Notification Refactoring

Layer / File(s) Summary
Notification library refactoring
src/sbdots/library/command/notify_send.py, src/sbdots/library/command/__init__.py
Old Notification class and convenience function removed; replaced with typed notify_send() that validates urgency/progress_value, builds notify-send CLI arguments, and converts subprocess errors to RuntimeError.
Volume action implementation
src/sbdots/actions/volume.py
New Volume action parses mode (up/down/toggle) and optional percentage delta, applies changes via wpctl, detects mute state, and sends progress notifications with icons mapped to volume thresholds.
Brightness action implementation
src/sbdots/actions/brightness.py
New Brightness action parses direction and percentage delta (0–100), applies changes via brightnessctl, and sends notifications with icons mapped to brightness ranges.
Action registration and code migration
src/sbdots/constants.py, src/sbdots/actions/on_wallpaper_change.py, src/sbdots/lifecycle/postinstall/apply_wallpaper.py, src/sbdots/ctl/updates.py
VALID_ACTIONS extended with "volume" and "brightness"; existing code migrated from old Notification context-manager to new notify_send() function calls, updating argument names (body/expire_time replace message/time).
Hyprland multimedia keybindings
dotfiles/configs/hypr/hyprland/keybindings.lua
Volume and brightness keybindings (XF86Audio*, XF86MonBrightness*) now dispatch through sbdots-actions volume/brightness with delta steps, replacing direct wpctl/brightnessctl pipeline.
Configuration cleanup and changelog
dotfiles/configs/waybar/modules.jsonc, CHANGELOG.md
Waybar tray module trailing comma removed for formatting; changelog documents new actions and notification refactoring under [Unreleased] section.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • sbalghari/sbdots#26: Parallel implementation of brightness/volume actions with differences in the underlying notification API.
  • sbalghari/sbdots#14: Overlapping notification refactoring changes in on_wallpaper_change.py and related notification plumbing.
  • sbalghari/sbdots#13: Removes the bin/sbdots-actions wrapper that these keybindings now depend on for action dispatch.

🐰 New actions bloom like spring carrots—
volume hops, brightness gleams,
notifications bounce with joy,
keybindings dance with purpose.
The warren grows smarter! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the pull request: refactoring the notification system for simplification and improved functionality.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sbalghari sbalghari closed this Jun 8, 2026
@sbalghari sbalghari deleted the dev branch June 8, 2026 15:46
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.

1 participant