{
  "$schema": "https://rift-ds.com/schema/component.schema.json",
  "version": "1.40.0",
  "kind": "component",
  "name": "ThreadHistory",
  "label": "Thread history",
  "slug": "thread-history",
  "category": "ai",
  "description": "A chat’s grouped thread rows with status dots, row menus and inline rename, for a history rail or an app sidebar section.",
  "client": false,
  "importPath": "rift-ds/components/ThreadHistory/ThreadHistory",
  "barrel": "main",
  "docsUrl": "https://rift-ds.com/components/thread-history",
  "markdownUrl": "https://rift-ds.com/components/thread-history.md",
  "exports": [
    {
      "component": "ThreadHistory",
      "props": [
        {
          "name": "groups",
          "type": "ThreadPanelGroup[]",
          "typeKind": "array",
          "required": true,
          "description": "The history, in display order. A flat list is one group with no label. Each thread takes ThreadPanel's thread shape.",
          "typeRefs": [
            "ThreadPanelGroup"
          ]
        },
        {
          "name": "activeThreadId",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Id of the thread on stage. Its row renders filled and carries `aria-current`."
        },
        {
          "name": "onThreadSelect",
          "type": "((id: string) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires with the clicked thread's id. Rows with an `href` navigate as well."
        },
        {
          "name": "threadActions",
          "type": "ThreadPanelThreadAction[]",
          "typeKind": "array",
          "required": false,
          "description": "Shared menu actions for every thread row, behind a hover-revealed trailing trigger (always shown on a touch screen); a thread's own `actions` overrides the set. The menu renders only when `onThreadAction` is also given, and never on a `pending` row.",
          "typeRefs": [
            "ThreadPanelThreadAction"
          ]
        },
        {
          "name": "onThreadAction",
          "type": "((threadId: string, actionId: string) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires with the thread's id and the chosen action's id."
        },
        {
          "name": "statusLabels",
          "type": "Partial<Record<ThreadPanelThreadStatus, string>>",
          "typeKind": "reference",
          "required": false,
          "description": "Spoken text for each thread status, read after the row's title; the dot itself is decorative. Merged over the English defaults (Working, Unread, Needs input, Failed). `idle` is silent unless given a label here.",
          "typeRefs": [
            "ThreadPanelThreadStatus"
          ]
        },
        {
          "name": "pinnedLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Spoken text for a `pinned` thread, read after the title and any status; the pin glyph itself is decorative.",
          "default": "Pinned"
        },
        {
          "name": "threadMenuLabel",
          "type": "string | ((title: string) => string)",
          "typeKind": "other",
          "required": false,
          "description": "Accessible name for a row's menu trigger. A string is followed by a colon\nand the thread's title (\"Thread options: Q3 plan\"); a function is given\nthe title and returns the whole name, so a translation can put the title\nwhere its grammar needs it.",
          "default": "Thread options"
        },
        {
          "name": "renamingThreadId",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Id of the thread being renamed: its row swaps to an inline text field, prefilled with the title and selected. The host owns the state."
        },
        {
          "name": "onThreadRename",
          "type": "((threadId: string, title: string) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires with the thread's id and the trimmed new title when a rename commits (Enter, or focus leaving the field). An empty or unchanged value fires `onRenameCancel` instead."
        },
        {
          "name": "onRenameCancel",
          "type": "(() => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires when a rename ends without a change: Escape, an empty value, or an unchanged title."
        },
        {
          "name": "renameLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Accessible name for the inline rename field.",
          "default": "Rename thread"
        },
        {
          "name": "moreLabel",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Text for the quiet trailing row that reveals older threads, e.g. \"Show 20 more\". Renders only when given."
        },
        {
          "name": "onShowMore",
          "type": "(() => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires when the more row is clicked."
        },
        {
          "name": "collapsibleSections",
          "type": "boolean",
          "typeKind": "primitive",
          "required": false,
          "description": "Let the reader fold each labelled group under its heading: the heading\nbecomes a toggle with a chevron, and the rows glide shut beneath it.",
          "default": false
        },
        {
          "name": "collapsedSections",
          "type": "string[]",
          "typeKind": "array",
          "required": false,
          "description": "The folded groups, by each group's `id` (its `label` when it has none). Controlled: pair it with `onCollapsedSectionsChange`. Needs `collapsibleSections`.",
          "defaultExpression": "[]"
        },
        {
          "name": "onCollapsedSectionsChange",
          "type": "((collapsedSections: string[]) => void)",
          "typeKind": "function",
          "required": false,
          "description": "Fires with the full new list of folded groups when a heading is pressed."
        },
        {
          "name": "className",
          "type": "string",
          "typeKind": "primitive",
          "required": false,
          "description": "Additional CSS classes",
          "default": ""
        },
        {
          "name": "linkComponent",
          "type": "LinkComponent",
          "typeKind": "reference",
          "required": false,
          "description": "The component its links render with, such as Next.js's `Link`, so they\nnavigate through the app's router; a plain `<a>` when unset. This\ncomponent can render on the server, so it never reads a LinkProvider:\npass the prop even under one.",
          "typeRefs": [
            "LinkComponent"
          ]
        }
      ]
    }
  ],
  "types": {
    "LinkComponent": {
      "kind": "type",
      "definition": "type LinkComponent = React.ElementType<LinkComponentProps>;",
      "description": "A component that renders a link in place of a plain `<a>`, such as a router's.",
      "refs": [
        "LinkComponentProps"
      ]
    },
    "LinkComponentProps": {
      "kind": "type",
      "definition": "type LinkComponentProps = React.ComponentPropsWithRef<'a'> & { href: string };",
      "description": "The props a link component receives: every anchor attribute, the ref, and\nan `href` that is always a string. Next.js's `Link` takes these as they\nare; a router whose link takes `to` instead needs a one-line adapter:\n`({ href, ...props }) => <RouterLink to={href} {...props} />`."
    },
    "ThreadPanelGroup": {
      "kind": "interface",
      "definition": "interface ThreadPanelGroup {\n  /** Group heading in the rails' shared mixed-case style, e.g. a project or repo name. Omit for an unlabelled run of threads. */\n  label?: string;\n  /** Stable identity for the group's fold state, the key `collapsedSections` lists. Defaults to `label`; set it when the label is translated or may change. */\n  id?: string;\n  /** The group's threads, in display order. */\n  threads: ThreadPanelThread[];\n}",
      "refs": [
        "ThreadPanelThread"
      ]
    },
    "ThreadPanelThread": {
      "kind": "component-props",
      "component": "ThreadPanel",
      "see": "get_component(\"ThreadPanel\")"
    },
    "ThreadPanelThreadAction": {
      "kind": "interface",
      "definition": "interface ThreadPanelThreadAction {\n  /** Stable identifier reported through `onThreadAction`. */\n  id: string;\n  /** Menu row text. */\n  label: string;\n  /** Leading icon on the menu row — Material Symbol name (string) or custom element (ReactNode). */\n  icon?: string | React.ReactNode;\n  /** Destructive styling (the error text colour) for delete-like actions. */\n  destructive?: boolean;\n}"
    },
    "ThreadPanelThreadStatus": {
      "kind": "type",
      "definition": "type ThreadPanelThreadStatus =\n  | 'idle'\n  | 'working'\n  | 'unread'\n  | 'waiting'\n  | 'error';",
      "description": "What a thread's leading dot reports. Fill says whether the thread wants\nthe reader, colour says what it wants, motion says it is live right now:\n`idle` is a hollow neutral ring, `working` a pulsing neutral dot, and\n`unread`, `waiting` and `error` solid dots in the info, warning and error\nroles."
    }
  },
  "externalTypes": {
    "ComponentPropsWithRef": "react",
    "ElementType": "react",
    "Partial": "typescript",
    "ReactNode": "react",
    "Record": "typescript"
  },
  "keys": {
    "by": "component",
    "note": "Its threads are a list of buttons; the rename field commits on Enter and cancels on Escape."
  },
  "size": {
    "gzip": 10863
  },
  "alternatives": [
    {
      "name": "ThreadPanel",
      "when": "the history is the whole rail, with its brand, new-thread row, projects and profile footer",
      "schemaUrl": "https://rift-ds.com/schema/components/thread-panel.json"
    }
  ]
}
