mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-25 06:42:52 +08:00
The openshell-tui UI module had two private draw_text_field functions with near-identical logic in create_sandbox.rs and create_provider.rs (differing only in cursor glyph and whether a gap row is shown), and four confirm-dialog rendering blocks duplicated across global_settings.rs and sandbox_settings.rs. Extract both patterns into module-level helpers in ui/mod.rs: - draw_text_field: accepts cursor (&str) and show_gap (bool) to cover both callers; create_sandbox uses '█'/true, create_provider uses '_'/false. - draw_confirm_popup: takes the already-built lines vec, a border style, a width, and the enclosing area, and owns the Clear + Block + Paragraph rendering that was duplicated in all four confirm functions. Remove the now-redundant imports (Clear, Paragraph) from the settings files and drop the local use super::centered_popup as centered_rect aliases that are no longer needed. Signed-off-by: Eric Curtin <eric.curtin@docker.com>