Repository navigation
駅名表示をフォント縮小から横圧縮に変更 - #6066
駅名表示をフォント縮小から横圧縮に変更#6066
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughHeaderStationName を追加し、7 つの Header コンポーネント(E231、E235、East、JL、JRKyushu、JRWest、Saikyo)の駅名表示を HeaderStationName 呼び出しへ置換。calcStationNameMinScale と関連テストは削除され、測定ベースの scaleX で横圧縮する方式に移行しました。 Changes駅名表示コンポーネント化と Header 統一
Sequence Diagram(s)sequenceDiagram
participant Header as Header Component
participant HSN as HeaderStationName
participant Measure as Layout Measurement
participant TextComp as TextComponent (Typography/RNAnimated.Text)
Header->>HSN: text, textStyle, TextComponent
HSN->>Measure: onLayout (container width)
Measure-->>HSN: containerWidth
HSN->>TextComp: render (measure text width)
TextComp-->>Measure: textLayout event
Measure-->>HSN: textWidth
HSN->>HSN: calculate widthScale
HSN->>TextComp: apply scaleX transform
TextComp-->>Header: rendered station name
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/HeaderStationName.test.tsx (1)
5-74:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
afterEachでjest.clearAllMocks()を追加してください。このテストファイルではモック状態のクリア処理が未定義です。テスト分離のため
afterEach(() => jest.clearAllMocks())を追加してください。As per coding guidelines: "Jest のネットワークと Firebase レイヤーはjest.mockでモック化してください / テストのafterEachでjest.clearAllMocks()を呼び出してください".💡 Suggested fix
describe('HeaderStationName', () => { + afterEach(() => { + jest.clearAllMocks(); + }); + it('keeps the font size and compresses text width when the station name is wider than its container', () => {🤖 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/HeaderStationName.test.tsx` around lines 5 - 74, Add a per-test cleanup to the HeaderStationName test suite by inserting afterEach(() => jest.clearAllMocks()) inside the describe('HeaderStationName', ...) block (so it runs after each it block); this will clear all Jest mocks between tests and ensure tests like the ones invoking render, fireEvent, UNSAFE_getAllByType and getAllByText run in isolation.
🤖 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/components/HeaderStationName.tsx`:
- Around line 97-106: The invisible measurement TextComponent is still exposed
to the accessibility tree causing duplicate screen-reader output; update the
TextComponent (the one using textProps, onLayout={handleTextFallbackLayout},
onTextLayout={handleTextLayout}, style={[textStyle, styles.measureText]}) to
explicitly exclude it from accessibility by adding accessible={false} and
importantForAccessibility='no-hide-descendants' to the component props.
---
Outside diff comments:
In `@src/components/HeaderStationName.test.tsx`:
- Around line 5-74: Add a per-test cleanup to the HeaderStationName test suite
by inserting afterEach(() => jest.clearAllMocks()) inside the
describe('HeaderStationName', ...) block (so it runs after each it block); this
will clear all Jest mocks between tests and ensure tests like the ones invoking
render, fireEvent, UNSAFE_getAllByType and getAllByText run in isolation.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 29d70c02-abab-48cd-8c97-fdb8a8952b4b
📒 Files selected for processing (12)
src/components/HeaderE231.tsxsrc/components/HeaderE235.tsxsrc/components/HeaderEast/HeaderEast.tsxsrc/components/HeaderJL.tsxsrc/components/HeaderJRKyushu.tsxsrc/components/HeaderJRWest.tsxsrc/components/HeaderSaikyo.tsxsrc/components/HeaderStationName.test.tsxsrc/components/HeaderStationName.tsxsrc/utils/getStationNameScale.tssrc/utils/stationNameScale.test.tssrc/utils/stationNameScale.ts
💤 Files with no reviewable changes (3)
- src/utils/stationNameScale.ts
- src/utils/stationNameScale.test.ts
- src/utils/getStationNameScale.ts
Fixes Applied SuccessfullyFixed 2 file(s) based on 2 CodeRabbit feedback item(s). Files modified:
Commit: The latest autofix changes are on the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/components/HeaderStationName.tsx`:
- Line 100: In HeaderStationName.tsx change the JSX attribute
importantForAccessibility="no-hide-descendants" to use single quotes per repo
style; locate the JSX element that sets importantForAccessibility (attribute
name: importantForAccessibility) and replace the double-quoted value with a
single-quoted value 'no-hide-descendants' to align with the project's quote
rules.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 63b8c45f-5f7d-42f3-a526-0d7b10faccbe
📒 Files selected for processing (2)
src/components/HeaderStationName.test.tsxsrc/components/HeaderStationName.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
- src/components/HeaderStationName.test.tsx
Fixes Applied SuccessfullyFixed 1 file(s) based on 1 CodeRabbit feedback item(s). Files modified:
Commit: The latest autofix changes are on the |
|
Actionable comments posted: 0 |
概要
駅名が長い場合にフォントサイズを縮小する処理を撤廃し、実際の電車案内のように駅名の横幅を圧縮して表示するように変更しました。
変更の種類
変更内容
HeaderStationNameを追加テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること実行コマンド:
関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
Refactor
Tests