Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use zsh-auto-notify plugin #55

Merged
merged 3 commits into from
Nov 10, 2024
Merged

Conversation

martimlobao
Copy link
Owner

@martimlobao martimlobao commented Nov 10, 2024

  • use existing plugin which has several improvements and bugfixes
  • store as link instead of downloading the plugin since it is seems somewhat abandoned and isn't accepting new fixes to the repo
  • modify default settings and enable sound
  • see: https://github.com/MichaelAquilina/zsh-auto-notify

Summary by Sourcery

Integrate the zsh-auto-notify plugin to enhance user experience by providing notifications for long-running terminal commands. Modify default settings to enable sound and adjust notification thresholds for better usability.

New Features:

  • Integrate the zsh-auto-notify plugin to provide notifications for long-running terminal commands.

Enhancements:

  • Modify default settings of the zsh-auto-notify plugin to enable sound notifications and adjust notification thresholds.

- use existing plugin which has several improvements and bugfixes
- store as link instead of downloading the plugin since it is seems somewhat abandoned and isn't accepting new fixes to the repo
- modify default settings and enable sound
Copy link
Contributor

sourcery-ai bot commented Nov 10, 2024

Reviewer's Guide by Sourcery

This PR replaces a custom implementation of command completion notifications with the zsh-auto-notify plugin. The plugin is added as a symlink rather than a direct download, and includes customized default settings including sound notifications. The implementation provides more robust notification handling across different platforms (Linux and macOS) and includes additional features like urgency levels and customizable messages.

Class diagram for zsh-auto-notify plugin integration

classDiagram
    class AutoNotify {
        +int AUTO_NOTIFY_EXPIRE_TIME
        +int AUTO_NOTIFY_THRESHOLD
        +int AUTO_NOTIFY_TRUNCATE_COMMAND
        +string AUTO_NOTIFY_SOUND
        +list AUTO_NOTIFY_IGNORE
        +void _auto_notify_format(string MESSAGE, string command, int elapsed, int exit_code)
        +void _auto_notify_message(string command, int elapsed, int exit_code)
        +string _is_auto_notify_ignored(string command)
        +void _auto_notify_send()
        +void _auto_notify_track(string command, string command_full)
        +void _auto_notify_reset_tracking()
        +void disable_auto_notify()
        +void enable_auto_notify()
    }
    note for AutoNotify "This class represents the zsh-auto-notify plugin with customizable settings and notification handling."
Loading

File-Level Changes

Change Details Files
Replace custom notification implementation with zsh-auto-notify plugin
  • Remove existing custom notification implementation
  • Add auto-notify to the plugins list
  • Configure default notification settings including threshold time and sound
linkme/.zshrc
Add zsh-auto-notify plugin implementation
  • Add platform-specific notification handling for Linux and macOS
  • Implement configurable notification messages and formatting
  • Add support for notification urgency levels and icons
  • Include whitelist/blacklist functionality for command notifications
  • Add sound notification support
linkme/.oh-my-zsh/custom/plugins/auto-notify/auto-notify.plugin.zsh

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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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

Copy link

trunk-io bot commented Nov 10, 2024

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @martimlobao - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider vendoring the plugin code directly instead of linking to it, since the repository is abandoned. This would prevent potential issues if the source repository becomes unavailable.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@martimlobao martimlobao merged commit 476a0ce into main Nov 10, 2024
7 checks passed
@martimlobao martimlobao deleted the feat/improve-auto-notify branch November 10, 2024 04:37
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