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

fix: Add Beeep action to protobuf definitions and UI components #679

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johan-scriptdrift
Copy link

@johan-scriptdrift johan-scriptdrift commented Feb 23, 2025

Only tested on macOS!

  • Add Beeep action to the Hook message in config.proto
  • Modify HooksFormList component to include Beeep action
  • Update go.mod with beeep and related dependencies
Screenshot 2025-02-23 at 01 12 38 Screenshot 2025-02-23 at 01 16 28

- Add Beeep action to the Hook message in config.proto
- Modify HooksFormList component to include Beeep action
- Update go.mod with beeep and related dependencies
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -229,6 +230,14 @@ message Hook {
string webhook_url = 1 [json_name="webhookUrl"];
string template = 2 [json_name="template"];
}

message Beeep {
Copy link
Owner

Choose a reason for hiding this comment

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

Naming note: it may make more sense to name this after the capability e.g. OsNotification or such rather than the library beeep on the off chance that we need to migrate in the future.

Copy link
Author

Choose a reason for hiding this comment

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

Agree, I will update.

style={{ width: "100%" }}
placeholder={"Choose icon"}
options={[
{ label: "Information", value: "assets/information.png" },
Copy link
Owner

Choose a reason for hiding this comment

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

Where is this asset defined? Is this something backrest needs to bundle?

Copy link
Author

Choose a reason for hiding this comment

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

The icon is not available on macOS so I wasn't able to test it easily and thought it would work on Windows and Linux. There is an asset folder in the beeep package and I assumed the icons would be loaded from there.

I've now tried this on windows and the icons does not seem to work their either. So maybe we should remove this input?

message Beeep {
string template = 1 [json_name="template"];
string title_template = 2 [json_name="titleTemplate"];
double frequency = 3 [json_name="frequency"];
Copy link
Owner

Choose a reason for hiding this comment

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

Im somewhat ambivalent about accepting a frequency and duration , I wonder if most users mind or would rather have some opinionated default e.g. simply an enum.

I could see something like

enum DeliveryMode {
   SILENT,
   LOW_PITCH_CHIME,
   HIGH_PITCH_CHIME,
}

.

WDYT? are you finding the range of frequency control useful?

Copy link
Author

Choose a reason for hiding this comment

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

It seems like setting the frequency and duration does not work. At leat not on macOS. Maybe we should reduce this to just SILENT / CHIME ?

@garethgeorge
Copy link
Owner

Really nice contribution, thanks for the interest! And I think quite high value given that most approaches to OS notifications are not cross platform and involve powershell or action script items today. Scripting this is something I see users do frequently.

Using a cross platform library / adding native support makes a lot of sense to me and beeep is a good candidate library. Added a few notes but mostly opinions weakly held :).

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.

4 participants