feat: Discord フロント起点インストール & UI 修正#553
Merged
Merged
Conversation
body の min-height が 100vh(アドレスバー非表示時の大きい高さ)で、 AppShell は h-dvh(動的な高さ)だったため、モバイルでブラウザ クロームが表示されている間に body が shell より高くなり、 BottomNav の下に余分なスクロール領域が生まれていた。body も 100dvh に揃えて解消。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ワークスペースの Discord bot 連携画面から、bot のサーバー追加・
ワークスペース紐付け・スラッシュコマンド登録までを一気通貫にする。
Bot Worker:
- 新規 GET /api/install/start: treeId を検証し install-state JWT
({ treeId, jti }) を INSTALL_STATE_SECRET で署名して Discord OAuth
authorize へリダイレクト。秘密鍵をブラウザに出さずに state を署名。
- callback: state の guild_id 事前固定を撤廃。admin が consent 画面で
選ぶまで guild は不明なため、token 交換で Discord が返した guild に
bind する(callback クエリの guild_id と一致検証済み)。
- install-start のユニットテストを追加。
Frontend ($treeId_.discord-bot.tsx):
- 画面を「管理者設定」と「Mint 許可設定」の2セクションに分割。
- Quest 代理申請の権限は管理者(owner / operatorHat 保有者)のみ表示。
admin 判定をページ側に集約し QuestAgentSection へ canManage を渡す。
- 「サーバーに追加」カードを追加。VITE_BOT_WORKER_URL の
/api/install/start へ遷移するだけで /toban-link も手動 register も不要。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- ログイン画面の「続行することで利用規約とプライバシーポリシーに 同意」フッター案内を削除。 - Privy の embeddedWallets に showWalletUIs: false を設定し、署名・ トランザクション確認モーダルを抑制(書き込みはアプリ側 UX で扱う)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Discord bot 連携画面からのインストール導線を整備し、コマンド登録・ワークスペース紐付けまで一気通貫にしました。あわせてモバイルのスクロール不整合とログイン/Privy 周りの細かな調整を含みます。
変更内容
1. Discord フロント起点インストールフロー(コマンド登録まで自動)
/<treeId>/discord-botの「サーバーに追加」から、bot のサーバー追加 → ワークスペース紐付け → スラッシュコマンド登録までを自動化。Bot Worker
GET /api/install/start—treeIdを検証し install-state JWT ({ treeId, jti }) をINSTALL_STATE_SECRETで署名して Discord OAuth authorize へリダイレクト。秘密鍵をブラウザに出さずに state を署名。callback— state のguild_id事前固定を撤廃し、OAuth token 交換で Discord が返した guild に bind する方式へ変更(admin が consent 画面で選ぶまで guild は不明なため)。install-startのユニットテスト追加(計 44 tests green)。Frontend (
$treeId_.discord-bot.tsx)QuestAgentSectionへcanManageを渡す。VITE_BOT_WORKER_URLの/api/install/startへ遷移するだけで/toban-linkも手動register-commandsも不要。2. モバイル viewport 不整合の修正
bodyのmin-heightが100vh、AppShellはh-dvhだったため、モバイルでブラウザクローム表示中にbodyが shell より高くなり BottomNav 下に余分なスクロール領域が発生。bodyを100dvhに揃えて解消。3. ログイン / Privy 調整
embeddedWalletsにshowWalletUIs: falseを設定し、署名・トランザクション確認モーダルを抑制。デプロイ時の運用手順
https://<bot-worker>/api/install/callbackが登録済みであること(既存要件)。deploy:sepolia/deploy:base)。関連 secret / vars は既に wrangler に存在。.envに実際のVITE_BOT_WORKER_URLを設定(現状は空プレースホルダ)。レビュー時の観点
/toban-linkの TODO と同水準。フォローアップ要否をレビューで確認したい(詳細はレビューコメントで補足します)。確認状況
pnpm frontend typecheck/pnpm --filter @toban/discord-bot typecheckpnpm --filter @toban/discord-bot test(44 passed)pnpm biome:check🤖 Generated with Claude Code