Skip to content

Conversation

@Chin-Lee-lol
Copy link

  • Identified the issue which this PR solves.
  • Read the CONTRIBUTING document.
  • Code builds clean without any errors or warnings.
  • Added appropriate tests for any new functionality.
  • All new and existing tests passed.
  • Added comments in the code, where necessary.
  • Ran make check to catch common errors. Fixed any that came up.

Description:
This PR introduces a feature to make Slack alert details collapsible by default with an expandable "Show Details" button. This addresses the issue of long alert details flooding Slack channels while maintaining full access to alert information through user interaction.

The implementation adds a new configuration option Slack.IncludeDetails that allows admin to enable/disable this feature. When enabled, alert details longer than 150 characters or containing multiple lines are automatically truncated with a "Show Details" button that expands to show the complete information. When disabled, alert will only show alert summary (exactly same as before implementation)

The user experience is significantly improved by reducing channel noise while preserving the ability to access full alert details on demand.

Which issue(s) this PR fixes:
This PR addresses this issue: #3314

Out of Scope:
N/A

Screenshots:
Option to enable Slack details feature in Admin -> Config -> Slack:
image

Sample alert, details collapsed by default:
image

Expanded details:
image

Describe any introduced user-facing changes:

  • Configuration Option: New Slack.IncludeDetails boolean setting in GoAlert configuration
  • Slack Message Format: When enabled, long alert details are truncated with a "Show Details" button
  • Interactive Expansion: Users can click "Show Details" to view complete alert information
  • Smart Truncation: Details are truncated at 150 characters or first line break, whichever comes first
  • Backward Compatibility: When disabled, alerts display full details as before

Describe any introduced API changes:

  • Configuration API: Added Slack.IncludeDetails field to configuration schema
  • Slack Action Handler: New handleShowDetailsAction function processes "Show Details" button clicks
  • Message Building: Enhanced alertMsgOption function with conditional detail truncation
  • JSON Payload: Uses JSON encoding for button action data with error handling

Additional Info:
Testing: Added 20 comprehensive test cases covering all scenarios across notification and config modules

@Chin-Lee-lol Chin-Lee-lol marked this pull request as draft November 18, 2025 17:17
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