Skip to content

Widget config: replace disappearing "default" data source with an always-present "Any" option #203

Description

@mairas

Summary

In widget configuration, the Data Source dropdown for a path behaves inconsistently depending on how many sources currently publish that path:

  • One source → the only option is a literal default, and the field is set to default.
  • Two or more sourcesdefault disappears from the list entirely; only the concrete source keys are offered. An existing default selection is silently reset, forcing the user to re-pick a concrete source.

This makes default look like a per-path artifact that comes and goes, when it is actually the most useful option — the server-merged, priority-following value. Proposal: always present it as a stable Any entry at the top of the list, with the concrete sources listed underneath.

Why default already means "any source"

default is not a placeholder for "the one source we have". At the data layer, source === 'default' reads pathValue — the Signal K server's merged / priority-selected value:

  • data.service.ts:258currentValue = source === 'default' ? dataPath.pathValue : dataPath.sources?.[source]?.sourceValue ?? null
  • data.service.ts:364-382 — documents that with multiple sources and SK priorities configured, default follows whichever source the server currently favors, giving automatic failover (e.g. two GPS units, one drops out, the value keeps flowing).

So "accept data from any source, let the server decide" is exactly default's runtime behavior — and it is most valuable when a path has several sources, which is precisely when the current UI removes it.

Current behavior (where)

Two config components carry the same logic:

  1. src/app/widget-config/path-control-config/path-control-config.component.ts:219-234

    • 1 source → availableSources = ['default']
    • >1 source → availableSources = Object.keys(pathObject.sources) (no default); a saved default value is reset().
    • Template path-control-config.component.html:83-87 renders each option as the raw string, so the label shown is literally default.
  2. src/app/widget-config/dataset-chart-options/dataset-chart-options.component.ts:141-155 (data chart widget)

    • Same 1-vs-many split; default is likewise absent from the >1 branch.
    • Template dataset-chart-options.component.html:50-57.

Problems

  • Confusing label. default reads as "the default choice", not "the merged/any-source value". Users don't know what selecting it does.
  • It vanishes when it matters most. The moment a second source appears for a path, the "any source / failover" option is removed, and users are pushed to pin a single concrete source — losing automatic failover.
  • Silent reset (path-control-config only). Re-opening a widget's config after a path gains a second source clears a previously-saved default selection, so the field shows empty/invalid until re-selected.

Proposed change

  • Always include an Any option as the first entry in the Data Source list, regardless of source count. It maps to the existing stored value 'default' (display label "Any", stored value unchanged).
  • List the concrete sources below it (grouped/ordered as today).
  • Stop dropping default and stop resetting a saved default selection when a path has multiple sources.
  • Apply to both components above so widget paths and data-chart series behave the same.

Design direction only — no code prescribed here.

Back-compat / migration

None required. The stored config value stays 'default'; "Any" is only the display label for it. Existing widgets configured with default keep working and now render a stable, meaningful option instead of one that may disappear.

Verification

  • Path with a single source: Data Source shows Any (selected), no literal default.
  • Path with multiple sources: Data Source shows Any at top plus each concrete source; selecting Any persists and yields server-priority/failover behavior at runtime.
  • Re-opening a widget whose saved source is default after a second source has appeared: selection is preserved (not reset), shown as Any.
  • Same for the data-chart widget's Source field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:uxUX & interaction designenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions