Skip to content

frontend: Add new settings page#3756

Merged
patrickelectric merged 1 commit intobluerobotics:masterfrom
patrickelectric:settings
Feb 5, 2026
Merged

frontend: Add new settings page#3756
patrickelectric merged 1 commit intobluerobotics:masterfrom
patrickelectric:settings

Conversation

@patrickelectric
Copy link
Member

@patrickelectric patrickelectric commented Feb 3, 2026

Necessary for us to have more advanced configuration of the system

image

Summary by Sourcery

Introduce a dedicated settings page and route, moving existing settings controls from the header dialog into a full-page view with improved layout and UX.

New Features:

  • Add a new /settings route and SettingsView with sections for appearance, advanced mode, data management, and system configuration.
  • Expose theme, pirate mode, and developer mode toggles within the new settings page.

Enhancements:

  • Replace the settings dialog in the app header with navigation to the new settings page, simplifying the header and centralizing configuration.
  • Improve log management and reset flows with clearer presentation, progress feedback, and periodic size refresh in the settings page.
  • Enhance error handling for settings-related operations with snackbars and visual overlays.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 3, 2026

Reviewer's Guide

Implements a dedicated Settings page view with sections for appearance, advanced mode, data management, and system tools, moves existing log management and reset/wizard actions from the header dialog into this new page, wires it to the router, and changes the settings button to navigate to the new route with improved UX elements like overlays, snackbars, and periodic log size refresh.

Sequence diagram for log deletion streaming on the Settings page

sequenceDiagram
  actor User
  participant SettingsView
  participant BackAxios
  participant CommanderAPI

  User->>SettingsView: Click Clear System Logs
  SettingsView->>SettingsView: prepare_operation Resetting description
  SettingsView->>SettingsView: init deletion state
  SettingsView->>BackAxios: POST /commander/v1.0/services/remove_log_stream
  BackAxios->>CommanderAPI: HTTP POST remove_log_stream
  loop Streamed deletion updates
    CommanderAPI-->>BackAxios: text chunks with JSON entries
    BackAxios-->>SettingsView: onDownloadProgress event
    SettingsView->>SettingsView: parseStreamingResponse
    SettingsView->>SettingsView: update current_deletion_path
    SettingsView->>SettingsView: update current_deletion_total_size
  end
  CommanderAPI-->>BackAxios: final response end
  BackAxios-->>SettingsView: request resolved
  SettingsView->>SettingsView: clear deletion state
  SettingsView->>BackAxios: GET /commander/v1.0/services/check_log_folder_size
  BackAxios->>CommanderAPI: HTTP GET check_log_folder_size
  CommanderAPI-->>BackAxios: folder size bytes
  BackAxios-->>SettingsView: size response
  SettingsView->>SettingsView: update log_size_bytes and log_folder_size

  alt Error during deletion
    CommanderAPI-->>BackAxios: error response
    BackAxios-->>SettingsView: throw error
    SettingsView->>SettingsView: set operation_error and show_error
  end
Loading

Class diagram for the new SettingsView and related components

classDiagram
  class SettingsView {
    +settings any
    +disable_remove boolean
    +disable_remove_mavlink boolean
    +log_folder_size string
    +mavlink_log_folder_size string
    +show_reset_dialog boolean
    +show_reset_warning boolean
    +show_error boolean
    +operation_in_progress boolean
    +operation_description string
    +operation_error string
    +deletion_in_progress boolean
    +deletion_log_abort_controller AbortController
    +current_deletion_path string
    +current_deletion_size number
    +current_deletion_total_size number
    +current_deletion_status string
    +log_size_bytes number
    +mavlink_size_bytes number
    +fetch_task OneMoreTime

    +resetWarningMessage() string
    +log_size_warning() boolean
    +mavlink_size_warning() boolean

    +prepare_operation(description string) void
    +formatSize(bytes number) string
    +download_service_log_files() Promise
    +download_mavlink_log_files() Promise
    +get_log_folder_size() Promise
    +get_mavlink_log_folder_size() Promise
    +confirm_reset_settings() void
    +onConfirmResetSettings() void
    +reset_settings() Promise
    +remove_service_log_files() Promise
    +remove_mavlink_log_files() Promise
    +enable_wizard() Promise
  }

  class SettingsMenu {
    +openSettings() void
  }

  class Notifier {
    +service any
    +constructor(service any)
    +pushBackError(code string, error any) void
  }

  class OneMoreTime {
    +delay number
    +disposeWith any
    +constructor(config any)
    +setAction(action any) void
  }

  class SettingsLibrary {
    +is_dark_theme boolean
    +is_pirate_mode boolean
    +is_dev_mode boolean
  }

  class BagStore {
    +setData(key string, payload any) Promise
  }

  class BackAxios {
    +request(config any) Promise
  }

  class StreamingUtils {
    +parseStreamingResponse(response string) any
  }

  class Router {
    +push(path string) void
  }

  SettingsView --> SettingsLibrary : uses
  SettingsView --> Notifier : uses
  SettingsView --> OneMoreTime : owns
  SettingsView --> BagStore : uses
  SettingsView --> BackAxios : uses
  SettingsView --> StreamingUtils : uses

  SettingsMenu --> Router : uses
  SettingsMenu --> SettingsView : navigates_to
Loading

Flow diagram for navigation to the new Settings route and periodic log size refresh

flowchart LR
  User[User] --> SettingsButton[SettingsMenu_button]
  SettingsButton -->|click openSettings| Router[VueRouter]
  Router -->|push /settings| SettingsView[SettingsView_component]

  subgraph SettingsPage
    SettingsView --> OneMoreTimeTask[OneMoreTime_fetch_task]
    OneMoreTimeTask -->|every 30s| GetSystemLogSize[GET services/check_log_folder_size]
    OneMoreTimeTask -->|every 30s| GetMavlinkLogSize[GET services/check_mavlink_log_folder_size]
    GetSystemLogSize --> CommanderAPI[Commander_service_API]
    GetMavlinkLogSize --> CommanderAPI
    CommanderAPI --> GetSystemLogSize
    CommanderAPI --> GetMavlinkLogSize
    GetSystemLogSize --> SettingsView
    GetMavlinkLogSize --> SettingsView
  end
Loading

File-Level Changes

Change Details Files
Replace inline settings dialog in the top app bar with navigation to a full Settings page route.
  • Add tooltip to the settings icon button for better discoverability
  • Replace local dialog state and showDialog handler with an openSettings method that routes to /settings
  • Remove in-component dialog, reset warning, log management UI, and associated logic from the header component
core/frontend/src/components/app/SettingsMenu.vue
Register a new /settings route in the main router to serve the Settings view.
  • Add Settings route definition with lazy-loaded SettingsView component
  • Ensure route name is set to "Settings" for future navigation and breadcrumbs
core/frontend/src/router/index.ts
Introduce a rich SettingsView page that centralizes appearance, advanced mode, data management, and system configuration controls.
  • Create a structured layout with cards for Appearance, Advanced Mode (Pirate/Developer), Data Management (system and MAVLink logs), and System tools (configuration wizard, reset settings)
  • Integrate existing log download/removal APIs and streaming deletion progress, including periodic size refresh via OneMoreTime
  • Wire reset settings flow with confirmation dialog, overlay spinner, success dialog, and snackbar error handling
  • Expose theme and mode toggles by binding to the shared settings object and enabling pirate/dev modes
  • Reuse existing SpinningLogo and WarningDialog components and maintain notifier-based error reporting
core/frontend/src/views/SettingsView.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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Previously the log deletion AbortController was cancelled when the dialog closed; now that this logic lives in a routed view, consider aborting any in‑progress deletion in a lifecycle hook (e.g. beforeDestroy) to avoid a dangling stream if the user navigates away mid‑operation.
  • The 100MB threshold logic for logs (both log_size_warning/disable_remove and MAVLink equivalents) is duplicated and recalculated inline; extracting this to a small shared constant/helper would make the limit easier to change and reduce repetition.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Previously the log deletion AbortController was cancelled when the dialog closed; now that this logic lives in a routed view, consider aborting any in‑progress deletion in a lifecycle hook (e.g. beforeDestroy) to avoid a dangling stream if the user navigates away mid‑operation.
- The 100MB threshold logic for logs (both `log_size_warning`/`disable_remove` and MAVLink equivalents) is duplicated and recalculated inline; extracting this to a small shared constant/helper would make the limit easier to change and reduce repetition.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@patrickelectric patrickelectric merged commit ebd3a1c into bluerobotics:master Feb 5, 2026
7 checks passed
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.

2 participants