Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legend for colorization in F1 dialog #2175

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/swarm-tui/Swarm/TUI/View.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down