Skip to content

Conversation

@ManiMatter
Copy link

πŸ“‹ Overview

πŸ› οΈ Type of change

  • πŸ› Bugfix (a non-breaking change that resolves an issue)
  • ✨ New feature (a non-breaking change that adds new functionality)
  • ⚠️ Breaking change (a fix or feature that alters existing functionality in a way that could cause issues)
  • 🎨 User Interface (UI) updates
  • πŸ“„ New Documentation (addition of new documentation)
  • πŸ“„ Documentation Update (modification of existing documentation)
  • πŸ“„ Documentation Update Required (the change requires updates to related documentation)
  • πŸ”§ Other (please specify):
    • Provide additional details here.

πŸ“„ Checklist

  • πŸ” My code adheres to the style guidelines of this project.
  • 🦿 I have indicated where (if any) I used an LLM for the contributions
  • βœ… I ran ESLint and other code linters for modified files.
  • πŸ› οΈ I have reviewed and tested my code.
  • πŸ“ I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • ⚠️ My changes generate no new warnings.
  • πŸ€– My code needed automated testing. I have added them (this is an optional task).
  • πŸ“„ Documentation updates are included (if applicable).
  • πŸ”’ I have considered potential security impacts and mitigated risks.
  • 🧰 Dependency updates are listed and explained.
  • πŸ“š I have read and understood the Pull Request guidelines.

πŸ“· Screenshots or Visual Changes

Event Before After
UP https://ibb.co/xKTFPjmr https://ibb.co/VYx8MSmP
DOWN https://ibb.co/k2dqTGrt https://ibb.co/84MYrvjr

Copy link
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

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

Please add templating instead of minimalist mode as I requested.
Maintaining such outgrowths is not something that is feasible for us.

Please see the previous prs for telegram/webhooks/SMTP.

@ManiMatter
Copy link
Author

ManiMatter commented Aug 2, 2025

I had not understood that you wanted me to implement the templating feature, apologies for that.
I see where you are coming from, and understand why the templating approach is good, as it gives much freedom to the user to define the details what they want to see.

At the same time, the contribute guidelines state:

uptime-kuma/CONTRIBUTING.md

Lines 444 to 446 in 4b5ff08

I personally do not like something that requires a lot of configuration before
you can finally start the app. The goal is to make the Uptime Kuma installation
as easy as installing a mobile app.

With the feature I am proposing here, it is one simple click to show the absolute minimum information somebody would need so that the person knows that it's time to take action.

While I see the benefit of implementing the template solution, I think it would go against the contribute guideline to achieve the desired behavior.

For experts, who want to have very bespoke messages, by all means, template is the way to go. But to have a minimalist message, I think that'd would not be the right approach, as it would require much more tinkering with the template to create a minimalist version compared to just switching a toggle.

Can I convince you that this feature is good as it is?

@CommanderStorm
Copy link
Collaborator

You can opt into configuring the notification provider with the existing templating subsystem.
I won't merge a 3rd templating subsystem.

What said paragraph is refering to is needing to fill out 100 lines of yaml like you would need for some of the competition at the time the project was started.
You don't need to do this, you can drop down to get finer controll.

@ManiMatter
Copy link
Author

ManiMatter commented Aug 2, 2025

Had a look at the current templating code.
As it stands, with the current template it would not be possible to replicate what I showed above (ie., the minimalist message), given the up/down statuses are hardcoded in the template:

serviceStatus = (heartbeatJSON["status"] === DOWN) ? "πŸ”΄ Down" : "βœ… Up";

Therefore, a short notification that only consists of the icon + service name would not be possible; it would always be icon + the "up" or "down" word + service name.

Would you be open that I expand the template to make the status message configurable, along these lines?

    async renderTemplate(template, msg, monitorJSON, heartbeatJSON, statusTextUp = "βœ… Up", statusTextDown = "πŸ”΄ Down") {
....
            serviceStatus = (heartbeatJSON["status"] === DOWN) ? statusTextDown : statusTextUp;

I believe this would be a non-breaking enhancement, as the parameters are passed in optionally; for discord, it'd then make it configurable on the UI (ie., that you can change "βœ… Up" to just "βœ…"

With that enhancement, a user would then be able to use the templating mechanism for a minimalist message as I had shown it above.

Thanks for letting me know.

@CommanderStorm
Copy link
Collaborator

You don't need to use status, that is just a convenience thing.
You can just switch your if-stamtemnt in the template on the actual heartbeatJSON["status"]

@CommanderStorm CommanderStorm changed the title Adds Minimalist-Notification setting for discord feat(discord): implement templates for discord notifications Aug 2, 2025
@ManiMatter
Copy link
Author

I still feel the bare templating itself is too complicated for a non-expert user that simply wants to show a trivial "works" vs "doesn't work" status.

Yes, it can be achieved, but if the user first has to learn a syntax to write that in a way so the template gets it right, it is too cumbersome. Maybe worthwhile for an expert to personalize what they want to see, but not for a simple user who wants something simple.

I wonder if there's a middle ground.
Would it be an idea to show on the discord notifications UI a dropdown "Message Format" with these values?

  • Normal -> Shows the current message
  • Minimalist -> Shows the minimalist message
  • Custom -> Opens the template where user can self-configure what they want to see

On the backend, all 3 go through the templating engine, so there's no difference; Normal + Minimalist simply pass the desired format already "pre-cooked" to the backend, so that the simple user doesn't have to write the template syntax themselves.

Wdyt

@CommanderStorm CommanderStorm added the pr:please address review comments this PR needs a bit more work to be mergable label Aug 4, 2025
@CommanderStorm CommanderStorm marked this pull request as draft August 4, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:resolve-merge-conflict pr:please address review comments this PR needs a bit more work to be mergable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants