Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
my-code | 9c25d19 | Commit Preview URL Branch Preview URL |
Mar 17 2026, 02:07 PM |
e41e888 to
4b51ce4
Compare
4b51ce4 to
b3fd3c9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Next.js の Parallel Routes を使って「ドキュメント表示」と「チャット表示」を独立に切り替えられる構成にし、チャットをサイドバー的に表示できるようにするPRです。あわせて、ページ幅/コンテナ幅の見直しで #179(ページタイトル幅)のレイアウト問題にも対応しています。
Changes:
- チャットに
titleカラムを追加し、既存データをメッセージから移行 (docs)配下に@docs/@chatの Parallel Routes を追加し、チャット領域・チャット一覧UIを実装- コンテナ幅・ブレークポイントのカスタマイズ、Markdownのハイライト/リンク挙動を更新
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| drizzle/meta/_journal.json | Drizzleのマイグレーション履歴を更新 |
| drizzle/meta/0005_snapshot.json | スキーマスナップショット更新(chat.title追加など) |
| drizzle/0005_giant_kylun.sql | chat.title追加+既存チャットのtitle埋め戻し |
| app/schema/chat.ts | chatテーブルに title を追加 |
| app/lib/chatHistory.ts | チャット追加/取得/削除、キャッシュキーとrevalidate方針を拡張 |
| app/actions/chatActions.ts | AI応答からセクションID+タイトル+本文をパースし保存 |
| app/actions/getRedirectFromChat.ts | /chat/:id 直アクセス時に対応ドキュメントへ解決するaction追加 |
| app/(docs)/layout.tsx | docs/chatを並べるレイアウト(Parallel Routes)追加 |
| app/(docs)/@docs/[lang]/[pageId]/page.tsx | ドキュメント側ページを新構成に対応、チャット取得をキャッシュ化 |
| app/(docs)/@docs/[lang]/[pageId]/pageContent.tsx | セクションごとのチャット一覧UI、レイアウト調整 |
| app/(docs)/@chat/chat/[chatId]/page.tsx | チャット領域(サイドバー表示)を新規実装 |
| app/(docs)/@docs/default.tsx | /chat/:id 直アクセス時のdocsスロット側リダイレクト |
| app/globals.css | breakpoints/containersのテーマ変数追加 |
| app/sidebar.tsx / app/navbar.tsx / app/layout.tsx / app/terminal/page.tsx | 幅や表示条件(has-sidebar等)に合わせたUI調整 |
| app/markdown/* | hr無効化、ハイライトからチャットへ遷移できるように更新 |
Comments suppressed due to low confidence (3)
app/(docs)/@docs/[lang]/[pageId]/pageContent.tsx:291
- チャット表示中(
chatId !== null)かつhas-chat-2以上の幅では、上の<ul>も表示される一方で、この<details>も常にblockになってしまい、リストとボタンが同時表示されます。chatId !== nullの分岐側はhas-chat-2:hiddenなどにして、意図したブレークポイントで片方だけ表示されるようにしてください。
app/(docs)/@docs/[lang]/[pageId]/page.tsx:100 - Cloudflare Cacheの
cachedResponse.json()経由で返すChatWithMessages[]では、createdAt(chat/message/diff)が JSON 化により文字列になります。下流のクライアント側(PageContent)ではcreatedAt.getTime()を呼んでいるため例外になります。ここでcreatedAtをnew Date(...)に復元する(入れ子も含めて)か、クライアント側が文字列でも動くように統一してください。
app/(docs)/@docs/[lang]/[pageId]/pageContent.tsx:50 chatHistoriesをサーバー側キャッシュ(Cloudflare CacheのcachedResponse.json())経由で渡す場合、createdAtがDateではなく文字列になり得ます。このファイル内でcreatedAt.getTime()を使っている箇所があるため、受け取った時点でDateへ復元するか、ソート/比較側をnew Date(createdAt)で扱える形にして例外を防いでください。
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Comment on lines
+36
to
+45
| if (typeof pagePath === "string") { | ||
| const [lang, page] = pagePath.split("/") as [LangId, PageSlug]; | ||
| pagePath = { lang, page }; | ||
| } | ||
| revalidateTag(cacheKeyForChat(chatId)); | ||
| revalidateTag(cacheKeyForPage(pagePath, userId)); | ||
| if (isCloudflare()) { | ||
| const cache = await caches.open("chatHistory"); | ||
| await cache.delete(cacheKeyForChat(chatId)); | ||
| await cache.delete(cacheKeyForPage(pagePath, userId)); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
close #65
close #179