Skip to content

Conversation

@kpatl1
Copy link
Collaborator

@kpatl1 kpatl1 commented Oct 14, 2025

Summary:
added a confirmation dialog that shows which cell's output will be saved and instructs users to click on the desired cell first before using "Save Output"

Testing:
Created new Sasnb file and tried to save output from two different cells.
TODOs:

  • Add any supporting documentation and (optionally) update CHANGELOG.md

Fixes #1648

@kpatl1 kpatl1 requested a review from scnwwu October 14, 2025 19:02
Signed-off-by: Kishan Patel <kpatel7927@gmail.com>
DCO Remediation Commit for Kishan Patel <kpatel7927@gmail.com>

I, Kishan Patel <kpatel7927@gmail.com>, hereby add my Signed-off-by to this commit: 9e382a1

Signed-off-by: Kishan Patel <kpatel7927@gmail.com>
@kpatl1 kpatl1 marked this pull request as ready for review October 15, 2025 18:39
@kpatl1 kpatl1 changed the title fix(exporters): added confimation dialog to show which cell output wi… fix(exporters): added save output button on rendered output Oct 15, 2025
@scnwwu
Copy link
Contributor

scnwwu commented Oct 16, 2025

I can see that the button is easier for an end user to find and simply click than a context menu.
However when the content is wide it may be covered by the button. For example you can try below
image
When I scroll the horizontal scrollbar, the button moves with the content thus covers the same content.
An alternative might be to make it like the toolbar on the code cell, like give it a negative top.
image
Maybe make it an icon and same style like the toolbar on the code cell. (And only display when focus it?)
Or maybe context menu is still good, to avoid visual clutter. (When you run ordinary .sas files, the save option is in the context menu on the result panel.)
https://github.com/sassoftware/vscode-sas-extension/blob/main/package.json#L902

…on hover

Signed-off-by: Kishan Patel <kpatel7927@gmail.com>
@kpatl1
Copy link
Collaborator Author

kpatl1 commented Oct 16, 2025

I have gone in and added the suggestion with the on hover toolbar similar to the code cells. I believe this may be the most intuitive because it shares similar functionality as the other cells in the notebook. Let me know what you think!

@scnwwu
Copy link
Contributor

scnwwu commented Oct 20, 2025

I tried it and it still covers the content.
image
I know it only appears on hover but some users may feel annoying. The code cell toolbar flows beyond the top border of the cell which will not cover any content. Are you able to make it to the similar position? (I guess a negative top style).

And, where is the icon from? To me, it doesn't look like the save/export or related icon we are familiar with.

Signed-off-by: Kishan Patel <kpatel7927@gmail.com>
@kpatl1
Copy link
Collaborator Author

kpatl1 commented Oct 22, 2025

I tried it and it still covers the content. image I know it only appears on hover but some users may feel annoying. The code cell toolbar flows beyond the top border of the cell which will not cover any content. Are you able to make it to the similar position? (I guess a negative top style).

And, where is the icon from? To me, it doesn't look like the save/export or related icon we are familiar with.

I added in a negative top, let me know what you think. I was also thinking of maybe adding it to the code cell toolbar instead what are your thoughts on that? I have also adjusted the icon to get one from the VSCode library.

@scnwwu
Copy link
Contributor

scnwwu commented Oct 22, 2025

It looks good in HTML output but not Log output. It's covered by code cell above.
image

Regarding code cell toolbar, I think directly in output cell (your current approach) is better.

Signed-off-by: Kishan Patel <kpatel7927@gmail.com>
@kpatl1
Copy link
Collaborator Author

kpatl1 commented Oct 22, 2025

Gotcha, I have gone and fixed the log output negative top as well.

@scnwwu
Copy link
Contributor

scnwwu commented Oct 28, 2025

When content is wide, the button still scrolls with the content.
image
Are you able to make it stick on the right?

if (!cell) {
return;
}
let timesOutputSaved = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like this one is global. So if I just save another notebook, the notebook name is different but the count simply added which may look weird.
In my opinion it's not necessary to manage a count. If a name duplicated, system will prompt the user to change a name, right?

// SPDX-License-Identifier: Apache-2.0
import type { ActivationFunction } from "vscode-notebook-renderer";

let outputIndex = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like this one is global. So if I switch between multiple notebooks the output index will be wrong?

`;

const saveButton = document.createElement("button");
saveButton.title = "Save Output";
Copy link
Contributor

Choose a reason for hiding this comment

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

i18n?

container.style.position = "relative";

if (context.postMessage) {
const toolbar = document.createElement("div");
Copy link
Contributor

Choose a reason for hiding this comment

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

are you able to re-use some code with HTMLRenderer?

@scnwwu
Copy link
Contributor

scnwwu commented Oct 28, 2025

For keyboard accessibility, when I keyboard focus on the button, the button should be visible.

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.

[SAS Notebook] Save Output action against code cell using right mouse click does not change focus to cell on which action was invoked

3 participants