Skip to content

意味もなくTextコンポーネントを使用している箇所をTypographyに置換 - #5789

Merged
TinyKitten merged 3 commits into
devfrom
feature/replace-text-with-typography
Apr 8, 2026
Merged

TinyKitten merged 3 commits into
devfrom
feature/replace-text-with-typography

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Apr 8, 2026 •

Copy link
Copy Markdown
Member

Summary

  • HeaderE231.tsx / HeaderJRKyushu.tsx / LineBoardLED.tsx / FatalErrorScreen.tsx で意味もなく react-native の Text を使っていた箇所を Typography に置き換え
  • HeaderJRKyushu.tsx の RNAnimated.Text はアニメーションに必要なためそのまま残し、内側にネストされていた Text のみ Typography へ
  • src/index.tsx の Text.defaultProps セットアップは保険として残存、テストファイル内の Text 参照も未変更

Test plan

  • `npx biome check --unsafe --fix` (対象4ファイル)
  • `npx tsc --noEmit`
  • `npx jest src/components/LineBoardLED.test.tsx`

🤖 Generated with Claude Code

Summary by CodeRabbit

リリースノート

  • Refactor

    • テキスト表示コンポーネントを統一し、複数の画面コンポーネントで一貫性を向上しました。
  • Tests

    • テスト環境のモック設定を拡張し、より包括的なテストケースに対応しました。

@github-actions github-actions Bot added the react label Apr 8, 2026
@coderabbitai

coderabbitai Bot commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

複数のコンポーネントファイルでReact NativeのTextコンポーネントをカスタムTypographyコンポーネントに置き換え、対応するインポートを更新しました。また、テストファイルではJotaiのモック実装を拡張し、atom、useAtom、useSetAtomの定義を追加しました。

Changes

Cohort / File(s) Summary
TextからTypographyへの置き換え
src/components/HeaderE231.tsx, src/components/HeaderJRKyushu.tsx, src/components/LineBoardLED.tsx
すべてのReact Native Text使用をカスタムTypographyコンポーネントに置き換え。adjustsFontSizeToFitとnumberOfLinesのプロップは保持され、既存のスタイル適用も維持されました。Textインポートを削除しTypographyをインポート。
Jotaiモック実装の拡張
src/components/HeaderE231.test.tsx, src/components/HeaderJRKyushu.test.tsx
Jotaiモジュールのモック定義を拡張。atom、useAtom、useSetAtomの実装を追加し、テスト時のJotai APIサーフェス対応を改善。既存のuseAtomValueの動作は変更なし。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Text から Typography へ、
兎が運ぶ整理の波。
コンポーネント統一して、
テストも強く整備して、
コード美しく花開く! 🌸

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed PR タイトルは主な変更内容(TextコンポーネントをTypographyに置換すること)を明確かつ簡潔に説明しており、変更セットと完全に一致している。
Description check ✅ Passed 提供されたPR説明は、テンプレートの主要セクション(概要・変更内容・テスト)を含んでいるが、テンプレートで要求されている「変更の種類」チェックボックスが未記入で、「関連Issue」セクションが欠けている。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/replace-text-with-typography

Comment @coderabbitai help to get the list of available commands and usage tips.

@TinyKitten TinyKitten self-assigned this Apr 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/HeaderJRKyushu.test.tsx (1)

20-22: Jotaiモックは共通ヘルパー化を検討してください。

HeaderE231.test.tsx と同型の atom / useAtom / useSetAtom モックが重複しているため、src/utils/test/ に共通化すると差分追従が楽になります。

As per coding guidelines "Reuse helper utilities from src/utils/test/ to avoid duplicate setup code".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/HeaderJRKyushu.test.tsx` around lines 20 - 22, Extract the
duplicated jest mocks (atom, useAtom, useSetAtom) into a shared test helper
(e.g., export const jotaiMocks or createJotaiMocks from a new module under
src/utils/test/) and replace the inline mocks in HeaderJRKyushu.test.tsx (the
atom, useAtom, useSetAtom entries) with imports from that helper; also update
the other test (HeaderE231.test.tsx) to import the same helper so both tests
reuse the single mock implementation and avoid duplication.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/HeaderJRKyushu.test.tsx`:
- Around line 20-22: Extract the duplicated jest mocks (atom, useAtom,
useSetAtom) into a shared test helper (e.g., export const jotaiMocks or
createJotaiMocks from a new module under src/utils/test/) and replace the inline
mocks in HeaderJRKyushu.test.tsx (the atom, useAtom, useSetAtom entries) with
imports from that helper; also update the other test (HeaderE231.test.tsx) to
import the same helper so both tests reuse the single mock implementation and
avoid duplication.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0b2406bc-a607-4f6d-8193-316e94f8dd62

📥 Commits

Reviewing files that changed from the base of the PR and between 6fc994a and 69abe2e.

📒 Files selected for processing (2)
  • src/components/HeaderE231.test.tsx
  • src/components/HeaderJRKyushu.test.tsx

@TinyKitten
TinyKitten merged commit 557c7bf into dev Apr 8, 2026
5 checks passed
@TinyKitten
TinyKitten deleted the feature/replace-text-with-typography branch April 8, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant