From b7fa5e5b90ac263abf7f18af87df718039aa2ea0 Mon Sep 17 00:00:00 2001 From: Tim Mok Date: Mon, 1 Apr 2024 11:36:57 -0400 Subject: [PATCH] Cleanup --- src/vs/workbench/common/theme.ts | 8 ------ .../modalDialogs/savePlotModalDialog.tsx | 10 +++++-- .../common/positronPlotComm.ts | 28 ------------------- .../positronPlots/common/positronPlots.ts | 2 +- 4 files changed, 8 insertions(+), 40 deletions(-) diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index 9d4ecc78de5b..49bb07e46d07 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -1612,14 +1612,6 @@ export const POSITRON_MODAL_DIALOG_CHECKBOX_BORDER = registerColor('positronModa hcLight: checkboxBorder }, localize('positronModalDialog.checkboxBorder', "Positron modal dialog checkbox border.")); -// Positron modal dialog form border color. -export const POSITRON_MODAL_DIALOG_FORM_BORDER = registerColor('positronModalDialog.formBorder', { - dark: '#292f32', - light: '#a6a6a6', - hcDark: foreground, - hcLight: foreground -}, localize('positronModalDialog.formBorder', "Positron modal dialog form border.")); - // < --- Positron Drop Down --- > shit // Positron drop down border color. diff --git a/src/vs/workbench/contrib/positronPlots/browser/modalDialogs/savePlotModalDialog.tsx b/src/vs/workbench/contrib/positronPlots/browser/modalDialogs/savePlotModalDialog.tsx index 5a8e1a60ab2e..55a3ce88e604 100644 --- a/src/vs/workbench/contrib/positronPlots/browser/modalDialogs/savePlotModalDialog.tsx +++ b/src/vs/workbench/contrib/positronPlots/browser/modalDialogs/savePlotModalDialog.tsx @@ -44,8 +44,12 @@ const browsePlaceholderText = localize('positronSavePlotModalDialogBrowsePlaceho /** * Show the save plot modal dialog for dynamic plots. - * @param props SavePlotModalDialogProps to set the size and the plot client - * @returns The requested size and path to save the plot. + * @param layoutService the layout service for the modal + * @param keybindingService the keybinding service to intercept shortcuts + * @param fileDialogService the file dialog service to prompt where to save the plot + * @param plotClient the dynamic plot client to render previews and the final image + * @param savePlotCallback the action to take when the dialog closes + * @param suggestedPath the pre-filled save path */ export const showSavePlotModalDialog = async ( layoutService: IWorkbenchLayoutService, @@ -238,7 +242,7 @@ const SavePlotModalDialog = (props: SavePlotModalDialogProps) => {
{(uri && - ) + {props.plotClient.metadata.code}) }
diff --git a/src/vs/workbench/services/languageRuntime/common/positronPlotComm.ts b/src/vs/workbench/services/languageRuntime/common/positronPlotComm.ts index 6832733ce586..e263c113b069 100644 --- a/src/vs/workbench/services/languageRuntime/common/positronPlotComm.ts +++ b/src/vs/workbench/services/languageRuntime/common/positronPlotComm.ts @@ -26,17 +26,6 @@ export interface PlotResult { } -/** - * A saved plot's path - */ -export interface SavedPlot { - /** - * The plot path - */ - path: string; - -} - /** * Event: Notification that a plot has been updated on the backend. */ @@ -69,23 +58,6 @@ export class PositronPlotComm extends PositronBaseComm { return super.performRpc('render', ['height', 'width', 'pixel_ratio'], [height, width, pixelRatio]); } - /** - * Save a plot - * - * Requests a plot to be saved to a file. The plot path is returned as a - * string. - * - * @param path The requested plot path - * @param height The requested plot height, in pixels - * @param width The requested plot width, in pixels - * @param dpi The pixel ratio of the display device - * - * @returns A saved plot's path - */ - save(path: string, height: number, width: number, dpi: number): Promise { - return super.performRpc('save', ['path', 'height', 'width', 'dpi'], [path, height, width, dpi]); - } - /** * Notification that a plot has been updated on the backend. diff --git a/src/vs/workbench/services/positronPlots/common/positronPlots.ts b/src/vs/workbench/services/positronPlots/common/positronPlots.ts index 7690ae7bee4b..451c4dce7c7e 100644 --- a/src/vs/workbench/services/positronPlots/common/positronPlots.ts +++ b/src/vs/workbench/services/positronPlots/common/positronPlots.ts @@ -151,7 +151,7 @@ export interface IPositronPlotsService { selectHistoryPolicy(policy: HistoryPolicy): void; /** - * Saves the plot with the specified FileSystemHandle. + * Saves the plot. */ savePlot(): void;