refactor: improve tool configuration prompts for clarity
- Updated the display format of tool descriptions in the configuration prompts to enhance readability. - Simplified the messaging for enabled tool counts, removing unnecessary color formatting for a cleaner output. - Streamlined the exit message for the configuration process, improving user experience during tool setup.
This commit is contained in:
parent
b103bb4c8b
commit
d802db4de0
1 changed files with 4 additions and 6 deletions
|
|
@ -142,7 +142,7 @@ def _prompt_toolset_checklist(platform_label: str, enabled: Set[str]) -> Set[str
|
||||||
|
|
||||||
labels = []
|
labels = []
|
||||||
for ts_key, ts_label, ts_desc in CONFIGURABLE_TOOLSETS:
|
for ts_key, ts_label, ts_desc in CONFIGURABLE_TOOLSETS:
|
||||||
labels.append(f"{ts_label} {color(ts_desc, Colors.DIM)}")
|
labels.append(f"{ts_label} ({ts_desc})")
|
||||||
|
|
||||||
pre_selected_indices = [
|
pre_selected_indices = [
|
||||||
i for i, (ts_key, _, _) in enumerate(CONFIGURABLE_TOOLSETS)
|
i for i, (ts_key, _, _) in enumerate(CONFIGURABLE_TOOLSETS)
|
||||||
|
|
@ -227,11 +227,10 @@ def tools_command(args):
|
||||||
current = _get_platform_tools(config, pkey)
|
current = _get_platform_tools(config, pkey)
|
||||||
count = len(current)
|
count = len(current)
|
||||||
total = len(CONFIGURABLE_TOOLSETS)
|
total = len(CONFIGURABLE_TOOLSETS)
|
||||||
count_str = color(f"({count}/{total} enabled)", Colors.DIM)
|
platform_choices.append(f"Configure {pinfo['label']} ({count}/{total} enabled)")
|
||||||
platform_choices.append(f"Configure {pinfo['label']} {count_str}")
|
|
||||||
platform_keys.append(pkey)
|
platform_keys.append(pkey)
|
||||||
|
|
||||||
platform_choices.append(f"{color('Done — save and exit', Colors.GREEN)}")
|
platform_choices.append("Done — save and exit")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
idx = _prompt_choice("Select a platform to configure:", platform_choices, default=0)
|
idx = _prompt_choice("Select a platform to configure:", platform_choices, default=0)
|
||||||
|
|
@ -273,8 +272,7 @@ def tools_command(args):
|
||||||
# Update the choice label with new count
|
# Update the choice label with new count
|
||||||
new_count = len(_get_platform_tools(config, pkey))
|
new_count = len(_get_platform_tools(config, pkey))
|
||||||
total = len(CONFIGURABLE_TOOLSETS)
|
total = len(CONFIGURABLE_TOOLSETS)
|
||||||
count_str = color(f"({new_count}/{total} enabled)", Colors.DIM)
|
platform_choices[idx] = f"Configure {pinfo['label']} ({new_count}/{total} enabled)"
|
||||||
platform_choices[idx] = f"Configure {pinfo['label']} {count_str}"
|
|
||||||
|
|
||||||
print()
|
print()
|
||||||
print(color(" Tool configuration saved to ~/.hermes/config.yaml", Colors.DIM))
|
print(color(" Tool configuration saved to ~/.hermes/config.yaml", Colors.DIM))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue