google / google/codeworld

Better formatting for the Inspect dialog

Open
#725 4 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
1.3k
Forks
201
PR merge metrics
No merged PRs in 30d

Description

Unfortunately, @kammitama5 adding properties to the inspect dialog, while useful, made it a bit ugly and harder to read.

Some ideas for cleaning this up:

* **Source formatting.** I'd like to format these more in the form they appear in the program itself. For example, instead of `lettering { text = 'Hashim' }`, I'd want to see `lettering("Hashim")` when in CodeWorld mode, or `lettering "Hashim"` when in Haskell mode. For transformations, we could do something like `translated(..., 4, 7)` (in CodeWorld mode), or `translated 4 7` (in Haskell mode). This means we need to do something mode-dependent here, either by passing in a formatter, or just detecting the mode inside the program.
* **Contextual tool tips.** Unfortunately, the previous idea loses descriptions of the meaning of the arguments. I am afraid this is a fundamental tension - the wordier the result, the less likely it is to be useful at a glance; but the terser, the less likely to be informative. But we can at least add the description in a tool-tip. So when you hover over the `4` above, a tooltip could pop up saying "horizontal = 4".
* **Smarter ellipsization.** Instead of ellipsizing the entire string, we could start by ellipsizing each of the arguments separately. Since this takes less away from the usability, we could be a bit more aggressive at ellipsizing, making the labels shorter (and, therefore, the structure more clear). When arguments are ellipsized, we can still attempt to show more of the argument in the tool-tip.
* **Type specific formatting.** When rendering a color, we should consider rendering it in the same hue and saturation as the color itself (but not lightness, because it must remain readable). In tool tips, we can go even further. The tool tip for a color should show a swatch, as well as the RGBA and HSL values. The tool tip for a point can show the point on a coordinate plane. A list of points should probably have separate tool tips for its member points.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.