#175 — Preventing losing chat history on cloning widget

Repo: Twill-AI/twill-ai-ui State: closed | Status: done Assignee: Unassigned

Created: 2024-12-16 · Updated: 2025-03-24

Description

Update how tickets are cloned into a dashboard so that the history of the widget is not lost during the process.

To to this, the payload of the PATCH /dashboards/{id} endpoint has changed as follows:

  ...
  widgets: null | [ // The whole layout here or null to don't edit.
    {
      clone_widget_id: int, // Widget to clone into dashboard or ID of widget already owned by dashboard.
      dashboard_position: str, // String representation of size/coordinates/etc.
      updates_widget_id: int | null // If provided it contains ID of widget which we are replacing with `clone_widget_id`.
    },
    ...
  ],

Basically, the new updates_widget_id field represents the dashboard widget which we want to replace with the cloned widget.

Steps to reproduce

  1. Create a plot and add it to a dashboard
  2. Click on the plot title on the dashboard to get to the widget chat page
  3. Start a conversation and ask for a modification of the plot (for example turn it into a bar chart if it is a line chart)
  4. Save the changes and go back to the dashboard
  5. Open de widget again

AC:

  • After cloning a widget into a dashboard, the new dashboard widget has the source widget’s chat history.

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets