# Visible file

A Kardex visible-index tray: each record shows only its edge, and coloured signal clips slide along it to mark where it stands, so a whole tray reads at a glance. For pipelines, renewals and task stages.

- Category: Records
- Docs: https://bevel-ui.vercel.app/components/visible-file
- Import from: `@/components/ui/visible-file`

## Install

```bash
npx shadcn@latest add @bevel/visible-file
```

npm dependencies (installed by the CLI): `cn`.

## Anatomy

```tsx
<VisibleFile aria-label="Agent tasks" scale={["Queued", "Plan", "Build", "Done"]}>
  <VisibleFileRow title="Fix login redirect" detail="Coder">
    <VisibleFileSignal value={2} label="Stage" />
  </VisibleFileRow>
</VisibleFile>
```

## Parts

| Part | Renders | Description |
| --- | --- | --- |
| `VisibleFile` | div (group) + ul | scale: the positions printed across the top. Give it an aria-label. |
| `VisibleFileRow` | li | title and detail, typed on the card edge in its clear pocket. |
| `VisibleFileSignal` | span | value (an index into the scale), label, tone. Slides when it changes; reads as “Stage: Build.” |

## Example: Agent tasks by stage

Signals slide along each card as its task moves through the stages.

```tsx
"use client"

import * as React from "react"
import { VisibleFile, VisibleFileRow, VisibleFileSignal } from "@/components/ui/visible-file"

const stages = ["Queued", "Plan", "Build", "Test", "Review", "Done"]

const start = [
  { title: "Fix login redirect", agent: "Coder", stage: 3, blocked: false },
  { title: "Billing refactor", agent: "Coder", stage: 2, blocked: false },
  { title: "API reference", agent: "Writer", stage: 1, blocked: false },
  { title: "Flaky checkout test", agent: "Tester", stage: 3, blocked: true },
  { title: "Bump dependencies", agent: "Coder", stage: 0, blocked: false },
]

/** A tray of agent tasks. Signals slide along each card as its task moves through the stages. */
export function VisibleFileTasks() {
  const [tasks, setTasks] = React.useState(start)

  React.useEffect(() => {
    const timer = setInterval(() => {
      setTasks((all) => {
        const open = all.filter((t) => t.stage < stages.length - 1 && !t.blocked)
        const pick = open[Math.floor(Math.random() * open.length)]
        if (!pick) return start
        return all.map((t) => (t === pick ? { ...t, stage: t.stage + 1 } : t))
      })
    }, 1600)
    return () => clearInterval(timer)
  }, [])

  return (
    <VisibleFile aria-label="Agent tasks" scale={stages} className="max-w-2xl">
      {tasks.map((t) => (
        <VisibleFileRow key={t.title} title={t.title} detail={t.agent}>
          <VisibleFileSignal
            value={t.stage}
            label={t.blocked ? "Blocked at" : "Stage"}
            tone={t.blocked ? "red" : t.stage === stages.length - 1 ? "green" : "blue"}
          />
        </VisibleFileRow>
      ))}
    </VisibleFile>
  )
}
```
