From b11c479f22abe2ef12fff3e96e617ee5dbb468af Mon Sep 17 00:00:00 2001 From: Chapman Pendery Date: Sun, 8 Oct 2023 00:48:18 -0700 Subject: [PATCH] fix: add icons to ui/ fix short icons Signed-off-by: Chapman Pendery --- src/runtime/suggestion.ts | 2 +- .../__snapshots__/runtime.test.ts.snap | 62 +++++++++---------- src/ui/suggestions.tsx | 2 +- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/runtime/suggestion.ts b/src/runtime/suggestion.ts index 26eec85..7b4321e 100644 --- a/src/runtime/suggestion.ts +++ b/src/runtime/suggestion.ts @@ -7,7 +7,7 @@ enum SuggestionIcons { File = "📄", Folder = "📁", Subcommand = "📦", - Option = "⚙️", + Option = "🔗", Argument = "💲", Mixin = "🏝️", Shortcut = "🔥", diff --git a/src/tests/runtime/__snapshots__/runtime.test.ts.snap b/src/tests/runtime/__snapshots__/runtime.test.ts.snap index 5bd5123..17214a6 100644 --- a/src/tests/runtime/__snapshots__/runtime.test.ts.snap +++ b/src/tests/runtime/__snapshots__/runtime.test.ts.snap @@ -9,7 +9,7 @@ exports[`parseCommand alreadyUsedOption 1`] = ` "--bug-report", ], "description": "Display system information for bug report", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--bug-report", "priority": 50, @@ -85,7 +85,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--artifact-server-path", ], "description": "Defines the path where the artifact server stores uploads and retrieves downloads from. If not specified the artifact server will not start", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--artifact-server-path", "priority": 50, @@ -95,7 +95,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--artifact-server-port", ], "description": "Defines the port where the artifact server listens (will only bind to localhost)", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--artifact-server-port", "priority": 50, @@ -105,7 +105,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--container-architecture", ], "description": "Architecture which should be used to run containers, e.g.: linux/amd64. If not specified, will use host default architecture. Requires Docker server API Version 1.41+. Ignored on earlier Docker server platforms", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--container-architecture", "priority": 50, @@ -115,7 +115,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--container-daemon-socket", ], "description": "Path to Docker daemon socket which will be mounted to containers", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--container-daemon-socket", "priority": 50, @@ -126,7 +126,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "-C", ], "description": "Working directory", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--directory", "priority": 50, @@ -137,7 +137,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "-n", ], "description": "Dryrun mode", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--dryrun", "priority": 50, @@ -147,7 +147,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--env-file", ], "description": "Environment file to read and use as env in the containers", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--env-file", "priority": 50, @@ -157,7 +157,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--github-instance", ], "description": "GitHub instance to use. Don't use this if you are not using GitHub Enterprise Server", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--github-instance", "priority": 50, @@ -167,7 +167,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--insecure-secrets", ], "description": "NOT RECOMMENDED! Doesn't hide secrets while printing logs", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--insecure-secrets", "priority": 50, @@ -177,7 +177,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--json", ], "description": "Output logs in json format", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--json", "priority": 50, @@ -187,7 +187,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--no-recurse", ], "description": "Flag to disable running workflows from subdirectories of specified path in '--workflows'/'-W' flag", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--no-recurse", "priority": 50, @@ -197,7 +197,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--no-skip-checkout", ], "description": "Do not skip actions/checkout", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--no-skip-checkout", "priority": 50, @@ -208,7 +208,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "-q", ], "description": "Disable logging of output from steps", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--quiet", "priority": 50, @@ -218,7 +218,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--secret-file", ], "description": "File with list of secrets to read from (e.g. --secret-file .secrets)", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--secret-file", "priority": 50, @@ -229,7 +229,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "-v", ], "description": "Verbose output", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--verbose", "priority": 50, @@ -240,7 +240,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "-W", ], "description": "Path to workflow file(s)", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--workflows", "priority": 50, @@ -251,7 +251,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "-h", ], "description": "Display help", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--help", "priority": 50, @@ -261,7 +261,7 @@ exports[`parseCommand completedOptionWithArg 1`] = ` "--no-descriptions", ], "description": "Disable completion descriptions", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--no-descriptions", "priority": 50, @@ -286,7 +286,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nobreak", ], "description": "Print a newline between matches in different files. Enabled by default", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nobreak", "priority": 50, @@ -296,7 +296,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nocolor", ], "description": "Don't print color codes in results", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nocolor", "priority": 50, @@ -306,7 +306,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nofilename", ], "description": "Don't print file names", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nofilename", "priority": 50, @@ -316,7 +316,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nofollow", ], "description": "Don't follow symlinks", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nofollow", "priority": 50, @@ -326,7 +326,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nogroup", ], "description": "Refrains from lumping matches in the same file together, and instead places the filename at the start of each match line", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nogroup", "priority": 50, @@ -336,7 +336,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--noheading", ], "description": "Don't print filenames above matching contents", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--noheading", "priority": 50, @@ -346,7 +346,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nommap", ], "description": "Don't use of memory-mapped I/O. Defaults to true on platforms where mmap() is faster than read(). (All but macOS.)", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nommap", "priority": 50, @@ -356,7 +356,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nomultiline", ], "description": "Don't match regexes across newlines", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nomultiline", "priority": 50, @@ -367,7 +367,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--norecurse", ], "description": "Don't recurse into directories", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--norecurse", "priority": 50, @@ -377,7 +377,7 @@ exports[`parseCommand exclusiveOnOption 1`] = ` "--nonumbers", ], "description": "Don't print line numbers", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "--nonumbers", "priority": 50, @@ -395,7 +395,7 @@ exports[`parseCommand fullyTypedSuggestion 1`] = ` "-W", ], "description": "Display whiteouts when scanning directories. (-S) flag)", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "-W", "priority": 50, @@ -405,7 +405,7 @@ exports[`parseCommand fullyTypedSuggestion 1`] = ` "-w", ], "description": "Force raw printing of non-printable characters. This is the default when output is not to a terminal", - "icon": "⚙️", + "icon": "🔗", "insertValue": undefined, "name": "-w", "priority": 50, diff --git a/src/ui/suggestions.tsx b/src/ui/suggestions.tsx index 7f47909..abd7ca3 100644 --- a/src/ui/suggestions.tsx +++ b/src/ui/suggestions.tsx @@ -47,7 +47,7 @@ function SuggestionList({ suggestions, activeSuggestionIdx }: { suggestions: Sug return ( - {suggestion.name.padEnd(SuggestionWidth - BorderWidth, " ")} + {`${suggestion.icon} ${suggestion.name}`.padEnd(SuggestionWidth - BorderWidth, " ")} );