Feature/#16 screen mock insite#20
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
WalkthroughESLintでas以外の型アサーションを禁止し型安全化を行い、Insightsタブとスクリーン(レイアウト、Journal選択、StatsList、統計カード群、チャート整形ユーティリティ)を追加、ExploreのChartDemoを削除、関連ドキュメントを更新しました。 ChangesInsights画面実装
🎯 4 (Complex) | ⏱️ ~75 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/app/(journal)/entry/create.tsx (1)
21-21:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
useLiveQueryに依存配列を追加してください。
journalIdは動的なパラメータですが、useLiveQueryの第2引数に依存配列が渡されていません。コーディング規約により、動的な引数を渡す場合は依存配列が必須です。journalIdが変更された際にクエリが再実行されない可能性があります。🔧 修正案
- const { data: fields } = useLiveQuery(getFieldsQuery(journalId)); + const { data: fields } = useLiveQuery(getFieldsQuery(journalId), [journalId]);コーディング規約:
useLiveQueryに動的な引数を渡す場合は第2引数に依存配列を渡す🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/`(journal)/entry/create.tsx at line 21, The useLiveQuery call (const { data: fields } = useLiveQuery(getFieldsQuery(journalId))) is missing a dependency array for the dynamic journalId; update the call to pass a second argument dependency array that includes journalId (e.g., useLiveQuery(getFieldsQuery(journalId), [journalId])) so the query re-executes when journalId changes and adheres to the project's rule about dynamic args.
🧹 Nitpick comments (2)
src/components/app-tabs.tsx (1)
10-10: 💤 Low valueエクスポートされるコンポーネントに JSDoc を追加することを推奨します。
コーディング規約では、エクスポートされる関数・コンポーネントには JSDoc コメントを記載することが推奨されています。
📝 JSDoc 追加例
+/** + * ネイティブタブナビゲーション + * Journal タブと Insights タブを提供します + */ export default function AppTabs() {コーディング規約: エクスポートされる関数・コンポーネントには JSDoc(
/** ... */)を記載する🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/app-tabs.tsx` at line 10, エクスポートされるコンポーネント AppTabs に JSDoc コメントを追加してください — コンポーネントの目的を一行で説明し、受け取る props があればそれらの型と説明を `@param` で、戻り値が React.ReactElement であることを `@returns` で明記してください(例: /** コンポーネント説明. `@param` props - ... `@returns` React.ReactElement */)。JSDoc は関数宣言直前に配置し、既存の型注釈(もしあれば)と整合させてください。src/app/insights/_layout.tsx (1)
1-7: ⚡ Quick winヘッダータイトル色は
PlatformColor("label")を直接使ってください。Line 6-7 で
useColorScheme()とハードコード色を使っており、規約のアダプティブカラー方針から外れています。headerTitleStyle.colorはPlatformColor("label")で統一してください。修正案
-import { useColorScheme } from "react-native"; +import { PlatformColor } from "react-native"; @@ export default function InsightsLayout() { - const colorScheme = useColorScheme(); - const titleColor = colorScheme === "dark" ? "`#ffffff`" : "`#000000`"; - return ( <Stack screenOptions={{ headerTransparent: true, headerTitleStyle: { - color: titleColor, + color: PlatformColor("label"), }, headerBackButtonDisplayMode: "minimal", }} /> ); }As per coding guidelines
Use PlatformColor("label") directly for adaptive colors — no need for useColorScheme.Also applies to: 13-15
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/app/insights/_layout.tsx` around lines 1 - 7, Replace the ad-hoc color handling in InsightsLayout by removing useColorScheme and titleColor and set headerTitleStyle.color to PlatformColor("label") directly; specifically, in the InsightsLayout component remove the useColorScheme import and variable (useColorScheme, titleColor) and update any usage of titleColor (e.g., headerTitleStyle.color) to PlatformColor("label") so the header uses the adaptive system color consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/app/insights/index.tsx`:
- Around line 1-3: The header right button handler in unstable_headerRightItems
is still calling console.log("test") so it doesn't navigate; import useRouter
from "expo-router", call const router = useRouter() inside the Insights page
component, and replace the onPress handler in unstable_headerRightItems with
router.push("/(journal)/create") so the "Create New Journal" button navigates
correctly (look for unstable_headerRightItems and InsightsView in this file to
apply the change).
In `@src/components/entry/entry-list-view.tsx`:
- Line 103: The tintColor uses a misspelled semantic color name
PlatformColor("systemGra1y3") which must exactly match native semantic names;
replace the string "systemGra1y3" with "systemGray3" where
PlatformColor("systemGra1y3") is used (the tintColor assignment in EntryListView
/ entry-list-view.tsx) so the call becomes
PlatformColor("systemGray3").toString().
In `@src/components/insights/insights-view.tsx`:
- Around line 28-30: The fallback for accentColor currently uses
PlatformColor("systemIndigo").toString(), which may not produce a usable string;
update the logic in the activeJournalData/accentColor assignment to ensure
accentColor is always a string by replacing the PlatformColor fallback with an
explicit hex color (e.g. "`#007AFF`") and keep using activeJournalData?.color when
present; adjust any related typing if necessary and remove reliance on
PlatformColor().toString() in the accentColor expression.
In `@src/components/insights/stat-filed-item.tsx`:
- Around line 11-14: Add a JSDoc block for the exported type FieldValueEntry
describing the purpose of the type and each field: document that createdAt is a
Unix timestamp number and value is a string or null (nullable), include a short
summary sentence and `@property` tags for createdAt and value so the exported type
(FieldValueEntry) follows the project coding guidelines.
---
Outside diff comments:
In `@src/app/`(journal)/entry/create.tsx:
- Line 21: The useLiveQuery call (const { data: fields } =
useLiveQuery(getFieldsQuery(journalId))) is missing a dependency array for the
dynamic journalId; update the call to pass a second argument dependency array
that includes journalId (e.g., useLiveQuery(getFieldsQuery(journalId),
[journalId])) so the query re-executes when journalId changes and adheres to the
project's rule about dynamic args.
---
Nitpick comments:
In `@src/app/insights/_layout.tsx`:
- Around line 1-7: Replace the ad-hoc color handling in InsightsLayout by
removing useColorScheme and titleColor and set headerTitleStyle.color to
PlatformColor("label") directly; specifically, in the InsightsLayout component
remove the useColorScheme import and variable (useColorScheme, titleColor) and
update any usage of titleColor (e.g., headerTitleStyle.color) to
PlatformColor("label") so the header uses the adaptive system color
consistently.
In `@src/components/app-tabs.tsx`:
- Line 10: エクスポートされるコンポーネント AppTabs に JSDoc コメントを追加してください —
コンポーネントの目的を一行で説明し、受け取る props があればそれらの型と説明を `@param` で、戻り値が React.ReactElement
であることを `@returns` で明記してください(例: /** コンポーネント説明. `@param` props - ... `@returns`
React.ReactElement */)。JSDoc は関数宣言直前に配置し、既存の型注釈(もしあれば)と整合させてください。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 407d776c-5772-4404-939c-98cba6116cb9
📒 Files selected for processing (28)
CLAUDE.mdeslint.config.jssrc/app/(journal)/create.tsxsrc/app/(journal)/edit.tsxsrc/app/(journal)/entry/[id].tsxsrc/app/(journal)/entry/create.tsxsrc/app/explore.tsxsrc/app/insights/_layout.tsxsrc/app/insights/index.tsxsrc/components/app-tabs.tsxsrc/components/chart-demo.tsxsrc/components/entry/entry-field-item.tsxsrc/components/entry/entry-list-view.tsxsrc/components/insights/insights-view.tsxsrc/components/insights/journal-chip.tsxsrc/components/insights/stat-card-check.tsxsrc/components/insights/stat-card-date.tsxsrc/components/insights/stat-card-long-text.tsxsrc/components/insights/stat-card-number.tsxsrc/components/insights/stat-card-text.tsxsrc/components/insights/stat-card-time.tsxsrc/components/insights/stat-card.tsxsrc/components/insights/stat-filed-item.tsxsrc/components/insights/stats-list.tsxsrc/components/insights/weekly-summary-card.tsxsrc/utils/entry/preview.tssrc/utils/insights/chart-format.tssrc/utils/journal/use-journal-field.ts
💤 Files with no reviewable changes (2)
- src/components/chart-demo.tsx
- src/app/explore.tsx
概要
実施した内容
insight画面のモック実装
チェックリスト
備考
関連 Issue
Closes #16
Summary by CodeRabbit
New Features
Improvements
Refactor
Documentation