Skip to content

refactor: slim onto shared @openuidev packages - #894

Merged
AbhinRustagi merged 36 commits into
mainfrom
abhin/template-cleanup
Jul 30, 2026
Merged

refactor: slim onto shared @openuidev packages#894
AbhinRustagi merged 36 commits into
mainfrom
abhin/template-cleanup

Conversation

@AbhinRustagi

@AbhinRustagi AbhinRustagi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Slims the openui-cloud starter so it holds only app-owned code, moving generic mechanism into the @openuidev/* packages.

⚠️ Depends on #893 — merge + publish those packages first, or this PR's frozen-lockfile install fails (it references @openuidev/react-ui@^0.13.3, etc.). Draft until #893 is published.

  • ModelSwitcher: use @openuidev/react-ui (local model-switcher/ removed); pass provider logos as { light, dark } pairs — the component handles the theme swap.
  • Billing: replace the local BillingCreditsDialog with the dev-only OpenUICreditsModal from @openuidev/devtools; billing.ts trimmed to error-message logic.
  • LLM: swap the local createCloudChatLLM for fetchLLM + buildBody — 429s now flow through observability and wake the credits modal. LLM held in a render-tolerant ref.
  • Cleanup: drop unused deps, cloud-chat-llm, chat-error, cloud-chat-constants, and orphaned CSS/logos.

AbhinRustagi and others added 8 commits July 28, 2026 18:54
- ModelSwitcher: use @openuidev/react-ui (drop local model-switcher/); pass provider logos as {light,dark}
- Billing: replace local BillingCreditsDialog with dev-only OpenUICreditsModal from @openuidev/devtools
- LLM: swap createCloudChatLLM for fetchLLM + buildBody (429 flows via observability); hold LLM in a ref
- Cleanup: remove unused deps, cloud-chat-llm, chat-error, cloud-chat-constants, orphaned CSS/logos

Depends on #893 (packages) being merged + published first.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
Drops the local llmRef + selectedModelRef plumbing for useFetchLLM, which holds a stable instance and reads options fresh per send — buildBody closes over selectedModel directly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…-lang/tailwind deps

- page.tsx: replace hand-rolled ChatLLM with fetchLLM (imported from @openuidev/react-ui), buildBody sends { messages }
- drop Tailwind (trivial usage): minimal globals.css reset, inline layout style, delete postcss.config.mjs
- package.json: remove @openuidev/react-headless, @openuidev/react-lang, tailwindcss, @tailwindcss/postcss; react-ui -> 0.13.3

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
Title :empty-hide and actions flex are library defaults after the thread.scss change; the openui-cloud-thread-header hook class is unreferenced.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
- route.ts: badRequest helper, NextResponse, model allowlist (reject unknown), propagate upstream errors with status — billing.ts deleted (store now surfaces server messages)
- theme: useSystemThemeMode from react-ui; delete use-system-theme.tsx; unwrap ThemeProvider in layout
- globals.css: trim to page shell + artifact compat (~18 lines); drop Tailwind + postcss.config.mjs + tailwind deps + vitest
- frontend-token: NextResponse, propagate upstream status

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…evtools to self-hosted

- cloud: ^0.14.0 / ^0.10.0
- self-hosted: react-ui ^0.14.0; OpenUIDevtools rendered dev-only in layout (devDependency)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
AbhinRustagi and others added 18 commits July 28, 2026 20:15
- cloud: drop OPENUI_MODEL, point at src/lib/models.tsx + /api/chat validation, list useFetchLLM/ModelSwitcher/devtools, pnpm-only
- self-hosted: add setup section (OPENAI_API_KEY), fix route path, pnpm-only

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…nAIAdapter

Drops the NDJSON re-encode (toReadableStream); propagates browser aborts via req.signal; model overridable with OPENAI_MODEL.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
Scaffolded output changes substantially (react-ui 0.14 / react-headless 0.10, fetchLLM/useFetchLLM wiring, devtools, removed billing/tailwind) — minor bump, matching the package versioning rationale.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…s, trim comments

- import everything from @openuidev/react-ui (headless re-export); starters/prompt templates moved to src/lib/starters
- drop the now-trivial handleModelChange wrapper; use the logoPath const
- shorten route/model/component comments to the essentials (tool-loop's safety-rule docs kept)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…sed to provide it)

react-ui sets fonts per component, not on body — text that merely inherits fell back to the browser serif once Tailwind's preflight was removed. Same latent gap exists in the reference commit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
…plate

Replaces the globals.css font-family fallback — next/font self-hosts Inter with built-in fallbacks, matching react-ui's --openui-font-body token.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MpABGCgS6C4HRdQSrwhPMR
@AbhinRustagi AbhinRustagi changed the title refactor(openui-cloud template): slim onto shared @openuidev packages refactor: slim onto shared @openuidev packages Jul 29, 2026
@AbhinRustagi
AbhinRustagi marked this pull request as ready for review July 29, 2026 16:23
abhithesys
abhithesys previously approved these changes Jul 30, 2026
abhithesys
abhithesys previously approved these changes Jul 30, 2026
@AbhinRustagi
AbhinRustagi merged commit 19a1d43 into main Jul 30, 2026
31 checks passed
@AbhinRustagi
AbhinRustagi deleted the abhin/template-cleanup branch July 30, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants