╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────╮ │src/ui/NewRepo.zig│ ╰──────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────╮ │105 try child.widget.input(allocator, key, root_focus); │ │106 } │ │107 │ │115 - // the neighboring form control, skipping the spacer │ │116 - fn formStep(form: *wgt.Box(ui.Widget), cur: usize, down: bool) ?usize { │ │117 - var i = cur; │ │118 - while (true) { │ │119 - if (down) { │ │120 - i += 1; │ │121 - if (i >= form.children.count()) return null; │ │122 - } else { │ │123 - if (i == 0) return null; │ │124 - i -= 1; │ │125 - } │ │126 - switch (form.children.values()[i].widget) { │ │127 - .spacer => continue, │ │128 - else => return i, │ │129 - } │ │130 - } │ │131 - } │ │132 - │ │108 fn formRadio(form: *wgt.Box(ui.Widget), name: []const u8) !*ui.widget.Radio { │ │109 for (form.children.values()) |*child| switch (child.widget) { │ │110 .radio => |*radio| if (std.mem.eql(u8, radio.name, name)) return radio,│ ╰────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │132 const moment = try evt.currentMoment(evt.admin_repo_opts, admin_repo); │ │133 const user = (try ui.activeUser(moment, self.session.page_arena, user_id)) orelse return;│ │134 │ │160 - const name_input = try formField(&self.box, "name"); │ │161 - const description_input = try formField(&self.box, "description"); │ │135 + const name_input = try formField(self.formBox(), "name"); │ │136 + const description_input = try formField(self.formBox(), "description"); │ │137 const name = try name_input.text(allocator); │ │138 defer allocator.free(name); │ │139 const description = try description_input.text(allocator); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │140 defer allocator.free(description); │ │166 - const hash_kind = std.meta.stringToEnum(hash.HashKind, (try formRadio(&self.box, "hash")).selected()) orelse unreachable; │ │167 - const access = std.meta.stringToEnum(evt.Repo.Access, (try formRadio(&self.box, "access")).selected()) orelse unreachable; │ │141 + const hash_kind = std.meta.stringToEnum(hash.HashKind, (try formRadio(self.formBox(), "hash")).selected()) orelse unreachable; │ │142 + const access = std.meta.stringToEnum(evt.Repo.Access, (try formRadio(self.formBox(), "access")).selected()) orelse unreachable; │ │143 │ │144 _ = evt.createRepo(io, allocator, users_dir, &user_id, .{ .name = user.event.name, .email = user.event.email }, name, description, access, hash_kind) catch |err| {│ │145 const failure = ui.Session.FormFeedback.RepoFailure.fromError(err) orelse return err; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │161 try self.session.navigate(ui.RoutablePage.repoFilesRoute(identity, null, "", "", 0) orelse return);│ │162 } │ │163 │ │164 + fn formBox(self: *View) *wgt.Box(ui.Widget) { │ │165 + return &self.center.child.box; │ │166 + } │ │167 + │ │168 pub fn clearGrid(self: *View) void { │ │190 - self.box.clearGrid(); │ │169 + self.center.clearGrid(); │ │170 } │ │171 │ │172 pub fn getGrid(self: View) ?Grid { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────╮ │194 - return self.box.getGrid(); │ │173 + return self.center.getGrid(); │ │174 } │ │175 │ │176 pub fn getFocus(self: *View) *Focus {│ ╰──────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────╮ │198 - return self.box.getFocus(); │ │177 + return self.center.getFocus(); │ │178 } │ │179 │ │180 // up leaves the form from its first control│ ╰─────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │181 pub fn atTop(self: View) bool { │ │203 - const first = self.box.children.keys()[0]; │ │204 - return self.box.focus.child_id == first; │ │182 + const box = &self.center.child.box; │ │183 + return box.focus.child_id == box.children.keys()[0];│ │184 } │ │185 }; │ │186 │ ╰─────────────────────────────────────────────────────────────────╯