Skip to content

Add example Dashboard import from the File menu #506

Description

@BorisTyshkevich

Summary

Add an Import example Dashboard… action to the application-wide File menu. It opens a modal dialog where the user selects one shipped example Dashboard and either imports it or cancels.

Example catalogue

Keep the example catalogue in a JSON manifest under examples/. Each entry stores both the JSON filename and a human-readable full name; the UI must use the stored name rather than deriving it from the filename.

Suggested shape:

[
  { "file": "clickhouse-operations.json", "name": "ClickHouse Operations" },
  { "file": "shop-charts.json", "name": "Shop Charts" },
  { "file": "ontime-charts.json", "name": "OnTime Charts" }
]

Ship these three examples initially:

  • clickhouse-operations.jsonClickHouse Operations
  • shop-charts.jsonShop Charts
  • ontime-charts.jsonOnTime Charts

The manifest is the ordered source of truth for which examples appear and how they are labelled.

User flow

  1. The user opens File → Import example Dashboard….
  2. A modal dialog opens with a single-select list of examples.
  3. The dialog has Import and Cancel buttons.
  4. Import is disabled until an example is selected.
  5. Cancel, Escape, or closing the dialog makes no workspace changes.
  6. Import loads the selected example file and passes it through the existing Dashboard import, codec, validation, dependency-closure, and commit path rather than introducing a second importer.
  7. On success, close the dialog and navigate consistently with the existing Dashboard import flow.
  8. On load, parse, validation, or commit failure, keep the current workspace unchanged and show the existing import diagnostic style.

Existing-Dashboard behaviour

Use the existing Dashboard import replacement/cancellation behaviour when the current workspace already contains a Dashboard. Example import must not silently overwrite or merge it.

Packaging

The manifest and referenced example JSON files must be available in the shipped application, including the production build. The implementation may copy them as build assets or embed them at build time, but the repository files under examples/ remain the maintained source of truth.

Scope

  • Add the File-menu item and modal UI.
  • Add the example manifest and the three initial example files.
  • Reuse the normal Dashboard import pipeline and conflict handling.
  • Validate the manifest and every referenced example in tests/build tooling so a missing, malformed, or stale example cannot ship unnoticed.
  • Keep general URL-based galleries, remote examples, previews/screenshots, categories, search, and example editing out of scope.

Acceptance criteria

  • File → Import example Dashboard… is available from every surface that uses the application-wide File menu.
  • The dialog lists exactly the three manifest entries in manifest order, using their stored full names.
  • One example can be selected; Import is disabled with no selection.
  • Cancel, Escape, and dialog close leave the workspace unchanged.
  • Importing each example succeeds through the existing Dashboard import/validation path.
  • An existing Dashboard is never silently replaced or merged.
  • A missing example file, malformed manifest, malformed example, or validation failure reports an error and leaves the workspace unchanged.
  • The manifest and all three examples are included in the production packaging strategy.
  • Unit tests cover catalogue parsing and selection/import orchestration.
  • E2E coverage opens the File-menu dialog, imports at least one example, and verifies cancellation makes no change.
  • CHANGELOG.md and relevant Dashboard/import documentation are updated.

Related: #280, #447.

Metadata

Metadata

Assignees

No one assigned

    Labels

    inboxFiled mid-task; not yet triaged into the roadmap

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions