Skip to content

fix: 認証・RLS・UI修正と不要なデバッグコードの整理#142

Open
machida wants to merge 1 commit intomainfrom
design-fix
Open

fix: 認証・RLS・UI修正と不要なデバッグコードの整理#142
machida wants to merge 1 commit intomainfrom
design-fix

Conversation

@machida
Copy link
Copy Markdown
Member

@machida machida commented Jun 16, 2025

  • Supabaseクライアントを createBrowserClient に変更し認証セッション問題を修正
  • company作成フォームのRLS/認証エラー対応
  • デバッグ用console.log等を削除
  • その他UI・レイアウト・不要ファイル整理

Summary by CodeRabbit

  • 新機能

    • 新しいレイアウトコンポーネント(AppLayout, WelcomeLayout, AppHeader, AppSidebar, AppFooter, WelcomeHeader, WelcomeFooter, AppPageHeader, WelcomeBody)を追加し、全体のデザインとナビゲーションを刷新しました。
    • 「会社」「求人」「ドキュメント」など主要ページのページヘッダーやサイドバー、フッターを統一的に表示するようになりました。
    • 企業追加フォームのエラーメッセージ表示機能を追加しました。
  • 機能改善

    • 会社・求人・ドキュメントページのレイアウトやナビゲーションを整理し、より分かりやすい構成に変更しました。
    • ドキュメント一覧がクライアントサイドでページネーション対応になり、一覧表示と操作性が向上しました。
    • ページヘッダーにナビゲーションボタンを追加し、操作の導線を改善しました。
    • ボタンやナビゲーションのスタイルを調整し、アクセシビリティと視認性が向上しました。
    • 企業一覧テーブルの配色やホバー効果を微調整し、視認性を向上しました。
  • バグ修正

    • ページの一部で誤っていたレイアウトやリンク先を修正しました。
  • リファクタ

    • 複数のレイアウト・コンポーネントを統合・整理し、不要なファイルを削除しました。
    • コンポーネント名やエクスポート名の統一を行いました。
    • 企業追加フォームの名称変更とルーターのimport先を更新しました。
    • ドキュメント関連のレイアウトをSingleLayoutからAppLayoutへ移行しました。
  • スタイル

    • テーブルやカード、ページ全体の配色・余白・ホバー効果など細かなデザインを調整しました。
    • Tailwind CSSのprimaryカラーをインディゴ色に固定しました。
    • ログインフォームの見出しサイズを調整しました。
  • その他

    • Supabaseクライアントの初期化方法を最適化しました。

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agent ❌ Failed (Inspect) Jun 16, 2025 3:15pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 16, 2025

Walkthrough

この変更では、アプリ全体のレイアウト構造が大幅に再設計されました。従来のSingleLayoutMultiLayoutなどのレイアウトコンポーネントが削除され、新たにAppLayoutおよびWelcomeLayoutが導入されました。ヘッダー、サイドバー、フッターも新規実装され、ページごとのヘッダーやレイアウトの統一感が高まりました。各ページやリスト表示の構成・スタイルも調整されています。

Changes

ファイル/グループ 変更内容概要
src/components/layouts/SingleLayout.tsx
src/components/layouts/MulitLayout.tsx
src/components/Sidebar.tsx
src/components/Header.tsx
src/components/Welcome.tsx
src/components/DocList.tsx
旧レイアウト・サイドバー・ヘッダー・Welcome・DocListコンポーネントの削除
src/components/layouts/AppLayout.tsx
src/components/layouts/WelcomeLayout.tsx
src/components/AppHeader.tsx
src/components/AppSidebar.tsx
src/components/AppFooter.tsx
src/components/AppPageHeader.tsx
src/components/WelcomeHeader.tsx
src/components/WelcomeFooter.tsx
src/app/welcome/_components/WelcomeBody.tsx
新レイアウト・ヘッダー・サイドバー・フッター・ページヘッダー・WelcomeBody等の追加
src/app/companies/layout.tsx
src/app/dashboard/layout.tsx
src/app/docs/layout.tsx
src/app/jobs/layout.tsx
レイアウトコンポーネントをAppLayoutへ統一
src/app/login/layout.tsx
src/app/privacy/layout.tsx
src/app/signup/layout.tsx
src/app/tos/layout.tsx
レイアウトコンポーネントをWelcomeLayoutへ統一
src/app/page.tsx WelcomeLayout・WelcomeBodyを使用したトップページへリファクタリング
src/app/dashboard/page.tsx
src/app/jobs/page.tsx
AppPageHeader導入・レイアウト構造の整理
src/app/companies/page.tsx
src/app/companies/new/page.tsx
AppPageHeaderや新レイアウト導入、ボタン・ヘッダーの整理
src/app/companies/_components/NewCompanyForm.tsx NewCompanyFormへリネーム、エラーハンドリング追加、UI整理
src/app/companies/_components/Companies.tsx ヘッダー削除・テーブルスタイル調整
src/app/docs/_components/Docs.tsx DocListの機能を統合し、ページネーション・クライアントサイドレンダリング対応
src/app/docs/_components/DocList.tsx ページネーション・カードクリックで詳細遷移などの機能を削除
src/app/docs/page.tsx
src/app/docs/new/page.tsx
src/app/docs/[id]/page.tsx
src/app/docs/[id]/edit/page.tsx
レイアウト・ヘッダー・ナビゲーション・スタイルの調整
src/components/ui/card.tsx
src/components/ui/navigation-menu.tsx
src/components/Pagination.tsx
UIコンポーネントのクラス名微調整
src/lib/supabase.ts Supabaseクライアントの生成方法をcreateBrowserClientへ変更
tailwind.config.js primaryカラーをCSS変数から固定値(#4f39f6)へ変更
src/components/AppHeader.test.tsx インポートパス修正
src/components/WelcomeFooter.tsx エクスポート名をWelcomeFooterへ変更、HTMLタグ微修正
src/app/layout.tsx インポート後に空行追加

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AppLayout
    participant AppHeader
    participant AppSidebar
    participant AppFooter
    participant PageContent

    User->>AppLayout: ページアクセス
    AppLayout->>AppHeader: ヘッダー描画
    AppLayout->>AppSidebar: サイドバー描画
    AppLayout->>PageContent: ページ固有コンテンツ描画
    AppLayout->>AppFooter: フッター描画
Loading
sequenceDiagram
    participant User
    participant WelcomeLayout
    participant WelcomeHeader
    participant WelcomeFooter
    participant PageContent

    User->>WelcomeLayout: トップ/認証系ページアクセス
    WelcomeLayout->>WelcomeHeader: ヘッダー描画
    WelcomeLayout->>PageContent: ページ固有コンテンツ描画
    WelcomeLayout->>WelcomeFooter: フッター描画
Loading

Poem

うさぎの耳でぴょんと跳ね、
新しいレイアウト、広がる夢。
ヘッダーもサイドバーもピカピカに、
ページごとに彩りを。
みんなのコードもすっきり快適、
ぴょんぴょん進化、うさぎも満足!
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-16T15_16_46_225Z-debug-0.log

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@supabase
Copy link
Copy Markdown

supabase bot commented Jun 16, 2025

Updates to Preview Branch (design-fix) ↗︎

Deployments Status Updated
Database Mon, 16 Jun 2025 15:15:32 UTC
Services Mon, 16 Jun 2025 15:15:32 UTC
APIs Mon, 16 Jun 2025 15:15:32 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Mon, 16 Jun 2025 15:15:33 UTC
Migrations Mon, 16 Jun 2025 15:15:37 UTC
Seeding Mon, 16 Jun 2025 15:15:40 UTC
Edge Functions Mon, 16 Jun 2025 15:15:44 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
src/app/docs/_components/Docs.tsx (2)

43-44: 日付表示はユーザーフレンドリーな形式へフォーマットを検討

doc.created_at が ISO 文字列の場合、そのまま表示すると可読性が低いです。dayjs 等で YYYY/MM/DD 形式へ整形するか、ロケールに合わせると UX が向上します。


30-48: ドキュメントが 0 件のケースで無表示になる

docs.length === 0 のときリストが空レンダリングとなり、ユーザーには読み込みが終わったのか分かりません。上記修正案のように「ドキュメントがありません」等のメッセージを表示してください。

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7c60076 and 593b21e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (44)
  • src/app/companies/_components/Companies.tsx (4 hunks)
  • src/app/companies/_components/NewCompanyForm.tsx (3 hunks)
  • src/app/companies/layout.tsx (1 hunks)
  • src/app/companies/new/page.tsx (1 hunks)
  • src/app/companies/page.tsx (1 hunks)
  • src/app/dashboard/layout.tsx (1 hunks)
  • src/app/dashboard/page.tsx (1 hunks)
  • src/app/docs/[id]/edit/page.tsx (3 hunks)
  • src/app/docs/[id]/page.tsx (2 hunks)
  • src/app/docs/_components/DocList.tsx (2 hunks)
  • src/app/docs/_components/Docs.tsx (1 hunks)
  • src/app/docs/layout.tsx (1 hunks)
  • src/app/docs/new/page.tsx (1 hunks)
  • src/app/docs/page.tsx (1 hunks)
  • src/app/jobs/layout.tsx (1 hunks)
  • src/app/jobs/page.tsx (1 hunks)
  • src/app/layout.tsx (1 hunks)
  • src/app/login/layout.tsx (1 hunks)
  • src/app/page.tsx (2 hunks)
  • src/app/privacy/layout.tsx (1 hunks)
  • src/app/signup/layout.tsx (1 hunks)
  • src/app/tos/layout.tsx (1 hunks)
  • src/app/welcome/_components/WelcomeBody.tsx (1 hunks)
  • src/components/AppFooter.tsx (1 hunks)
  • src/components/AppHeader.test.tsx (1 hunks)
  • src/components/AppHeader.tsx (1 hunks)
  • src/components/AppPageHeader.tsx (1 hunks)
  • src/components/AppSidebar.tsx (1 hunks)
  • src/components/Auth.tsx (1 hunks)
  • src/components/DocList.tsx (0 hunks)
  • src/components/Header.tsx (0 hunks)
  • src/components/Pagination.tsx (1 hunks)
  • src/components/Sidebar.tsx (0 hunks)
  • src/components/Welcome.tsx (0 hunks)
  • src/components/WelcomeFooter.tsx (2 hunks)
  • src/components/WelcomeHeader.tsx (1 hunks)
  • src/components/layouts/AppLayout.tsx (1 hunks)
  • src/components/layouts/MulitLayout.tsx (0 hunks)
  • src/components/layouts/SingleLayout.tsx (0 hunks)
  • src/components/layouts/WelcomeLayout.tsx (1 hunks)
  • src/components/ui/card.tsx (1 hunks)
  • src/components/ui/navigation-menu.tsx (1 hunks)
  • src/lib/supabase.ts (1 hunks)
  • tailwind.config.js (1 hunks)
💤 Files with no reviewable changes (6)
  • src/components/layouts/SingleLayout.tsx
  • src/components/Welcome.tsx
  • src/components/DocList.tsx
  • src/components/layouts/MulitLayout.tsx
  • src/components/Sidebar.tsx
  • src/components/Header.tsx
✅ Files skipped from review due to trivial changes (2)
  • tailwind.config.js
  • src/components/Auth.tsx
🚧 Files skipped from review as they are similar to previous changes (35)
  • src/app/layout.tsx
  • src/app/docs/[id]/edit/page.tsx
  • src/components/AppHeader.test.tsx
  • src/app/privacy/layout.tsx
  • src/app/jobs/layout.tsx
  • src/components/Pagination.tsx
  • src/components/ui/card.tsx
  • src/app/dashboard/layout.tsx
  • src/app/login/layout.tsx
  • src/components/WelcomeFooter.tsx
  • src/components/ui/navigation-menu.tsx
  • src/app/signup/layout.tsx
  • src/app/welcome/_components/WelcomeBody.tsx
  • src/app/jobs/page.tsx
  • src/components/layouts/WelcomeLayout.tsx
  • src/app/docs/layout.tsx
  • src/components/WelcomeHeader.tsx
  • src/app/page.tsx
  • src/app/dashboard/page.tsx
  • src/app/companies/layout.tsx
  • src/app/companies/page.tsx
  • src/app/companies/_components/Companies.tsx
  • src/components/AppHeader.tsx
  • src/components/AppSidebar.tsx
  • src/app/companies/new/page.tsx
  • src/components/AppFooter.tsx
  • src/app/docs/new/page.tsx
  • src/components/layouts/AppLayout.tsx
  • src/app/tos/layout.tsx
  • src/app/docs/[id]/page.tsx
  • src/components/AppPageHeader.tsx
  • src/app/docs/page.tsx
  • src/app/companies/_components/NewCompanyForm.tsx
  • src/lib/supabase.ts
  • src/app/docs/_components/DocList.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Supabase Preview
  • GitHub Check: test
  • GitHub Check: Supabase Preview

Comment on lines +34 to +38
<Card
key={doc.id}
className="w-full cursor-pointer"
onClick={() => handleCardClick(doc.id)}
>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

クリック可能なカードにアクセシビリティ属性を追加してください

div ベースの CardonClick を付与するとスクリーンリーダーでは操作可能要素と認識されず、キーボード操作も出来ません。role="button"tabIndex={0} を付与し、onKeyDownEnter/Space をハンドルするか、カード内部に <a> を配置する構造へ変更してください。

🤖 Prompt for AI Agents
In src/app/docs/_components/Docs.tsx around lines 34 to 38, the Card component
with an onClick handler lacks accessibility attributes, making it unusable by
screen readers and keyboard users. Add role="button" and tabIndex={0} to the
Card, and implement an onKeyDown handler that triggers handleCardClick(doc.id)
when Enter or Space keys are pressed. Alternatively, refactor the Card content
to include an internal <a> element for proper keyboard and screen reader
support.

Comment on lines +24 to +33
<Pagination
currentPage={currentPage}
totalPages={totalPages}
onPageChange={setCurrentPage}
/>
{loading ? (
<p>Loading...</p>
) : (
<div className="flex flex-col gap-4 w-full max-w-3xl">
{docs.map((doc) => (
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

loading フラグだけでは docsundefined を防ぎきれません

loadingfalse になった直後に docs がまだ undefined の可能性があります。useDocs 側で常に空配列を返す保証が無い限り、docs.map で実行時エラーが発生します。ハードクラッシュは UX を大きく損ねるので、防衛的にフォールバックを入れておくことを強く推奨します。

-      ) : (
-        <div className="flex flex-col gap-4 w-full max-w-3xl">
-          {docs.map((doc) => (
+      ) : docs && docs.length > 0 ? (
+        <div className="flex flex-col gap-4 w-full max-w-3xl">
+          {(docs ?? []).map((doc) => (
             …
           ))}
         </div>
+      ) : (
+        <p>ドキュメントがありません</p>
       )}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Pagination
currentPage={currentPage}
totalPages={totalPages}
onPageChange={setCurrentPage}
/>
{loading ? (
<p>Loading...</p>
) : (
<div className="flex flex-col gap-4 w-full max-w-3xl">
{docs.map((doc) => (
<Pagination
currentPage={currentPage}
totalPages={totalPages}
onPageChange={setCurrentPage}
/>
{loading ? (
<p>Loading...</p>
) : docs && docs.length > 0 ? (
<div className="flex flex-col gap-4 w-full max-w-3xl">
{(docs ?? []).map((doc) => (
// …your doc rendering here…
))}
</div>
) : (
<p>ドキュメントがありません</p>
)}
🤖 Prompt for AI Agents
In src/app/docs/_components/Docs.tsx around lines 24 to 33, the code assumes
docs is always defined when loading is false, but docs can still be undefined
causing a runtime error on docs.map. To fix this, add a defensive fallback by
ensuring docs is always an array before calling map, for example by defaulting
docs to an empty array or adding a conditional check before mapping. This
prevents crashes and improves UX.

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