Shared formatting helpers for rendering nested data structures in text-based views.
Used by ClusterTab, HealthTab, StatsTab, and RateLimitsTab to consistently format maps, lists, and primitive values with indentation.
Summary
Functions
Formats a nested data structure into a list of indented string lines.
Formats a primitive value for display, with number abbreviations.
Functions
@spec format_nested(term(), non_neg_integer()) :: [String.t()]
Formats a nested data structure into a list of indented string lines.
Examples
iex> PhoenixGenApiTui.Views.FormatHelpers.format_nested(%{a: 1, b: [2, 3]})
[" :a:", " 1", " :b:", " - 2", " - 3"]
Formats a primitive value for display, with number abbreviations.