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.

feat(show-pages): align Show Page scaffold + prompt with built-in Tailwind (#802)

Call White3ade3a18ce32
diff --git a/core/show_pages.py b/core/show_pages.py
index 9b86ef5d9..9774cdd03 100644
--- a/core/show_pages.py
+++ b/core/show_pages.py
@@ -944,7 +944,9 @@ export default function App() {
def _default_styles_css() -> str:
- return """:root {
+ return """@import "tailwindcss";
+
+:root {
color-scheme: light;
}
diff --git a/core/system_prompt_injection.py b/core/system_prompt_injection.py
index b4ce929d8..03c5cedda 100644
--- a/core/system_prompt_injection.py
+++ b/core/system_prompt_injection.py
@@ -93,6 +93,7 @@ Guidance:
- The standard structure is `index.html`, `src/main.tsx`, `src/App.tsx`, `src/styles.css`, and optional `api/*.ts`; treat `index.html` and `src/main.tsx` as the runtime-owned app shell.
- Hot reload is available while `/show/<session-id>/` is open. Users will see page changes live. Prefer component-level changes that preserve React state.
- Built-in UI imports include shadcn-style aliases such as `@/components/ui/button`, `@/components/ui/card`, `@/components/ui/badge`, `@/components/ui/dialog`, `@/components/ui/input`, `@/components/ui/progress`, plus `@avibe/show-ui/theme` for theme presets and CSS variables.
+- Tailwind CSS v4 utility classes are built in and work in any `className`. `src/styles.css` is the CSS entry and must keep `@import "tailwindcss";` at the top; theme through the `@avibe/show-ui/theme` CSS variables.
- Prefer the built-in UI primitives over hand-rolled controls. They include Show Page motion for changed text, numbers, badges, cards, and progress without extra animation calls.
- Optional server handlers live under `api/` and run only when requested. Export functions named like HTTP methods, for example `export async function GET(request) { return Response.json({ ok: true }) }`.
- Design for user understanding, not just for moving text onto a webpage. Choose the visual form that best helps the user inspect, compare, confirm, and continue the discussion.
diff --git a/tests/test_reply_enhancer_platform.py b/tests/test_reply_enhancer_platform.py
index b2d97d59d..f07df0ba3 100644
--- a/tests/test_reply_enhancer_platform.py
+++ b/tests/test_reply_enhancer_platform.py
@@ -310,6 +310,8 @@ class ReplyEnhancerPlatformTests(unittest.IsolatedAsyncioTestCase):
self.assertNotIn("`vibe show path --session-id sesk8m4q2p7x`", prompt)
self.assertIn("Make the page work reasonably on mobile", prompt)
self.assertIn("managed React/Vite apps", prompt)
+ self.assertIn("Tailwind CSS v4 utility classes are built in", prompt)
+ self.assertIn('must keep `@import "tailwindcss";` at the top', prompt)
self.assertNotIn("Ready to visualize", prompt)
self.assertIn("@/components/ui/progress", prompt)
self.assertNotIn("Excalidraw-style static SVG/PNG diagrams", prompt)
diff --git a/tests/test_ui_show_pages.py b/tests/test_ui_show_pages.py
index 7952d7826..cef02c323 100644
--- a/tests/test_ui_show_pages.py
+++ b/tests/test_ui_show_pages.py
@@ -259,6 +259,8 @@ def test_private_show_page_materializes_workspace_before_runtime_proxy(monkeypat
assert response.status_code == 200
assert b"Runtime Page" in response.content
assert (page_dir / "src" / "App.tsx").exists()
+ styles_css = (page_dir / "src" / "styles.css").read_text(encoding="utf-8")
+ assert styles_css.startswith('@import "tailwindcss";'), styles_css[:60]
assert manager.calls[0][1] == "/sessions/ses123/app/"