╭ changed ──────────╮ │src/ui/Settings.zig│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │30 │ │31 var box = wgt.Box(ui.Widget).init(.{ .border_style = null, .rounded_corners = true, .direction = .vert }); │ │32 errdefer box.deinit(allocator); │ │33 - box.getFocus().kind = .{ .custom = if (logged_in) "form:/ansi" else "form:" }; │ │33 + // when logged in, the toggle posts to a page-scoped /ansi path so the │ │34 + // server sends us back to this page's settings tab; logged out, the │ │35 + // empty action blocks the POST and the input goes to the TUI instead. │ │36 + box.getFocus().kind = .{ .custom = if (!logged_in) "form:" else switch (session.data.current_page) { │ │37 + .user, .user_settings, .user_auth => |name| try std.fmt.allocPrint(session.arena.allocator(), "form:/user/{s}/ansi", .{name}),│ │38 + else => "form:/ansi", │ │39 + } }; │ │40 │ │41 var button_id: usize = undefined; │ │42 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯