╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │116 pub const RefKind = enum { branch, tag }; │ │117 │ │118 pub const IssuesView = enum { open, closed, tags, new, edit, description, new_comment, edit_comment, conflicts, resolve };│ │119 + │ │120 + pub const EventsView = enum { active, removed }; │ │121 │ │122 pub const RefOrOid = enum { │ │123 branch, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────╮ │291 │ │292 pub const RepoEventsRoute = struct { │ │293 name: Array(repo_identity_max_len), │ │294 + view: EventsView = .active, │ │295 kind: ?evt.EventKind = null, │ │296 selected: Array(evt.event_id_size * 2) = .{},│ │297 }; │ ╰──────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │350 } │ │351 │ │352 // build the events list or a window rooted at one event. │ │350 - pub fn repoEventsRoute(identity: []const u8, kind: ?evt.EventKind, selected: []const u8) ?RoutablePage { │ │353 + pub fn repoEventsRoute(identity: []const u8, view: EventsView, kind: ?evt.EventKind, selected: []const u8) ?RoutablePage {│ │354 if ((kind == null) != (selected.len == 0)) return null; │ │355 return .{ .repo_events = .{ │ │356 .name = Array(repo_identity_max_len).from(identity) orelse return null, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────╮ │357 + .view = view, │ │358 .kind = kind, │ │359 .selected = Array(evt.event_id_size * 2).from(selected) orelse return null,│ │360 } }; │ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │580 break :blk if (e.kind) |kind| │ │581 try std.fmt.allocPrint(arena.allocator(), "{s}/event:{s}/kind:{s}", .{ prefix, e.selected.slice(), @tagName(kind) }) │ │582 else │ │579 - try std.fmt.allocPrint(arena.allocator(), "{s}/events", .{prefix}); │ │583 + try std.fmt.allocPrint(arena.allocator(), "{s}/events/{s}", .{ prefix, @tagName(e.view) }); │ │584 }, │ │585 .repo_settings => |name| try std.fmt.allocPrint(arena.allocator(), "{s}/settings", .{try repoUrlPrefix(arena, name.slice())}),│ │586 .repo_auth => |name| try std.fmt.allocPrint(arena.allocator(), "{s}/auth", .{try repoUrlPrefix(arena, name.slice())}), │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │768 if (std.mem.eql(u8, w, "new")) return if (tag_value.len == 0) repoIssuesNewRoute(pair) else null;│ │769 return null; │ │770 } │ │767 - if (std.mem.eql(u8, tab, "events")) │ │768 - return if (segments.next() == null) repoEventsRoute(pair, null, "") else null; │ │771 + if (std.mem.eql(u8, tab, "events")) { │ │772 + const view = if (segments.next()) |word| │ │773 + std.meta.stringToEnum(EventsView, word) orelse return null │ │774 + else │ │775 + .active; │ │776 + return if (segments.next() == null) repoEventsRoute(pair, view, null, "") else null; │ │777 + } │ │778 if (std.mem.startsWith(u8, tab, "event:")) { │ │779 const event_id = tab["event:".len..]; │ │780 const kind_segment = segments.next() orelse return null; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │781 if (!std.mem.startsWith(u8, kind_segment, "kind:")) return null; │ │782 const kind = std.meta.stringToEnum(evt.EventKind, kind_segment["kind:".len..]) orelse return null;│ │783 if (event_id.len == 0 or segments.next() != null) return null; │ │775 - return repoEventsRoute(pair, kind, event_id); │ │784 + return repoEventsRoute(pair, .active, kind, event_id); │ │785 } │ │786 if (std.mem.eql(u8, tab, files_seg)) { │ │787 params.scanPairs(&segments) catch return null; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │841 a_i.comments_start == b.repo_issues.comments_start and │ │842 std.mem.eql(u8, a_i.comment.slice(), b.repo_issues.comment.slice()), │ │843 .repo_events => |a_e| std.mem.eql(u8, a_e.name.slice(), b.repo_events.name.slice()) and│ │844 + a_e.view == b.repo_events.view and │ │845 a_e.kind == b.repo_events.kind and │ │846 std.mem.eql(u8, a_e.selected.slice(), b.repo_events.selected.slice()), │ │847 .repo_settings => |a_name| std.mem.eql(u8, a_name.slice(), b.repo_settings.slice()), │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │1378 // file to the url after the prefix │ │1379 pub const file_input_prefix = "file:"; │ │1380 │ │1381 +// a submit button that overrides its enclosing form's action │ │1382 +pub const submit_action_prefix = "submit:"; │ │1383 + │ │1384 // the url an `ax:` link points at, or null for anything else. a host that│ │1385 // suppresses the anchor's own navigation needs this to follow the link. │ │1386 pub fn rawLink(root_focus: *Focus, focus_id: usize) ?[]const u8 { │ ╰────────────────────────────────────────────────────────────────────────────────╯