Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(show): keep the demo detail badge from stretching full-width (#881)

Call White38a5c49f7175
diff --git a/core/show_pages.py b/core/show_pages.py
index 10efbcc9d..d403f9d28 100644
--- a/core/show_pages.py
+++ b/core/show_pages.py
@@ -1272,7 +1272,9 @@ export default function ItemDetail({ params }: PageProps) {
<Card>
<CardHeader>
- <Badge>{t("Nested route", "嵌套路由")}</Badge>
+ {/* w-fit: CardHeader is a flex column (align-items: stretch), which
+ blockifies an inline-flex Badge and stretches it to full width. */}
+ <Badge className="w-fit">{t("Nested route", "嵌套路由")}</Badge>
<CardTitle>{t("Item", "条目")} {params.id}</CardTitle>
</CardHeader>
<CardContent className="space-y-2 text-sm text-muted-foreground">
diff --git a/tests/test_show_pages.py b/tests/test_show_pages.py
index f8366eca0..9b65141e1 100644
--- a/tests/test_show_pages.py
+++ b/tests/test_show_pages.py
@@ -767,8 +767,12 @@ def test_fresh_workspace_scaffolds_multipage_demo(monkeypatch, tmp_path):
assert (page_dir / "src" / "pages" / "items" / "index.tsx").exists()
detail = page_dir / "src" / "pages" / "items" / "[id].tsx"
assert detail.exists()
+ detail_src = detail.read_text(encoding="utf-8")
# The dynamic route reads its captured param.
- assert "params.id" in detail.read_text(encoding="utf-8")
+ assert "params.id" in detail_src
+ # The Badge sits in a flex-column CardHeader; w-fit keeps it from stretching
+ # to full width (see the demo detail page).
+ assert '<Badge className="w-fit">' in detail_src
# App composes the router and its nav; it does not hardcode a route table.
app_tsx = (page_dir / "src" / "App.tsx").read_text(encoding="utf-8")