From 14218c5f65b272a3ee0ea302234186603cf61305 Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Sun, 13 Oct 2024 18:49:56 -0700 Subject: [PATCH] Legend for colorization in F1 dialog --- src/swarm-tui/Swarm/TUI/View.hs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/swarm-tui/Swarm/TUI/View.hs b/src/swarm-tui/Swarm/TUI/View.hs index bb6372dc3..3f4ff954d 100644 --- a/src/swarm-tui/Swarm/TUI/View.hs +++ b/src/swarm-tui/Swarm/TUI/View.hs @@ -646,7 +646,13 @@ drawModal s = \case helpWidget :: Seed -> Maybe Port -> KeyEventHandlingState -> Widget Name helpWidget theSeed mport keyState = - padLeftRight 2 . vBox $ padTop (Pad 1) <$> [info, helpKeys, tips] + padLeftRight 2 . vBox $ + padTop (Pad 1) + <$> [ info + , colorizationLegend + , helpKeys + , tips + ] where tips = vBox @@ -660,6 +666,12 @@ helpWidget theSeed mport keyState = , txt ("Seed: " <> into @Text (show theSeed)) , txt ("Web server port: " <> maybe "none" (into @Text . show) mport) ] + colorizationLegend = + vBox + [ heading boldAttr "Colorization legend" + , drawMarkdown + "In text, snippets of code like `3 + 4` or `scan down` will be colorized. Types like `Cmd Text`{=type} have a dedicated color. The names of an `entity`{=entity}, a `structure`{=structure}, and a `tag`{=tag} also each have their own color." + ] helpKeys = vBox [ heading boldAttr "Keybindings"