Skip to content

feat: Generalise the alert system and add directional arrow support via the @left and @right syntax - #3

Merged
cooperj merged 8 commits into
mainfrom
more-than-bugs
May 31, 2026
Merged

cooperj merged 8 commits into
mainfrom
more-than-bugs

Conversation

@cooperj

@cooperj cooperj commented May 30, 2026 •

Copy link
Copy Markdown
Member

This pull request completes work on issue #2 and refactors the FRE Information Panel to generalise from bug detection alerts to a broader system of alerts (including plant health and pest detection).

It introduces support for new alert types, adds more audio and visual cues for alerts, and updates the documentation and dependencies accordingly.

Generalisation and Feature Expansion:

  • Refactored all code, UI, and documentation references from "bug detection" to "alert" to support a wider range of alerts (e.g., plant health, pest detection, etc.), including new topics and message formats (/information_panel/alert, diseased_plant, etc.). [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated launch argument descriptions and documentation to reflect the new alert system. [1] [2] [3]

Audio and Visual Enhancements:

  • Changed from the component BugAudioPlayer to AlertAudioPlayer to provide audio feedback for alerts, including randomized intro and error tracks, and support for directional cues (left/right). [1] [2] [3]
  • Renamed and generalised the emoji background animation from BugEmojiBackground to AlertEmojiBackground, supporting all alert types. [1] [2] [3] [4] [5] [6]

UI and Codebase Improvements:

  • Refactored the main App.tsx to handle generic alerts, support direction parsing and icons, and improve visual presentation for multiple alert types. [1] [2] [3] [4]
  • Improved background and title rendering logic for better adaptability to multiple alert types and counts. [1] [2]

Dependency and Manifest Updates:

  • Added new dependency lucide-react for icons and updated versioning in package.json. [1] [2] [3]
  • Updated the web manifest description to reflect broader alert and notification support.

These changes lay the foundation for supporting a variety of alerts in the FRE Information Panel, with improved user feedback via sound and visuals.

cooperj added 3 commits May 30, 2026 13:30
* support @left and @right alert suffixes
* render large directional arrows in the panel
* drive intro playback from alert theme config
* route unknown alerts to random error sounds
* add diseased_plant alert handling
@cooperj cooperj self-assigned this May 30, 2026
@cooperj cooperj changed the title Generalise alert system and enhance directional alert UI feat: Generalise the alert system and add directional arrow support via the @left and @right syntax May 30, 2026
@cooperj
cooperj requested a review from Copilot May 30, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR broadens the FRE Information Panel from “bug detection” to a generic alert system, switches the ROS topic to /information_panel/alert, and adds @left / @right directional support with corresponding UI + audio cues.

Changes:

  • Refactor frontend parsing, theming, and runtime topic subscription from “bugs” to “alerts” (including new diseased_plant type).
  • Add alert audio playback (intro/error + optional left/right cue) and update visuals/icons for directional guidance.
  • Update docs/manifest and add lucide-react for arrow icons.

Reviewed changes

Copilot reviewed 11 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/fre_information_panel/web.json Updates the bridge subscription topic to /information_panel/alert.
src/fre_information_panel/src/useDetectedAlerts.ts Renames and refactors the hook to subscribe to the new alert topic and manage idle clearing.
src/fre_information_panel/src/App.tsx Generalises UI to alerts, parses @left/@right, and renders direction arrows + updated components.
src/fre_information_panel/src/alertThemes.ts Introduces alert themes/keys and detection parsing for the new alert system.
src/fre_information_panel/src/AlertEmojiBackground.tsx Renames and generalises the emoji background to support alert detections.
src/fre_information_panel/src/AlertAudioPlayer.tsx Adds audio playback for alerts, including directional cue support.
src/fre_information_panel/public/manifest.webmanifest Updates manifest description to reflect alerts/notifications.
src/fre_information_panel/package.json Bumps version and adds lucide-react.
src/fre_information_panel/package-lock.json Locks dependency updates including lucide-react.
src/fre_information_panel/launch/web.launch.py Updates launch argument description to reflect alerts.
README.md Updates topic name, expected options, and usage examples for alerts and direction syntax.
src/fre_information_panel/src/BugAudioPlayer.tsx Removes the bug-specific audio player in favour of the alert-based implementation.
Files not reviewed (1)
  • src/fre_information_panel/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fre_information_panel/src/AlertAudioPlayer.tsx
Comment thread README.md
Comment on lines +11 to +15
- Topic: `/information_panel/alert`
- Message type: `std_msgs/msg/String`
- Expected options: `[ "bee", "butterfly", "ladybird" ]`
- Expected options: `[ "bee", "butterfly", "ladybird", "diseased_plant" ]`
- Can be passed as `bee,butterfly` when both are detected.
- Example: `diseased_plant` for diseased plant classification.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is not correct. I will be getting in alerts for diseased_plant and not jute. However, the ROS system underpinning this will have the detections correctly.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@cooperj cooperj added the enhancement New feature or request label May 30, 2026
@cooperj
cooperj requested a review from jondave May 30, 2026 14:16
@cooperj
cooperj marked this pull request as ready for review May 30, 2026 14:16
@cooperj cooperj linked an issue May 30, 2026 that may be closed by this pull request
cooperj added 3 commits May 30, 2026 15:51
…aid once at the end compared to with every item.

Test cases:

ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'bee'}"
ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'bee,butterfly,ladybird'}"
ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'ladybird@right'}"
ros2 topic pub --once /information_panel/alert std_msgs/msg/String "{data: 'bee,butterfly,ladybird@left'}"
* we are making a breaking change with the alert topic so following semver
@cooperj
cooperj merged commit 38b4388 into main May 31, 2026
1 check passed
@cooperj
cooperj deleted the more-than-bugs branch May 31, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for left and right arrows and change topic name

2 participants