-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
base: main
Are you sure you want to change the base?
fix: Add Beeep action to protobuf definitions and UI components #679
Conversation
- 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
|
@@ -229,6 +230,14 @@ message Hook { | |||
string webhook_url = 1 [json_name="webhookUrl"]; | |||
string template = 2 [json_name="template"]; | |||
} | |||
|
|||
message Beeep { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" }, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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"]; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 ?
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 :). |
Only tested on macOS!