google / google/codeworld

Better formatting for the Inspect dialog

Offen
#725 4 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
Haskell
Sterne
1.3k
Forks
201
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, den Inspect-Dialog zu finden und zu prüfen, wie seine Eigenschaften derzeit dargestellt werden. Das Issue schlägt eine modusabhängige Quellformatierung, kontextbezogene Tooltips, Ellipsierung auf Argumentebene und typspezifische Darstellungen für Farben und Punkte vor; für den Abschluss müsste man sich auf die gewünschte Teilmenge einigen und diese implementieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
haskell
Bereich
design, frontend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.