Skip to content

Commit

Permalink
Add saving to plots in editor tabs (#5801)
Browse files Browse the repository at this point in the history
  • Loading branch information
timtmok authored Jan 7, 2025
1 parent b3a1552 commit d1d5f31
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { ZoomPlotMenuButton } from './zoomPlotMenuButton.js';
import { PlotClientInstance } from '../../../../services/languageRuntime/common/languageRuntimePlotClient.js';
import { StaticPlotClient } from '../../../../services/positronPlots/common/staticPlotClient.js';
import { INotificationService } from '../../../../../platform/notification/common/notification.js';
import { CopyPlotTarget, PlotsClearAction, PlotsCopyAction, PlotsNextAction, PlotsPopoutAction, PlotsPreviousAction, PlotsSaveAction } from '../positronPlotsActions.js';
import { PlotActionTarget, PlotsClearAction, PlotsCopyAction, PlotsNextAction, PlotsPopoutAction, PlotsPreviousAction, PlotsSaveAction } from '../positronPlotsActions.js';
import { IHoverService } from '../../../../../platform/hover/browser/hover.js';
import { HtmlPlotClient } from '../htmlPlotClient.js';
import { POSITRON_EDITOR_PLOTS, positronPlotsEditorEnabled } from '../../../positronPlotsEditor/browser/positronPlotsEditor.contribution.js';
Expand Down Expand Up @@ -132,11 +132,11 @@ export const ActionBars = (props: PropsWithChildren<ActionBarsProps>) => {
props.zoomHandler(zoomLevel);
};
const savePlotHandler = () => {
props.commandService.executeCommand(PlotsSaveAction.ID);
props.commandService.executeCommand(PlotsSaveAction.ID, PlotActionTarget.VIEW);
};

const copyPlotHandler = () => {
props.commandService.executeCommand(PlotsCopyAction.ID, CopyPlotTarget.VIEW);
props.commandService.executeCommand(PlotsCopyAction.ID, PlotActionTarget.VIEW);
};

const popoutPlotHandler = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { IPositronPlotsService, POSITRON_PLOTS_VIEW_ID } from '../../../services
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from '../../../common/contributions.js';
import { Extensions as ViewContainerExtensions, IViewsRegistry } from '../../../common/views.js';
import { registerAction2 } from '../../../../platform/actions/common/actions.js';
import { PlotsActiveEditorCopyAction, PlotsClearAction, PlotsCopyAction, PlotsEditorAction, PlotsNextAction, PlotsPopoutAction, PlotsPreviousAction, PlotsRefreshAction, PlotsSaveAction } from './positronPlotsActions.js';
import { PlotsActiveEditorCopyAction, PlotsActiveEditorSaveAction, PlotsClearAction, PlotsCopyAction, PlotsEditorAction, PlotsNextAction, PlotsPopoutAction, PlotsPreviousAction, PlotsRefreshAction, PlotsSaveAction } from './positronPlotsActions.js';
import { POSITRON_SESSION_CONTAINER } from '../../positronSession/browser/positronSessionContainer.js';

// Register the Positron plots service.
Expand Down Expand Up @@ -71,6 +71,7 @@ class PositronPlotsContribution extends Disposable implements IWorkbenchContribu
registerAction2(PlotsPopoutAction);
registerAction2(PlotsEditorAction);
registerAction2(PlotsActiveEditorCopyAction);
registerAction2(PlotsActiveEditorSaveAction);
}
}

Expand Down
Loading

0 comments on commit d1d5f31

Please sign in to comment.