Delete the CONNECTED bar from the conversation

239e5662583e · AtlantisPleb · · parent 0a00a0408c61

Delete the CONNECTED bar from the conversation

It spent a permanent row to report the state that needs no reporting. The only
connection state worth surfacing is the one where the socket is gone, and
LiveView already covers that with its disconnect overlay -- so the bar was
visible exactly when it had nothing to say and hidden behind an overlay when
it did.

The `connection_state/1` component goes with it, since this was its only
caller after the mobile header was removed, along with its stylesheet block.
The test that asserted the bar now asserts its absence, so it cannot come back
by accident.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0149rBWy7br1Z7bbz9NrQhEr
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified assets/css/openagents.css
  • modified lib/openagents_web/live/chat_live.ex
  • modified test/openagents_web/account_chrome_test.exs

Diff

3 files changed, +10 -80

assets/css/openagents.css modified -25

@@ -2651,31 +2651,6 @@

2651 2651
    flex-direction: column;
2652 2652
  }
2653 2653
2654
  /* A status line, not a header: it carries the socket's truth and nothing
2655
     else, because the page's name is already in the command bar above it. */
2656
  .chat-status {
2657
    display: flex;
2658
    flex: none;
2659
    align-items: center;
2660
    justify-content: flex-end;
2661
    gap: 8px;
2662
    padding: 8px 24px;
2663
  }
2664
2665
  .connection-state {
2666
    display: inline-flex;
2667
    align-items: center;
2668
    gap: 6px;
2669
  }
2670
2671
  .connection-label {
2672
    color: var(--text-muted);
2673
    font-size: 0.6875rem;
2674
    font-weight: 500;
2675
    letter-spacing: 0.06em;
2676
    line-height: 1rem;
2677
    text-transform: uppercase;
2678
  }
2679 2654
2680 2655
  /* ── Transcript ─────────────────────────────────────────────────────────── */
2681 2656
lib/openagents_web/live/chat_live.ex modified -44

@@ -648,10 +648,6 @@ defmodule OpenAgentsWeb.ChatLive do

648 648
649 649
      <div id="openagents-app" class="chat-shell">
650 650
        <main class="app-main">
651
          <header class="chat-status">
652
            <.connection_state id_prefix="chat-connection" />
653
          </header>
654
655 651
          <section
656 652
            id="transcript"
657 653
            class="transcript"

@@ -1267,46 +1263,6 @@ defmodule OpenAgentsWeb.ChatLive do

1267 1263
1268 1264
  defp duration_label(seconds), do: "#{div(seconds, 3600)}h #{seconds |> rem(3600) |> div(60)}m"
1269 1265
1270
  # Below 768px the sidebar hides behind this slim row: wordmark, connection
1271
  # state, and the menu button that reveals the sidebar as an overlay.
1272
  attr :id_prefix, :string, required: true
1273
1274
  # Connection state is driven by the LiveView socket through element-level
1275
  # connect/disconnect bindings, not by a stylesheet class, so RECONNECTING is
1276
  # real rather than decorative (DESIGN.md, Sarah shell). Rendered twice —
1277
  # sidebar header and mobile header — so the ids take a prefix.
1278
  defp connection_state(assigns) do
1279
    ~H"""
1280
    <span class="connection-state">
1281
      <.status_indicator
1282
        id={"#{@id_prefix}-indicator"}
1283
        state="connected"
1284
        label="Connection to Sarah"
1285
        decorative
1286
        phx-connected={JS.set_attribute({"data-state", "connected"})}
1287
        phx-disconnected={JS.set_attribute({"data-state", "reconnecting"})}
1288
      />
1289
      <span
1290
        id={"#{@id_prefix}-connected"}
1291
        class="connection-label"
1292
        phx-connected={JS.show()}
1293
        phx-disconnected={JS.hide()}
1294
      >
1295
        CONNECTED
1296
      </span>
1297
      <span
1298
        id={"#{@id_prefix}-reconnecting"}
1299
        class="connection-label"
1300
        hidden
1301
        phx-connected={JS.hide()}
1302
        phx-disconnected={JS.show()}
1303
      >
1304
        RECONNECTING
1305
      </span>
1306
    </span>
1307
    """
1308
  end
1309
1310 1266
  attr :delegation, :map, default: nil
1311 1267
  attr :summaries, :list, required: true
1312 1268
  attr :collapsed, :boolean, default: false
test/openagents_web/account_chrome_test.exs modified +10 -11

@@ -57,18 +57,17 @@ defmodule OpenAgentsWeb.AccountChromeTest do

57 57
  end
58 58
59 59
  describe "connection chrome" do
60
    test "the chat status line states the socket's truth through element-level bindings", %{
61
      conn: conn
62
    } do
60
    test "the conversation states no connection status at all", %{conn: conn} do
63 61
      conn = log_in_github_user(conn, "connection-user")
64
      {:ok, view, _html} = live(conn, ~p"/chat")
65
66
      # Chat's status line carries the socket's truth under its own ids. It
67
      # replaced a mobile header whose other job -- a menu button and a second
68
      # brand mark -- belonged to a rail chat no longer renders.
69
      assert has_element?(view, "#chat-connection-indicator[phx-connected][phx-disconnected]")
70
      assert has_element?(view, "#chat-connection-connected", "CONNECTED")
71
      assert has_element?(view, "#chat-connection-reconnecting[hidden]", "RECONNECTING")
62
      {:ok, view, html} = live(conn, ~p"/chat")
63
64
      # Removed at the owner's direction. A bar that reads CONNECTED whenever
65
      # the page is working spends permanent space to say nothing: the only
66
      # state worth reporting is the one where it is not, and LiveView already
67
      # shows that through the disconnect overlay.
68
      refute has_element?(view, ".chat-status")
69
      refute html =~ "CONNECTED"
70
      refute html =~ "chat-connection"
72 71
    end
73 72
  end
74 73

This page updates live while a promote is in flight · changelog