Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion headroom/dashboard/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ <h1 class="text-xl font-semibold tracking-tight">HEADROOM</h1>
<div class="text-xs text-gray-500 mb-3">No per-project data yet.</div>
<div class="text-xs text-gray-600 font-mono leading-relaxed">
Add to each project's <span class="text-gray-400">.claude/settings.local.json</span>:<br>
<span class="text-accent">ANTHROPIC_BASE_URL: http://127.0.0.1:8787/p/&lt;project-name&gt;</span>
<span class="text-accent" x-text="'ANTHROPIC_BASE_URL: ' + window.location.origin + '/p/<project-name>'"></span>
</div>
</div>
</template>
Expand Down
33 changes: 33 additions & 0 deletions tests/test_dashboard_cache_ttl_playwright.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,39 @@ def handler(route) -> None: # type: ignore[no-untyped-def]
page.route("**/*", handler)


def test_dashboard_per_project_setup_url_uses_current_origin() -> None:
with sync_playwright() as pw:
browser = pw.chromium.launch()
page = browser.new_page(viewport={"width": 1720, "height": 1400}, color_scheme="dark")
_install_dashboard_routes(page)

page.goto("http://127.0.0.1:8788/dashboard", wait_until="load")
expect(
page.get_by_text(
"ANTHROPIC_BASE_URL: http://127.0.0.1:8788/p/<project-name>", exact=True
)
).to_be_visible()
expect(
page.get_by_text(
"ANTHROPIC_BASE_URL: http://127.0.0.1:8787/p/<project-name>", exact=True
)
).to_have_count(0)

page.goto("http://headroom.local:9393/dashboard", wait_until="load")
expect(
page.get_by_text(
"ANTHROPIC_BASE_URL: http://headroom.local:9393/p/<project-name>", exact=True
)
).to_be_visible()
expect(
page.get_by_text(
"ANTHROPIC_BASE_URL: http://127.0.0.1:8787/p/<project-name>", exact=True
)
).to_have_count(0)

browser.close()


def test_dashboard_renders_observed_ttl_metrics_and_can_capture_screenshot() -> None:
artifact_dir = os.environ.get("HEADROOM_PLAYWRIGHT_ARTIFACT_DIR")

Expand Down
Loading