racket / drracket

DrRacket, IDE for Racket
http://www.racket-lang.org/
Other
445 stars 93 forks source link

"Install .plt File" dialog allows and hides multiline input #540

Open ccshan opened 2 years ago

ccshan commented 2 years ago

Today I copied this URL to my clipboard, including a trailing newline: http://www.cs.indiana.edu/classes/c211/c211-handin.plt Then I chose "File" -> "Install .plt File" and pasted into the "Web" tab. The "URL:" text box remained empty, which was confusing. I tried pasting a few more times before giving up and typing the URL by hand. I got the following mysterious error, which has been reported by my students before:

There was an error when checking the validity of the downloaded .plt file. Please check the url and try again.

not an unpackable distribution archive

gnu-unzip: bad header

By hitting cursor keys while focused on the "URL:" text box, I discovered that the problem is the text box allows multiple lines but is only tall enough to show one line. I think the right behavior is to allow only one line, trim surrounding whitespace, and turn internal whitespace into space. The same issue seems to afflict the "File" tab as well.

jbclements commented 2 years ago

Many thanks for linking these. I think the easy fix is just to signal an error when the values are extracted from the GUI. It would be great if there was a nice way to specify that a box could contain only a single line of text (whatever that means) or a visual cue that there were multiple lines in the box, that would be even nicer. Not volunteering though, sigh.