╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────╮ │216 session: *ui.Session, │ │217 // the issue whose description the pane currently shows (index into data.issues).│ │218 detailed_index: ?usize, │ │219 + // the pane's description text box's focus id (null until a detail is shown). │ │220 + description_id: ?usize, │ │221 │ │222 const sub_header_index: usize = 0; │ │223 const stack_index: usize = 1; │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────╮ │329 .data = data, │ │330 .session = session, │ │331 .detailed_index = null,│ │332 + .description_id = null,│ │333 }; │ │334 } │ │335 │ ╰────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │513 // the description as a focusable word-wrapped text box. its hidden │ │514 // border reserves the space the border occupies when focused, so │ │515 // focusing doesn't shift layout. │ │513 - { │ │516 + self.description_id = blk: { │ │517 var tb = try wgt.TextBox(ui.Widget).init(allocator, entry.issue.description, .{ .border_style = .hidden, .rounded_corners = true, .wrap_kind = .word });│ │518 errdefer tb.deinit(allocator); │ │519 tb.getFocus().focusable = true; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │520 try inner.children.put(allocator, tb.getFocus().id, .{ .widget = .{ .text_box = tb }, .rect = null, .min_size = null });│ │518 - } │ │521 + break :blk tb.getFocus().id; │ │522 + }; │ │523 │ │524 // select the description by default │ │521 - inner.getFocus().child_id = inner.children.keys()[inner.children.count() - 1]; │ │525 + inner.getFocus().child_id = self.description_id; │ │526 │ │527 // reset the scroll to the top for the newly-shown issue: directly on the │ │528 // terminal (the wasm offset), and via a version bump on the web (so the │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │690 } │ │691 │ │692 fn focusDescription(self: *View, root_focus: *Focus) !void { │ │689 - const inner = self.detailInner(); │ │690 - const index: usize = if (self.tagFlow() != null) 1 else 0; │ │691 - if (inner.children.count() <= index) return; │ │692 - root_focus.setFocus(inner.children.keys()[index]); │ │693 + if (self.description_id) |id| root_focus.setFocus(id); │ │694 } │ │695 │ │696 // enter the detail pane. an empty pane (no issues) can't be entered.│ ╰──────────────────────────────────────────────────────────────────────────────╯