dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.91k stars 389 forks source link

Issues with input prompt docs #3364

Open KathleenDollard opened 11 months ago

KathleenDollard commented 11 months ago

Describe the bug

In this section, I had issues. Not sure whether I am doing it wrong or there is a bug:

image

Please complete the following:

Which version of .NET Interactive are you using? Version: 1.0.460101+f1a6f50a1171b8a13119a20811674d5079e2f61b

Library version: 1.0.0-beta.23601.1+f1a6f50a1171b8a13119a20811674d5079e2f61b

Build date: 2023-12-02T22:15:47.3640630Z

KathleenDollard commented 11 months ago

When I did this from code, I got the file dialog. The error still seems unkind on a simple cancel:

image

marckruzik commented 11 months ago

I am using an older version (Version: 1.0.456201+e5dc02dbdc933d895d722e69bfa98d580dcda8d9), which seems to work better. I describe what I am getting.

With this code (from KathleenDollard):

#!value --from-file @input:"Enter your favorite file" --name xFile

I have the notebook input prompt for text, with the sentence Please enter a value for field "Enter your favorite file". Then I have to type the name of a file from the current directory. It works and I can see the content of the file in the Variables tab.

With this code:

#!value --from-file @input:xxx --name xFile2

I have a Windows Explorer input dialog file. I can select a file. It works and I can see the content of the file in the Variables tab.

In the second example, I don't know if this "xxx" I put has an effect, but if I remove it, it doesn't work.

@jonsequitur says he is working on the subject of @input in the related issue #3359.

jonsequitur commented 11 months ago

@marckruzik, the issue with quotes versus non-quoted prompts should be fixed now.

@KathleenDollard, the #!value magic sends the value to the value kernel, so the xFile trailing expression would require first sharing the variable from the value kernel to the csharp kernel.

image