ナビゲーション

v2.1.0
アプリケーションのブロック

アクティビティフィード

起きた出来事を時間ごとにまとめ、誰が行い、何に関わったかを示します。

アクティビティフィードは、ワークスペースで何が起き、誰が行ったかを示します。デプロイ、コメント、ファイルなどです。日ごとのタイムラインで新しい順に並べ、人物をマーカーに、関わった対象を文中に示します。切り替えで、1 種類の出来事だけに絞り込めます。

アクティビティフィード

<section class="sheet container-inline flex flex-col overflow-hidden" data-example="activity-feed" aria-labelledby="activity-title">  <header class="flex flex-wrap items-center justify-between gap-sm p-md">    <div class="flex flex-col gap-3xs">      <h2 class="heading heading-sm" id="activity-title">Activity</h2>      <p class="m(0) fg-text-muted" id="activity-count" aria-live="polite">7 events in Atlas Labs since Wednesday</p>    </div>    <div class="segmented segmented-sm" role="radiogroup" aria-label="Show">      <label class="segmented-item">        <input type="radio" class="segmented-input" name="activity-kind" value="all" checked>All</label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="activity-kind" value="deploy">Deployments</label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="activity-kind" value="comment">Comments</label>      <label class="segmented-item">        <input type="radio" class="segmented-input" name="activity-kind" value="file">Files</label>    </div>  </header>  <div class="flex flex-col gap-lg p-md bt(1) bt-solid b-line-hair" data-activity-days>    <section class="flex flex-col gap-sm" aria-labelledby="activity-today">      <h3 class="m(0) text-xs font-medium fg-text-muted" id="activity-today">Today</h3>      <ol class="timeline">        <li class="timeline-item" data-kind="deploy" aria-current="true">          <span class="timeline-marker">            <span class="avatar avatar-sm">              <img class="avatar-image" src="/demo/people/yiching-lin.webp" alt width="256" height="256">            </span>          </span>          <div class="timeline-body">            <p class="timeline-title">Yi-ching Lin deployed              <a class="link" href="#activity-title">atlas.dev</a>to production</p>            <div class="flex flex-wrap items-center gap-xs">              <span class="badge badge-success badge-dot">Ready</span>              <span class="badge badge-category category-teal">Marketing site</span>              <time class="timeline-time" datetime="2026-11-13T09:42">09:42</time>            </div>            <details class="expand max-w(420)" style="--expand-lines: 2">              <summary class="expand-toggle">                <span class="expand-more">Show the build</span>                <span class="expand-less">Hide the build</span>                <svg class="icon expand-chevron" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">                  <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform="rotate(90 8 8)" />                </svg>              </summary>              <dl class="data-list">                <div class="data-list-item">                  <dt class="data-list-term">Commit</dt>                  <dd class="data-list-value">4f021c8, Add pricing for teams</dd>                </div>                <div class="data-list-item">                  <dt class="data-list-term">Build</dt>                  <dd class="data-list-value">38 routes in 48 seconds</dd>                </div>                <div class="data-list-item">                  <dt class="data-list-term">Regions</dt>                  <dd class="data-list-value">14, from Tokyo to São Paulo</dd>                </div>                <div class="data-list-item">                  <dt class="data-list-term">Rollback</dt>                  <dd class="data-list-value">The 08:12 deployment stays ready</dd>                </div>              </dl>            </details>          </div>        </li>        <li class="timeline-item" data-kind="comment">          <span class="timeline-marker">            <span class="avatar avatar-sm">              <img class="avatar-image" src="/demo/people/misaki-sato.webp" alt width="256" height="256">            </span>          </span>          <div class="timeline-body">            <p class="timeline-title">Misaki Sato commented on              <a class="link" href="#activity-title">Pricing page, preview 212</a>            </p>            <p class="timeline-description max-w(560)">“The yearly toggle reads well now. Can the Enterprise plan say how many seats it starts with?”</p>            <div class="flex flex-wrap items-center gap-xs">              <span class="badge badge-category category-teal">Marketing site</span>              <time class="timeline-time" datetime="2026-11-13T09:15">09:15</time>            </div>          </div>        </li>        <li class="timeline-item" data-kind="file">          <span class="timeline-marker">            <span class="avatar avatar-sm" aria-hidden="true">KN</span>          </span>          <div class="timeline-body">            <p class="timeline-title">Kenta Nakamura added 2 files to              <a class="link" href="#activity-title">Edge functions</a>            </p>            <div class="flex flex-col items-start gap-xs max-w(420)">              <a class="file file-sm file-interactive" href="#activity-title">                <span class="file-page" aria-hidden="true">pdf</span>                <span class="file-body">                  <span class="file-name">Cold start profile.pdf</span>                  <span class="file-meta">1.2 MB</span>                </span>              </a>              <a class="file file-sm file-interactive" href="#activity-title">                <span class="file-page" aria-hidden="true">csv</span>                <span class="file-body">                  <span class="file-name">Regions by latency.csv</span>                  <span class="file-meta">84 KB</span>                </span>              </a>            </div>            <div class="flex flex-wrap items-center gap-xs">              <span class="badge badge-category category-violet">Edge functions</span>              <time class="timeline-time" datetime="2026-11-13T08:30">08:30</time>            </div>          </div>        </li>      </ol>    </section>    <section class="flex flex-col gap-sm" aria-labelledby="activity-yesterday">      <h3 class="m(0) text-xs font-medium fg-text-muted" id="activity-yesterday">Yesterday</h3>      <ol class="timeline">        <li class="timeline-item" data-kind="deploy">          <span class="timeline-marker">            <span class="avatar avatar-sm" aria-hidden="true">SK</span>          </span>          <div class="timeline-body">            <p class="timeline-title">Seo-yeon Kim deployed              <a class="link" href="#activity-title">api.atlas.dev</a>to production</p>            <div class="flex flex-wrap items-center gap-xs">              <span class="badge badge-success badge-dot">Ready</span>              <span class="badge badge-category category-blue">Public API</span>              <time class="timeline-time" datetime="2026-11-12T17:40">17:40</time>            </div>          </div>        </li>        <li class="timeline-item" data-kind="deploy">          <span class="timeline-marker">            <span class="avatar avatar-sm" aria-hidden="true">SK</span>          </span>          <div class="timeline-body">            <p class="timeline-title">Seo-yeon Kim’s deployment of              <a class="link" href="#activity-title">api.atlas.dev</a>failed</p>            <div class="flex flex-wrap items-center gap-xs">              <span class="badge badge-danger badge-dot">Failed</span>              <span class="badge badge-category category-blue">Public API</span>              <time class="timeline-time" datetime="2026-11-12T17:05">17:05</time>            </div>            <details class="expand max-w(420)" style="--expand-lines: 2">              <summary class="expand-toggle">                <span class="expand-more">Show the error</span>                <span class="expand-less">Hide the error</span>                <svg class="icon expand-chevron" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">                  <path d="M6 3.5L10.3586 7.8586A0.2 0.2 0 0 1 10.3586 8.1414L6 12.5" transform="rotate(90 8 8)" />                </svg>              </summary>              <dl class="data-list">                <div class="data-list-item">                  <dt class="data-list-term">Check</dt>                  <dd class="data-list-value">GET /status, every 10 seconds</dd>                </div>                <div class="data-list-item">                  <dt class="data-list-term">Answered</dt>                  <dd class="data-list-value">503 three times in a row</dd>                </div>                <div class="data-list-item">                  <dt class="data-list-term">Stopped</dt>                  <dd class="data-list-value">Before it took any traffic</dd>                </div>                <div class="data-list-item">                  <dt class="data-list-term">Served</dt>                  <dd class="data-list-value">Tuesday’s deployment, until the fix at 17:40</dd>                </div>              </dl>            </details>          </div>        </li>      </ol>    </section>    <section class="flex flex-col gap-sm" aria-labelledby="activity-wednesday">      <h3 class="m(0) text-xs font-medium fg-text-muted" id="activity-wednesday">Wednesday, 11 November</h3>      <ol class="timeline">        <li class="timeline-item" data-kind="comment">          <span class="timeline-marker">            <span class="avatar avatar-sm">              <img class="avatar-image" src="/demo/people/misaki-sato.webp" alt width="256" height="256">            </span>          </span>          <div class="timeline-body">            <p class="timeline-title">Misaki Sato commented on              <a class="link" href="#activity-title">Cache the image pipeline</a>            </p>            <p class="timeline-description max-w(560)">“Each preview rebuilds every image. Caching them by hash should cut the build by a third.”</p>            <div class="flex flex-wrap items-center gap-xs">              <span class="badge badge-category category-violet">Edge functions</span>              <time class="timeline-time" datetime="2026-11-11T10:48">10:48</time>            </div>          </div>        </li>        <li class="timeline-item" data-kind="deploy">          <span class="timeline-marker">            <span class="avatar avatar-sm" aria-hidden="true">KN</span>          </span>          <div class="timeline-body">            <p class="timeline-title">Kenta Nakamura deployed              <a class="link" href="#activity-title">fn.atlas.dev</a>to preview</p>            <div class="flex flex-wrap items-center gap-xs">              <span class="badge badge-success badge-dot">Ready</span>              <span class="badge badge-category category-violet">Edge functions</span>              <time class="timeline-time" datetime="2026-11-11T09:05">09:05</time>            </div>          </div>        </li>      </ol>    </section>  </div></section>
出来事の種類を選んでフィードを絞り込んだり、デプロイの詳細を開いたりできます。

ブロックはコピーして使えるマークアップです。文字色と文字サイズはページから引き継ぎます。プレビューでは body に fg-text-body text-sm を設定しています。各ブロックはサイズコンテナーで、広いページでも、サイドバーほどの幅でも、ダイアログ内でも、自身の幅に応じて配置が変わります。

#構成

  • 1 枚のシート。 ヘッダーと各日の間を細い罫線 bt(1) bt-solid b-line-hair で区切ります。
  • 1 日は見出しとタイムラインです。 今日、昨日、その後は日付を、それぞれ <ol class="timeline"> の上の <h3> にして、新しい順に並べます。ヘッダーの件数は表示中の出来事の数で、その下の各日の内容と一致します。
  • 人物がマーカーです。 timeline-marker に入れたアバターが、マーカーの 24px の大きさでドットの代わりになり、線が人物どうしをつなぎます。名前は文中にあるため、写真の alt は空にし、イニシャルには aria-hidden を付けます。
  • 関わった対象はリンクです。 タイトル中のデプロイ、プレビュー、課題はその対象へのリンクです。ファイルは読み手が開けるファイルとして表示します。
  • 文章には読みやすい幅を保ちます。 引用したコメントは max-w(560)、ファイルと詳細は max-w(420) にします。シートが広くても 1 文がシートいっぱいに伸びることはありません。行はシートと同じ幅でも、読む幅はそうなりません。
  • ステータスはトーンで、プロジェクトはカテゴリーで示します。 「Ready」や「Failed」は、ドットと文言を備えたステータスのバッジです。出来事が属するプロジェクトは、名前を入れた badge-category で示します。そのプロジェクトにほかの場所でも割り当てられているカテゴリーを使います。
  • 最新の出来事が現在のものです。 その行に aria-current="true" を付けると、マーカーがドットの場合はインク色になります。
  • 詳細は折りたたんでおきます。 デプロイのビルド内容や失敗の理由はテキストの展開に入れます。最初の数行が表示され、残りはネイティブの <details> で開きます。ページ内検索やキーボード操作はそのまま使えます。
  • 切り替えはセグメントコントロールです。 フィードをデプロイ、コメント、ファイルのいずれかに絞り込みます。該当する出来事がなくなった日は一覧から外れます。

#スクリプトが必要な処理

フィードはサーバーが書き出すマークアップで、スクリプトがなくてもすべて読めます。main.js は絞り込みだけを行います。選んだ種類の出来事を一覧に残し、出来事がなくなった日を取り除き、件数を更新します。件数は polite のライブリージョンです。フィードをページ分割するサーバーは、クエリーで指定された種類で同じように絞り込みます。

#アクセシビリティ

  • シートは見出しを名前とする <section> で、各日もそれぞれの見出しを名前とする <section> です。
  • 各出来事は、誰が何に対して何をしたかを伝える 1 文なので、アバター、バッジ、線がなくても読めます。
  • ステータスのバッジはステータスを文言で伝えます。カテゴリーのバッジはプロジェクト名を伝え、色はそれを繰り返すだけです。
  • 時刻は <time datetime> 要素なので、読み手は正確な日時を知ることができ、プログラムも読み取れます。
  • 切り替えは「Show」という名前のラジオグループで、選択後の件数が読み上げられます。