Add top bar STATUSTEXT widget with history popover#3876
Draft
Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Draft
Add top bar STATUSTEXT widget with history popover#3876Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Williangalvani wants to merge 1 commit intobluerobotics:masterfrom
Conversation
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
Reviewer's GuideAdds 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 widgetsequenceDiagram
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
Class diagram for the new StatustextWidget component and related typesclassDiagram
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
Flow diagram for STATUSTEXT toast lifecycle in the widgetflowchart 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]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:

Latest message

History:
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: