Skip to content

Comments

Search field component#38

Merged
Tealands merged 7 commits intomainfrom
SearchFieldComponent
Dec 22, 2025
Merged

Search field component#38
Tealands merged 7 commits intomainfrom
SearchFieldComponent

Conversation

@Tealands
Copy link
Owner

No description provided.

@Tealands Tealands self-assigned this Dec 16, 2025
@Tealands Tealands linked an issue Dec 16, 2025 that may be closed by this pull request
@cloudflare-workers-and-pages
Copy link
Contributor

cloudflare-workers-and-pages bot commented Dec 16, 2025

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
group-a 584e8da Commit Preview URL

Branch Preview URL
Dec 22 2025, 10:23 AM

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

このPRはマンガ検索サイトに検索フィールドコンポーネントを追加するものです。主な変更点は以下の通りです:

  • 新しいSearchFieldコンポーネントの実装
  • Tailwind CSS設定の更新(v4からv3スタイルへの移行)
  • Playwrightテストインフラの追加
  • README.mdへのデプロイ情報とデモンストレーション手順の追加

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/components/SearchField.jsx 検索入力フィールドとボタンを含む新しいコンポーネント
src/App.jsx SearchFieldコンポーネントの統合と検索クエリの状態管理
src/index.css Tailwind CSSのインポート方法をv3スタイルに変更
tailwind.config.cjs Tailwind CSS設定ファイルの追加
playwright.config.ts Playwrightテスト設定の追加
tests/recommended.spec.ts RecommendedMangaコンポーネントのE2Eテスト
package.json テストスクリプトの追加とdependenciesの更新
test-results/.last-run.json テスト結果ファイル(gitignore対象外)
test-artifacts/recommended.png テスト生成スクリーンショット(gitignore対象外)
README.md サイトリンクとデモ手順の追加
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Comment on lines +25 to +30
<button
onClick={handleSearch}
className="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500"
>
検索する
</button>
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

検索ボタンにaria-labelがありません。また、Enterキーでも検索が実行できるようonKeyPressまたはonSubmit(formタグを使用)のサポートを追加することをお勧めします。これによりキーボードナビゲーションが改善されます。

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
{
"status": "passed",
"failedTests": []
} No newline at end of file
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

test-artifactsディレクトリ(スクリーンショットやテスト結果)はバージョン管理対象外にすべきです。.gitignoreファイルにtest-artifacts/test-results/を追加することを推奨します。

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 35
import { useState } from "react";

function SearchField({ onSearch = () => {} }) {
const [query, setQuery] = useState("");

const handleInputChange = (e) => {
setQuery(e.target.value);
};

const handleSearch = () => {
// onSearch にデフォルト no-op を設定しているため安心して呼び出せる
onSearch(query);
};

return (
//入力欄とボタンのコンポーネント
<div className="flex items-center space-x-2 mb-6">
<input
type="text"
value={query}
onChange={handleInputChange}
placeholder="漫画を検索..."
className="flex-grow p-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<button
onClick={handleSearch}
className="px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500"
>
検索する
</button>
</div>
);
}

export default SearchField;
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

新しいSearchFieldコンポーネントに対するテストが不足しています。tests/recommended.spec.tsはRecommendedMangaコンポーネントのみをテストしており、SearchField自体の機能(入力、ボタンクリック、onSearchコールバック)をテストしていません。SearchFieldコンポーネントのE2Eテストまたはユニットテストを追加してください。

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +41
<RecommendedManga searchQuery={searchQuery} />
<SearchField onSearch={handleSearch} />
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

SearchFieldコンポーネントがRecommendedMangaコンポーネントの後に配置されています。通常、検索フィールドはコンテンツを絞り込むために使用されるため、フィルタリング対象のコンテンツの前に配置するべきです。RecommendedMangaの前に移動することを推奨します。

Copilot generated this review using guidance from repository custom instructions.
Click on the Vite and React logos to learn more
</p>
<RecommendedManga />
<RecommendedManga searchQuery={searchQuery} />
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

RecommendedMangaコンポーネントにsearchQueryプロパティを渡していますが、RecommendedMangaの実装ではこのプロパティを受け取っていません。このため、検索機能が実際には動作しません。RecommendedMangaコンポーネントを更新してsearchQueryプロパティを受け取り、mangaListをフィルタリングする実装が必要です。

Copilot uses AI. Check for mistakes.
value={query}
onChange={handleInputChange}
placeholder="漫画を検索..."
className="flex-grow p-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

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

入力フィールドにaria-labelまたはlabelタグが関連付けられていません。スクリーンリーダー利用者のために、適切なアクセシビリティ属性を追加してください。例: aria-label="漫画を検索"

Suggested change
className="flex-grow p-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
className="flex-grow p-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
aria-label="漫画を検索"

Copilot uses AI. Check for mistakes.
@zerozero-0-0
Copy link
Collaborator

2025-12-16T01:28:29.040Z	Initializing build environment...
2025-12-16T01:28:30.808Z	Success: Finished initializing build environment
2025-12-16T01:28:31.200Z	Cloning repository...
2025-12-16T01:28:32.167Z	Restoring from dependencies cache
2025-12-16T01:28:32.169Z	Restoring from build output cache
2025-12-16T01:28:32.172Z	Detected the following tools from environment: pnpm@10.11.1, nodejs@22.16.0
2025-12-16T01:28:32.337Z	SKIP_DEPENDENCY_INSTALL is present in environment. Skipping automatic dependency installation.
2025-12-16T01:28:32.458Z	Executing user build command: corepack enable
pnpm install --frozen-lockfile
pnpm run build
2025-12-16T01:28:33.586Z	Lockfile is up to date, resolution step is skipped
2025-12-16T01:28:33.613Z	 ERR_PNPM_LOCKFILE_MISSING_DEPENDENCY  Broken lockfile: no entry for 'fraction.js@5.3.4' in pnpm-lock.yaml
2025-12-16T01:28:33.613Z	
2025-12-16T01:28:33.613Z	This issue is probably caused by a badly resolved merge conflict.
2025-12-16T01:28:33.613Z	To fix the lockfile, run 'pnpm install --no-frozen-lockfile'.
2025-12-16T01:28:34.151Z	
2025-12-16T01:28:34.151Z	> groupa@0.0.0 build /opt/buildhome/repo
2025-12-16T01:28:34.151Z	> vite build
2025-12-16T01:28:34.152Z	
2025-12-16T01:28:34.154Z	sh: 1: vite: not found
2025-12-16T01:28:34.156Z	 ELIFECYCLE  Command failed.
2025-12-16T01:28:34.157Z	 WARN   Local package.json exists, but node_modules missing, did you mean to install?
2025-12-16T01:28:34.180Z	Failed: error occurred while running build command

↑Cloudflareのログ

fraction.jsをnpm install してそう
pnpm add してほしい(でなければpnpm-lock.yamlが更新されない)

ので一回fraction.jsパッケージを取り除いてpnpmで入れなおして
pnpm-lock.yamlが更新されてればビルドに通るはず
@Tealands

@zerozero-0-0
Copy link
Collaborator

あとCopilotにReviewしておいたので直しておいて
異論あれば俺に言って(Copilotは対話できないので)

@Tealands Tealands merged commit 95d8f6c into main Dec 22, 2025
5 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.

入力欄コンポーネント

2 participants