Skip to content

feat(dashboard): add duplicate widget option#1503

Open
okxint wants to merge 2 commits intolmnr-ai:devfrom
okxint:feat/duplicate-dashboard-widget
Open

feat(dashboard): add duplicate widget option#1503
okxint wants to merge 2 commits intolmnr-ai:devfrom
okxint:feat/duplicate-dashboard-widget

Conversation

@okxint
Copy link
Copy Markdown

@okxint okxint commented Mar 25, 2026

Summary

  • Adds a Duplicate option to the chart dropdown menu (between Edit and Delete)
  • Uses the existing POST /api/projects/:projectId/dashboard-charts endpoint to create a copy with the same query, config, and a " (copy)" suffix on the name
  • New chart is placed at the default layout position (0,0) and existing charts are repositioned automatically by the backend

Changes

  • chart-header.tsx: Accept full chart prop instead of just name/id, add Copy icon import, add handleDuplicateChart callback and "Duplicate" menu item
  • chart.tsx: Pass chart object to ChartHeader

Closes #1498


Note

Low Risk
Low risk UI change that adds a new dashboard action calling an existing create-chart endpoint; main risk is cache consistency/optimistic update behavior and handling of API failures.

Overview
Adds a Duplicate action to the dashboard chart header menu, creating a new chart via POST /api/projects/:projectId/dashboard-charts with the same query and settings.config and a " (copy)" name suffix, and updating the SWR cache (with revalidation) plus error toast on failure.

Refactors ChartHeader to accept the full chart object (instead of id/name) and updates chart.tsx to pass that object through.

Written by Cursor Bugbot for commit 47fe02b. This will update automatically on new commits. Configure here.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 25, 2026

CLA assistant check
All committers have signed the CLA.

@dinmukhamedm
Copy link
Copy Markdown
Member

@okxint thanks for your contribution! Please do the following:

  • pull the dev branch from upstream and start your branch from there (cleaner commit history)
  • sign the CLA
  • add a scheenshot of your changes

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

okxint added 2 commits March 29, 2026 17:22
Adds a "Duplicate" option to the chart dropdown menu between "Edit" and
"Delete". Clicking it creates a new chart with the same query, config,
and a " (copy)" suffix on the name. The new chart is placed at the
default position and the dashboard revalidates via SWR.

Closes lmnr-ai#1498
@okxint okxint force-pushed the feat/duplicate-dashboard-widget branch from 31814ca to 47fe02b Compare March 29, 2026 11:54
@okxint
Copy link
Copy Markdown
Author

okxint commented Mar 29, 2026

Rebased onto the latest dev branch — commit history is now clean with just the 2 feature commits on top.

CLA is signed.

Will add a screenshot of the duplicate option in the dropdown menu shortly.

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.

3 participants