Skip to content

Add top bar STATUSTEXT widget with history popover#3876

Draft
Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Williangalvani:statustext_
Draft

Add top bar STATUSTEXT widget with history popover#3876
Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Williangalvani:statustext_

Conversation

@Williangalvani
Copy link
Copy Markdown
Member

@Williangalvani Williangalvani commented Apr 15, 2026

Register a compact Vehicle messages widget in the app bar that listens for MAVLink STATUSTEXT, expands in place with severity coloring, and keeps a short recent history behind the message icon.

Idle:
image

Latest message
image

History:

image

This is useful for understanding untreated errors, as they will likely say something in a statustext message

Summary by Sourcery

Add a top bar widget that surfaces MAVLink STATUSTEXT messages with inline toasts and a recent history popover.

New Features:

  • Introduce a Vehicle messages widget in the app bar that subscribes to MAVLink STATUSTEXT and displays the latest message inline with severity-based coloring.
  • Provide a popover history view showing a timestamped list of recent STATUSTEXT messages, capped to a small rolling buffer.

Register a compact Vehicle messages widget in the app bar that listens
for MAVLink STATUSTEXT, expands in place with severity coloring, and
keeps a short recent history behind the message icon.

Made-with: Cursor
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 15, 2026

Reviewer's Guide

Adds a new top-bar "Vehicle messages" widget that listens to MAVLink STATUSTEXT messages, shows the latest message as an auto-expanding colored toast in the app bar, and provides a popover with a short history of recent messages.

Sequence diagram for MAVLink_STATUSTEXT handling in the Vehicle_messages widget

sequenceDiagram
  participant Vehicle
  participant MAVLink
  participant MAVLink2Rest
  participant StatustextWidget
  participant VueTopBar
  participant Window
  participant User
  participant Listener_instance

  VueTopBar->>StatustextWidget: mount_widget
  StatustextWidget->>MAVLink2Rest: startListening_STATUSTEXT
  MAVLink2Rest-->>StatustextWidget: Listener_instance
  StatustextWidget->>Listener_instance: setCallback_onStatustext
  StatustextWidget->>Listener_instance: setFrequency_0

  loop For_each_STATUSTEXT
    Vehicle->>MAVLink: STATUSTEXT_message
    MAVLink->>MAVLink2Rest: forward_STATUSTEXT
    MAVLink2Rest->>Listener_instance: emit_receivedMessage
    Listener_instance->>StatustextWidget: callback_receivedMessage
    StatustextWidget->>StatustextWidget: statustextToString_text
    StatustextWidget->>StatustextWidget: severityType_severity
    StatustextWidget->>StatustextWidget: update_recent_entries
    StatustextWidget->>StatustextWidget: showToast_text_severity
    StatustextWidget->>StatustextWidget: set_toast_text_and_severity
    StatustextWidget->>StatustextWidget: set_is_expanded_true
    StatustextWidget->>Window: setTimeout_hide_timer
  end

  StatustextWidget->>Window: clearTimeout_hide_timer_on_new_message
  StatustextWidget->>Window: clearTimeout_collapse_timer_on_new_message

  Window-->>StatustextWidget: hide_timer_expires
  StatustextWidget->>StatustextWidget: set_is_expanded_false
  StatustextWidget->>Window: setTimeout_collapse_timer
  Window-->>StatustextWidget: collapse_timer_expires
  StatustextWidget->>StatustextWidget: clear_toast_text

  User->>StatustextWidget: click_menu_icon
  StatustextWidget->>StatustextWidget: open_history_menu
  StatustextWidget-->>User: show_recent_vehicle_messages

  StatustextWidget->>Listener_instance: discard_on_beforeDestroy
  StatustextWidget->>Window: clearTimeout_hide_and_collapse
Loading

Class diagram for the new StatustextWidget component and related types

classDiagram

  class StatustextWidget {
    +string name
    +Listener listener
    +boolean menu_open
    +number next_entry_id
    +StatustextEntry[] recent_entries
    +string toast_text
    +string toast_severity
    +boolean is_expanded
    +number hide_timer
    +number collapse_timer
    +string toast_color()
    +void mounted()
    +void beforeDestroy()
    +void showToast(string text, string sevType)
  }

  class StatustextEntry {
    +number id
    +string text
    +string time
  }

  class Listener {
    +Listener setCallback(Function callback)
    +Listener setFrequency(number frequency)
    +void discard()
  }

  class MAVLink2Rest {
    +Listener startListening(string messageName)
  }

  StatustextWidget "1" o-- "*" StatustextEntry : manages
  StatustextWidget --> Listener : uses
  StatustextWidget --> MAVLink2Rest : calls
Loading

Flow diagram for STATUSTEXT toast lifecycle in the widget

flowchart LR
  A[Incoming_STATUSTEXT_message] --> B[Convert_payload_to_text_with_statustextToString]
  B --> C{Text_is_non_empty?}
  C -->|No| Z[Ignore_message]
  C -->|Yes| D{Same_as_latest_recent_entry?}
  D -->|Yes| Z
  D -->|No| E[Compute_severity_type_with_severityType]
  E --> F[Add_entry_to_recent_entries_and_trim_to_MAX_RECENT]
  F --> G[showToast_text_severity]
  G --> H[Clear_existing_hide_and_collapse_timers]
  H --> I[Set_toast_text_and_toast_severity]
  I --> J[Set_is_expanded_true_card_expands]
  J --> K[Start_hide_timer_TOAST_MS]
  K --> L[On_hide_timer_expiry_set_is_expanded_false]
  L --> M[Start_collapse_timer_COLLAPSE_MS]
  M --> N[On_collapse_timer_expiry_clear_toast_text]
Loading

File-Level Changes

Change Details Files
Register a new Vehicle messages widget in the app bar.
  • Import the new Statustext widget component into the main App component.
  • Add the Statustext widget to the list of top bar widgets with the label "Vehicle messages" and no additional props.
core/frontend/src/App.vue
Implement a STATUSTEXT-driven top bar widget with toast display and history popover.
  • Create a Statustext widget component that listens to MAVLink STATUSTEXT via mavlink2rest, using a Listener that is configured with a STATUSTEXT filter and zero frequency (event-driven).
  • Parse STATUSTEXT payloads into user-visible strings, map MAVLink severity codes to Vuetify color names, and maintain a capped in-memory list of recent messages with timestamps.
  • Display the latest STATUSTEXT as a compact toast in the app bar that auto-expands and collapses over a timed interval, with severity-based background coloring and z-index adjustments while active.
  • Provide an icon button with tooltip that opens a menu showing the recent STATUSTEXT history in a scrollable list, with graceful handling when there are no messages.
  • Add scoped styles to control the widget’s size, expansion animation, ellipsis behavior for long text, and visual hierarchy in the top bar.
core/frontend/src/widgets/Statustext.vue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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