Skip to content

Tiny Sunny: run the chat on @base44/platform 0.5.0's useChat - #79

Merged
amitbardos merged 11 commits into
mainfrom
amitb/tiny-sunny-on-hook
Oct 21, 2026
Merged

amitbardos merged 11 commits into
mainfrom
amitb/tiny-sunny-on-hook

Conversation

@amitbardos

@amitbardos amitbardos commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Tiny Sunny's chat now runs on useChat from @base44/platform/react, on @base44/platform 0.5.0. The root starter moves to 0.5.0 too.

What changes

  • components/useLiveChat.ts is gone (88 lines). The socket, merging and sorting messages, the status and the question formats now come from the hook.
  • ToolQuestion.tsx takes the hook's bound question (answer, submit, approve, decline) instead of a raw tool call, so it no longer knows Base44's answer formats or calls the server itself.
  • Chat.tsx draws items, steps and questions from the hook. A sent prompt shows at once, faded while pending. Send stays disabled unless status is ready or error. The status line says "the AI", not "the builder".
  • ToolQuestion.tsx also draws a text field for a text_input question.
  • The AI's messages render as Markdown, through react-markdown, the version Sunny already installs. Before, they showed raw ** and backticks. The user's prompts stay plain text.
  • A step that was answered keeps its questions and answers under its line.
  • Workspace.tsx no longer remounts the chat per app, so the first prompt survives create.
  • server/base44.ts: openLiveSession passes Base44's socket-session body through. sendMessage and submitToolCallInput return after 3 seconds (waitForRefusal). Base44 holds both requests open for the whole turn, and Next.js runs one server action at a time, so without the cutoff later prompts and answers wait for the build to end. A refusal within 3 seconds is thrown to the hook, which shows it. A failure after that is logged on the server.

0.5.0 is the first @base44/platform release to build on, and has no aliases for older names. Tiny Sunny imports useChat, UseChatResult and ChatBackend (base44/javascript-sdk#345).

The lockfile also drops entries npm no longer records (a stale examples/tiny-sunny and uninstalled optional peers). Apart from @base44/platform, nothing installed changes: the example's new react-markdown dependency resolves to the root's 9.0.1.

Tested

Ran locally against Base44: live loading, pending prompts, questions, and a queue of prompts sent mid-build. On the published 0.5.0, the root and Tiny Sunny typechecks pass and ESLint is clean on examples/white-label-minimal. The root npm run lint fails the same way on main.

🤖 Generated with Claude Code

The chat's own Base44 layer (useLiveChat.ts: the socket, merging and sorting
messages, the status, the question formats) is replaced by the hook, and
ToolQuestion takes the hook's bound question instead of a raw tool call.

- Chat draws items, steps and questions from the hook, shows a sent prompt
  at once (faded while pending), and keeps Send disabled unless the status is
  ready or error.
- Chat no longer remounts per app, so the first prompt survives create.
- openLiveSession passes Base44's socket-session body through, and
  sendMessage and submitToolCallInput return after 3 seconds: Base44 holds
  both open for the whole turn, and Next.js runs one server action at a time.
- @base44/platform comes from base44/javascript-sdk#315's preview package
  until that PR is released.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sunny44-builder ready!

Name Link
🔨 Latest commit 8717657
🔍 Latest deploy log https://app.netlify.com/projects/sunny44-builder/deploys/6ad88f02ca9c6437a5f68ddb
😎 Deploy Preview https://deploy-preview-79--sunny44-builder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for base44-platform-starter ready!

Name Link
🔨 Latest commit 8717657
🔍 Latest deploy log https://app.netlify.com/projects/base44-platform-starter/deploys/6ad88f02e8e689a4418de3a3
😎 Deploy Preview https://deploy-preview-79--base44-platform-starter.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

…rs, approval details and answers

- @base44/platform is the released ^0.3.0 instead of #315's preview package.
- A text_input question gets a text field, and the answer sends it.
- An approval shows what the action would do: the entity, the change, the
  access, the function, as far as Base44's check says.
- A step that was answered keeps its questions and answers under its line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amitbardos
amitbardos marked this pull request as ready for review October 18, 2026 13:20
amitbardos and others added 3 commits October 19, 2026 17:56
0.4.0 renames the client's builder module to chat; Tiny Sunny only uses
useBase44Chat, whose API is unchanged, so this is the version bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main's webhook receiver (#74) depends on @base44/platform too; both it
and the example now take ^0.4.0, so the lockfile resolves one copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	examples/white-label-minimal/server/base44.ts
amitbardos and others added 5 commits October 21, 2026 10:23
…ate failures

sendMessage and submitToolCallInput share the 3-second cutoff instead of
repeating it. A failure that lands after the cutoff has no caller left, so it
is logged on the server rather than dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lify.toml comment

describe() repeated the summary the hook already puts in reason, so the
approval line drops the details. The secrets-scan comment no longer names
versions that both sides have moved past.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ToolQuestion picks Choice, Secrets or Approval by kind, so each keeps only
its own state. They share one Actions row for Submit/Allow and Decline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The AI answers in Markdown, so its text showed raw ** and backticks. It now
goes through react-markdown, the version Sunny already installs, with a few
chat styles for lists, code and links. Links open in a new tab. The user's
own prompts stay plain text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@base44/platform drops the Base44 prefix from its React entry (base44/javascript-sdk#345),
so Chat.tsx uses useChat, UseChatResult and ChatBackend.

The new names ship in 0.5.0; the dependency moves to ^0.5.0 once it is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0.5.0 is published with the new React names, so the dependency and the lockfile move to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@amitbardos amitbardos changed the title Tiny Sunny: run the chat on @base44/platform/react Tiny Sunny: run the chat on @base44/platform 0.5.0's useChat Oct 21, 2026
@amitbardos
amitbardos merged commit 2ad1146 into main Oct 21, 2026
8 checks passed
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.

1 participant