PathLogs UI
Русский

Components

ActivityTimeline

A feed of events by day, with runs of similar ones collapsed.

A chronology of events: grouped by day, with consecutive similar events collapsed into a single entry. The feed stays readable instead of drowning in seven identical «changed the status» lines.

Example

сегодня

  1. 💬
    Мурат Добавил обработку таймаута в импорт
  2. Айгерим обновил статусы задач4
    1. Айгерим перевела UI-14 в «На проверке»
    2. Айгерим перевела UI-12 в «В работе»
    3. Айгерим перевела UI-9 в «Готово»
    4. Айгерим перевела UI-7 в «Готово»
  3. 💬
    Данияр Вынес разбор Markdown в отдельный модуль

вчера

  1. 💬
    Мурат Открыл задачу про WIP-лимиты
  2. @
    Мурат назначил Данияра на UI-15

Expand a collapsed run to see the individual events inside it.

Props

events*E[]

The events. They need id, at (the time) and kind (the type).

renderEvent*(event: E) => ReactNode

How to render a single event.

renderBurst(events: E[]) => ReactNode

The heading of a collapsed run.

renderIcon(event: E) => ReactNode

The marker on the left of the timeline.

nowDate

The reference point for relative time. Defaults to now.

order"desc" | "asc"

defaults to: "desc"

Newest on top or at the bottom.

burstThresholdnumber

defaults to: 3

From how many consecutive similar events to start collapsing.

expandableboolean

defaults to: true

Expand a run on click.

Collapsing runs

The gap inside a run is measured between neighbouring events, not from its start: ten edits at one every twenty minutes are one piece of work, not five separate runs.

The grouping, separately

tsx
import {
  groupActivity,   // events → days with runs collapsed
  collapseBursts,  // collapsing consecutive similar events
  relativeTime,    // «5 minutes ago» in a given locale
  dayLabel,        // «Today» / «Yesterday» / a date
} from "@toimetdev/pathlogs-core";