on main help sign in
feat(ui): use the new UI behind a feature flag

If the environment variable CRUSH_NEW_UI is set, use the new UI implementation.

commit742b4d3543ed4977e2e9c578bac36cc6bcad509e authorAyman Bagabas <ayman.bagabas@gmail.com> dateTue 20 Jan 2026, 18:36 (9 months ago) parentd334355
1 file changed+13−4
internal/cmd/root.go+13−4
internal/cmd/root.go+13−4
@@ -88,11 +88,20 @@ crush -y
8888
8989 // Set up the TUI.
9090 var env uv.Environ = os.Environ()
91− com := common.DefaultCommon(app)
92− ui := ui.New(com)
93− ui.QueryVersion = shouldQueryTerminalVersion(env)
91+
92+ var model tea.Model
93+ if _, ok := env.LookupEnv("CRUSH_NEW_UI"); ok {
94+ com := common.DefaultCommon(app)
95+ ui := ui.New(com)
96+ ui.QueryVersion = shouldQueryTerminalVersion(env)
97+ model = ui
98+ } else {
99+ ui := tui.New(app)
100+ ui.QueryVersion = shouldQueryTerminalVersion(env)
101+ model = ui
102+ }
94103 program := tea.NewProgram(
95− ui,
104+ model,
96105 tea.WithEnvironment(env),
97106 tea.WithContext(cmd.Context()),
98107 tea.WithFilter(tui.MouseEventFilter)) // Filter mouse events based on focus state