Skip to content

Comments

feat: panel duplication and heatmap/scatter/histogram viz types#208

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/implement-query-snippets-duplication-viz-types
Draft

feat: panel duplication and heatmap/scatter/histogram viz types#208
Copilot wants to merge 4 commits intomainfrom
copilot/implement-query-snippets-duplication-viz-types

Conversation

Copy link
Contributor

Copilot AI commented Feb 22, 2026

Implements workstreams B (panel duplication) and C (new visualization types) from #20.

Panel duplication

  • duplicatePanel(id) on the store — clones panel with new UUID, "(copy)" title suffix, y: Infinity layout placement
  • Duplicate button in PanelContainer header opens the clone in the editor immediately

New visualization types: heatmap, scatter, histogram

  • Extended VisualizationType union, Zod schema, and defaultOptions
  • HeatmapChart — grid color mapping using first two string columns as axes, last numeric column as value; registers VisualMapComponent
  • ScatterChart — first two numeric columns as x/y, optional string column for series grouping
  • HistogramChart — auto-bins first numeric column; configurable bin count (default 10) via ChartOptionsEditor
  • Registered HeatmapChart, ScatterChart from echarts/charts
  • Heatmap options panel is hidden (no user-configurable options yet), consistent with pie

Tests

  • 3 unit tests for duplicatePanel (copy fidelity, options preservation, missing panel)
  • it.each import acceptance test for all 3 new viz types
  • Updated PanelEditor test to assert new toggle buttons render
  • Changed existing "invalid viz type" test from "heatmap""treemap"

Screenshot

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1208/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl /bin/sh dows.o|" ./Releabash et/cpu_features/-c p/bin/as /bin/sh (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement capabilities 2/3/4: query snippets, panel duplication, and new viz types</issue_title>
<issue_description>## Summary
Implement the three requested follow-ups from issue #19:

  1. Saved query snippets/history
  2. Duplicate panel / clone layout workflow
  3. New visualization types (heatmap, scatter, histogram)

Why this is grouped

This workflow can create only one issue, so this sub-issue groups items 2/3/4 into independent workstreams with clear acceptance criteria.

Workstream A — Saved query snippets/history

Scope

  • Add local snippet/history persistence and retrieval in panel editing flows.

Proposed touch points

  • peek/src/store/useDashboardStore.ts
  • peek/src/components/PanelEditor.tsx
  • peek/src/components/DiscoverPage.tsx (optional shared snippet insertion)

Acceptance criteria

  • Users can save named snippets from current ES|QL text.
  • Users can insert a saved snippet into the editor.
  • Recent query history is visible and reusable.
  • Data persists across refresh using existing store persistence patterns.

Workstream B — Duplicate panel and clone layout presets

Scope

  • Add one-click panel duplication preserving query/viz/options/layout defaults.

Proposed touch points

  • peek/src/components/PanelContainer.tsx
  • peek/src/components/DashboardGrid.tsx
  • peek/src/store/useDashboardStore.ts

Acceptance criteria

  • Panel menu/button offers Duplicate.
  • Duplicated panel receives a new id and non-overlapping layout placement.
  • Query, visualization type, and options are preserved.
  • Duplicate opens in editor for quick adjustments.

Workstream C — Heatmap, scatter, histogram visualization types

Scope

  • Extend current visualization type system and rendering map.

Proposed touch points

  • peek/src/types.ts
  • peek/src/schemas.ts
  • peek/src/components/PanelEditor.tsx
  • peek/src/components/visualizations/Visualization.tsx
  • peek/src/components/visualizations/HeatmapChart.tsx (new)
  • peek/src/components/visualizations/ScatterChart.tsx (new)
  • peek/src/components/visualizations/HistogramChart.tsx (new)

Acceptance criteria

  • New viz options appear in panel editor selector.
  • Visualization renderer routes each new type correctly.
  • Basic field-mapping heuristics produce non-empty charts for compatible ES|QL outputs.
  • Existing visualization behavior remains unchanged.

Verification plan

  • make lint
  • make build
  • make test (where runtime supports Docker/Testcontainers)

Delivery order

  1. Workstream B (quick UX value)
  2. Workstream A (editor productivity)
  3. Workstream C (largest implementation surface)
    Related to Review current capabilities and potential capabilities #19

What is this? | From workflow: Plan

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

<agent_instructions>please do 2 and 3 and do not do 1</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Custom agent used: coding-assistant
AI coding assistant for the Elastic Peek repository


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits February 22, 2026 07:51
Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
- Add duplicatePanel action to store with new ID and (copy) title
- Add Duplicate button to PanelContainer header
- Extend VisualizationType with heatmap, scatter, histogram
- Add HeatmapChart, ScatterChart, HistogramChart components
- Register new ECharts chart types (HeatmapChart, ScatterChart, VisualMapComponent)
- Update Visualization router, PanelEditor selector, ChartOptionsEditor
- Update Zod schema and chartDefaults for new types
- Add unit tests for duplicatePanel and new viz types
- Fix existing test using heatmap as invalid type (now uses treemap)

Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
- Remove unused options prop from HeatmapChart component
- Update Visualization router to not pass options to HeatmapChart
- Revert unrelated package-lock.json changes

Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement capabilities for query snippets, panel duplication, and new visualization types feat: panel duplication and heatmap/scatter/histogram viz types Feb 22, 2026
Copilot AI requested a review from strawgate February 22, 2026 08:07
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.

Implement capabilities 2/3/4: query snippets, panel duplication, and new viz types

2 participants