The brand appears once in the title, and Leaderboard sits last

ca1ecb877663 · AtlantisPleb · · parent f33fbf6c98ff

The brand appears once in the title, and Leaderboard sits last

`live_title` applies its suffix to `default` as well as to the content, so a
page with no title of its own rendered "OpenAgents · OpenAgents". The suffix
is composed here instead and returns nil when the page has no name, which
leaves the default to render the brand alone.

Leaderboard moves below Documentation: the footer runs from the surfaces you
work in down to the ones you read.

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 lib/openagents_web/components/layouts.ex
  • modified lib/openagents_web/components/layouts/root.html.heex

Diff

2 files changed, +20 -4

lib/openagents_web/components/layouts.ex modified +16 -3

@@ -211,9 +211,6 @@ defmodule OpenAgentsWeb.Layouts do

211 211
212 212
    ~H"""
213 213
    <footer class="sidebar-footer">
214
      <.link navigate={~p"/leaderboard"} class="sidebar-footer__link">
215
        <UI.icon name="trophy-top" /> Leaderboard
216
      </.link>
217 214
      <.link
218 215
        :if={@admin_link?}
219 216
        id="open-admin"

@@ -229,6 +226,9 @@ defmodule OpenAgentsWeb.Layouts do

229 226
      <.link navigate={~p"/docs"} class="sidebar-footer__link">
230 227
        <UI.icon name="book" /> Documentation
231 228
      </.link>
229
      <.link navigate={~p"/leaderboard"} class="sidebar-footer__link">
230
        <UI.icon name="trophy-top" /> Leaderboard
231
      </.link>
232 232
    </footer>
233 233
    """
234 234
  end

@@ -579,6 +579,19 @@ defmodule OpenAgentsWeb.Layouts do

579 579
  defp admin?(nil), do: false
580 580
  defp admin?(user), do: OpenAgents.Accounts.admin?(user)
581 581
582
  @doc """
583
  The browser title: the page's own name, then the brand.
584
585
  Returns nil when the page has no name, so `live_title`'s default renders the
586
  brand alone instead of appending it to itself.
587
  """
588
  def page_title(assigns) do
589
    case assigns[:page_title] do
590
      title when is_binary(title) and title != "" -> title <> " · OpenAgents"
591
      _absent -> nil
592
    end
593
  end
594
582 595
  defp account_display_name(%{github_name: name}) when is_binary(name) and name != "", do: name
583 596
  defp account_display_name(%{github_login: login}), do: "@" <> login
584 597
lib/openagents_web/components/layouts/root.html.heex modified +4 -1

@@ -8,7 +8,10 @@

8 8
    <link rel="icon" href={~p"/favicon-32x32.png"} type="image/png" sizes="32x32" />
9 9
    <link rel="icon" href={~p"/favicon-16x16.png"} type="image/png" sizes="16x16" />
10 10
    <link rel="apple-touch-icon" href={~p"/apple-touch-icon.png"} sizes="180x180" />
11
    <.live_title default="OpenAgents" suffix=" · OpenAgents" phx-no-format>{assigns[:page_title]}</.live_title>
11
    <%!-- The suffix is composed here rather than passed to `live_title`,
12
    which applies it to `default` as well: a page with no title of its own
13
    rendered the brand twice. --%>
14
    <.live_title default="OpenAgents" phx-no-format>{page_title(assigns)}</.live_title>
12 15
    <link phx-track-static rel="stylesheet" href={~p"/assets/css/app.css"} />
13 16
    <%!-- Runs before first paint, and deliberately not deferred: resolving the
14 17
    theme after the stylesheet has painted produces a flash of the wrong theme.

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