|
|
@@ -228,18 +228,17 @@ class DisplayManager:
|
|
|
console.print(table)
|
|
|
|
|
|
def display_template_details(
|
|
|
- self, template: Template, template_id: str, show_all: bool = False
|
|
|
+ self, template: Template, template_id: str
|
|
|
) -> None:
|
|
|
"""Display template information panel and variables table.
|
|
|
|
|
|
Args:
|
|
|
template: Template instance to display
|
|
|
template_id: ID of the template
|
|
|
- show_all: If True, show all variables/sections regardless of needs satisfaction
|
|
|
"""
|
|
|
self._display_template_header(template, template_id)
|
|
|
self._display_file_tree(template)
|
|
|
- self._display_variables_table(template, show_all=show_all)
|
|
|
+ self._display_variables_table(template)
|
|
|
|
|
|
def display_section_header(self, title: str, description: str | None) -> None:
|
|
|
"""Display a section header."""
|
|
|
@@ -455,13 +454,15 @@ class DisplayManager:
|
|
|
console.print(file_tree)
|
|
|
|
|
|
def _display_variables_table(
|
|
|
- self, template: Template, show_all: bool = False
|
|
|
+ self, template: Template
|
|
|
) -> None:
|
|
|
"""Display a table of variables for a template.
|
|
|
|
|
|
+ All variables and sections are always shown. Disabled sections/variables
|
|
|
+ are displayed with dimmed styling.
|
|
|
+
|
|
|
Args:
|
|
|
template: Template instance
|
|
|
- show_all: If True, show all variables/sections regardless of needs satisfaction
|
|
|
"""
|
|
|
if not (template.variables and template.variables.has_sections()):
|
|
|
return
|
|
|
@@ -480,12 +481,6 @@ class DisplayManager:
|
|
|
if not section.variables:
|
|
|
continue
|
|
|
|
|
|
- # Skip sections with unsatisfied needs unless show_all is True
|
|
|
- if not show_all and not template.variables.is_section_satisfied(
|
|
|
- section.key
|
|
|
- ):
|
|
|
- continue
|
|
|
-
|
|
|
if not first_section:
|
|
|
variables_table.add_row("", "", "", "", style="bright_black")
|
|
|
first_section = False
|
|
|
@@ -526,17 +521,23 @@ class DisplayManager:
|
|
|
# Check if variable's needs are satisfied
|
|
|
var_satisfied = template.variables.is_variable_satisfied(var_name)
|
|
|
|
|
|
- # Skip variables with unsatisfied needs unless show_all is True
|
|
|
- if not show_all and not var_satisfied:
|
|
|
- continue
|
|
|
-
|
|
|
# Dim the variable if section is dimmed OR variable needs are not satisfied
|
|
|
row_style = "bright_black" if (is_dimmed or not var_satisfied) else None
|
|
|
|
|
|
# Build default value display
|
|
|
+ # Special case: disabled bool variables show as "original → False"
|
|
|
+ if (is_dimmed or not var_satisfied) and variable.type == "bool":
|
|
|
+ # Show that disabled bool variables are forced to False
|
|
|
+ if hasattr(variable, "_original_disabled") and variable._original_disabled is not False:
|
|
|
+ orig_val = str(variable._original_disabled)
|
|
|
+ default_val = f"{orig_val} {IconManager.arrow_right()} False"
|
|
|
+ else:
|
|
|
+ default_val = "False"
|
|
|
# If origin is 'config' and original value differs from current, show: original → config_value
|
|
|
- if (
|
|
|
- variable.origin == "config"
|
|
|
+ # BUT only for enabled variables (don't show arrow for disabled ones)
|
|
|
+ elif (
|
|
|
+ not (is_dimmed or not var_satisfied)
|
|
|
+ and variable.origin == "config"
|
|
|
and hasattr(variable, "_original_stored")
|
|
|
and variable.original_value != variable.value
|
|
|
):
|