style: format UI files and remove lint excludes
- Remove app/components/ and app/pages/ from ruff/black excludes - Pre-commit reformatted multi-line strings for consistency - All files now follow the same code style
This commit is contained in:
@@ -119,10 +119,12 @@ def _render_event_comparison_page(workspace_id: str | None = None) -> None:
|
||||
ui.label(
|
||||
"Changing the preset resets strategy templates to that preset's default comparison set."
|
||||
).classes("text-xs text-slate-500 dark:text-slate-400")
|
||||
ui.label(
|
||||
"Underlying units will be calculated from initial value ÷ entry spot."
|
||||
).classes("text-xs text-slate-500 dark:text-slate-400")
|
||||
initial_value_input = ui.number("Initial portfolio value ($)", value=default_units * default_entry_spot, min=0.01, step=1000).classes("w-full")
|
||||
ui.label("Underlying units will be calculated from initial value ÷ entry spot.").classes(
|
||||
"text-xs text-slate-500 dark:text-slate-400"
|
||||
)
|
||||
initial_value_input = ui.number(
|
||||
"Initial portfolio value ($)", value=default_units * default_entry_spot, min=0.01, step=1000
|
||||
).classes("w-full")
|
||||
loan_input = ui.number("Loan amount", value=default_loan, min=0, step=1000).classes("w-full")
|
||||
ltv_input = ui.number(
|
||||
"Margin call LTV",
|
||||
@@ -183,7 +185,11 @@ def _render_event_comparison_page(workspace_id: str | None = None) -> None:
|
||||
# Show validation errors (units_error takes priority, then entry_spot_error)
|
||||
display_error = units_error or entry_spot_error
|
||||
if display_error:
|
||||
tone_class = "text-rose-600 dark:text-rose-300" if "must be positive" in display_error else "text-amber-700 dark:text-amber-300"
|
||||
tone_class = (
|
||||
"text-rose-600 dark:text-rose-300"
|
||||
if "must be positive" in display_error
|
||||
else "text-amber-700 dark:text-amber-300"
|
||||
)
|
||||
ui.label(display_error).classes(f"text-sm {tone_class}")
|
||||
|
||||
def render_result_state(title: str, message: str, *, tone: str = "info") -> None:
|
||||
@@ -243,7 +249,7 @@ def _render_event_comparison_page(workspace_id: str | None = None) -> None:
|
||||
scenario_label.set_text(units_error)
|
||||
render_selected_summary(entry_spot=preview_entry_spot, entry_spot_error=units_error)
|
||||
return units_error
|
||||
|
||||
|
||||
if workspace_id and config is not None and reseed_units:
|
||||
# Recalculate from workspace config
|
||||
workspace_units = asset_quantity_from_workspace_config(
|
||||
@@ -322,7 +328,7 @@ def _render_event_comparison_page(workspace_id: str | None = None) -> None:
|
||||
validation_label.set_text(units_error)
|
||||
render_result_state("Input validation failed", units_error, tone="warning")
|
||||
return
|
||||
|
||||
|
||||
report = service.run_read_only_comparison(
|
||||
preset_slug=str(preset_select.value or ""),
|
||||
template_slugs=template_slugs,
|
||||
|
||||
Reference in New Issue
Block a user