Module Arod_component.Network

Network page component.

Unified chronological timeline grouped by month. Each month section shows collaborators (overlapping 36px avatar circles) then interleaves bushel entries and external feed entries chronologically. Paginated via infinite scrolling.

module Entry = Bushel.Entry
module Paper = Bushel.Paper
module Contact = Sortal_schema.Contact
module Feed = Sortal_schema.Feed
module FeedEntry = Sortal_feed.Entry
module Idea = Bushel.Idea
module I = Arod.Icons
val normalise_url : string -> string

Normalise a URL for matching: strip www. prefix from host, remove trailing slash.

val build_forward_index : unit -> (string, string list) Hashtbl.t

Build a reverse index from normalised external URL → source slugs, so we can find local entries that link TO a given feed entry URL.

Timeline Item

type timeline_item =
  1. | Bushel of Entry.entry * int * int * int
  2. | Feed_item of Arod.Ctx.feed_item * int * int * int
val timeline_date : timeline_item -> int * int * int

Month Section Data

type month_section = {
  1. year : int;
  2. month : int;
  3. collaborators : Contact.t list;
  4. items : timeline_item list;
}

Collaborator Computation

val month_collaborators : ctx:Arod.Ctx.t -> Bushel.Entry.entry list -> Arod.Ctx.feed_item list -> Contact.t list

Compute collaborators for a given month, sorted by appearance count (most frequent first). Sources: 1.

  • Contact

    tags on bushel entries 2. Paper co-authors matched to known contacts 3. Contacts whose feed entries appear that month

Rendering

val render_avatar : entries:Entry.t -> Contact.t -> Htmlit.El.html

Render a collaborator avatar (36px overlapping circle).

val render_feed_item : entries:Entry.t -> forward_index:(string, string list) Hashtbl.t -> idea_index:(string, (string * string) list) Hashtbl.t -> Arod.Ctx.feed_item -> (int * int * int) -> Htmlit.El.html

Render a feed entry row in the network timeline.

val render_month : entries:Entry.t -> forward_index:(string, string list) Hashtbl.t -> idea_index:(string, (string * string) list) Hashtbl.t -> month_section -> Htmlit.El.html

Render a single month section (feed items only, bushel entries skipped).

Month Section Computation

val compute_month_sections : ctx:Arod.Ctx.t -> month_section list
val build_idea_index : ctx:Arod.Ctx.t -> (string, (string * string) list) Hashtbl.t

Build a reverse index from contact handle → list of (idea_slug, idea_title) for all ideas where the contact is a student.

val render_months_html : ctx:Arod.Ctx.t -> month_section list -> string

Render a slice of month sections as an HTML string for the pagination API.

val all_months : ctx:Arod.Ctx.t -> month_section list

Return all computed month sections for use by the pagination API.

Network Page

val page_size : int
val network_page : ctx:Arod.Ctx.t -> Htmlit.El.html * Htmlit.El.html