Skip to content

feat: Add /[lang]/sandbox page with REPL, code execution, file addition, and section chat - #238

Open
na-trium-144 wants to merge 1 commit into
mainfrom
sandbox-page
Open

feat: Add /[lang]/sandbox page with REPL, code execution, file addition, and section chat#238
na-trium-144 wants to merge 1 commit into
mainfrom
sandbox-page

Conversation

@na-trium-144

Copy link
Copy Markdown
Contributor

close #169

  1. /[lang]/sandbox ページの追加
    • app/(docs)/@docs/[lang]/sandbox/page.tsx: /terminal と同様の言語サンプル設定を読み込み、指定された lang の
      REPL・コードエディター・実行ボタンを表示するサーバーコンポーネントを作成しました。
    • app/(docs)/@docs/[lang]/sandbox/sandboxContent.tsx:
      サンドボックス画面の表示とファイル追加機能、AI質問フォーム、セクションチャット一覧のレイアウトをクライアントコンポーネントとして実装しました。
  2. ファイル追加機能
    • フォームから希望のファイル名(例: helper.py)を入力して「ファイルを追加」ボタンを押すことで、動的に EditorComponent
      を生成して編集できるよう対応しました。追加したファイルは不要になったら削除することもできます。
  3. ChatListForSection と ChatForm の統合
    • /[lang]/[pageId] 同様に、画面右下から「AIに質問」ボタンで ChatForm を呼び出せます。
    • ダミーセクション (id: "sandbox") を対象として指定し、送信したチャット履歴を ChatListForSection に表示します。
  4. AIプロンプトのカスタマイズ(ドキュメント&改訂機能の除外)
    • route.ts: path.page === "sandbox" の場合は、ドキュメントの解説文章やドキュメント改訂指示(SEARCH/REPLACE)を除外したプロンプトを構築するように調整しました。
    • ユーザーの操作したターミナルログ、エディタ上のファイル内容、ファイル実行結果を元に、1行目を sandbox 、2行目をタイトル、3行目以降を回答として出力します。
  5. その他連携と型チェック
    • chatHistory.ts: サンドボックス用などのダミーセクションでもチャット履歴テーブル・セクションテーブルと正しく連携するようにデータベース保存処理を調整しました。
    • sidebar.tsx: 各言語のサイドメニュー末尾に Sandbox へのリンクを追加しました。
    • pnpm tsc による型チェックを実行し、ビルドエラーが発生しないことを確認済みです。

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
my-code be16784 Commit Preview URL

Branch Preview URL
Aug 12 2026, 05:09 AM

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.

各言語のSandboxページを作り、そこでも質問できるようにする

1 participant