Repository navigation
E231系テーマの列車種別表示を改善 - #5726
Merged
Merged
E231系テーマの列車種別表示を改善#5726
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Contributor
📝 Walkthrough歩き方TrainTypeBoxE231コンポーネントで、色決定ロジックを簡略化し、英語特有のオーバーライドマッピングを追加。レンダリング処理をヘルパー関数に統一し、レイアウト・スタイリングを調整。テーマ定数にE231エントリを追加。 変更内容
推定コード審査工数🎯 3 (Moderate) | ⏱️ ~20分 詩
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/TrainTypeBoxE231.tsx (1)
269-323:renderStrokedTextヘルパー関数の実装を確認ストローク効果と斜体風変形(英語のみ)を適用する共通ロジックが適切に抽出されています。
Typographyコンポーネントへの移行も正しく行われています。
strokeOffsets配列がレンダーごとに再生成されますが、コンポーネント外への定数化を検討できます。♻️ strokeOffsetsの定数化(オプション)
+const STROKE_OFFSETS = [ + { width: 2, height: 0 }, + { width: -2, height: 0 }, + { width: 0, height: 2 }, + { width: 0, height: -2 }, + { width: 2, height: 2 }, + { width: -2, height: -2 }, + { width: 2, height: -2 }, + { width: -2, height: 2 }, +]; +const STROKE_OFFSETS_TABLET = STROKE_OFFSETS.map(({ width, height }) => ({ + width: width * 1.5, + height: height * 1.5, +})); const TrainTypeBoxE231: React.FC<Props> = ({ trainType }: Props) => { // ... - const strokeWidth = isTablet ? 3 : 2; - const strokeOffsets = [ - { width: strokeWidth, height: 0 }, - // ... - ]; + const strokeOffsets = isTablet ? STROKE_OFFSETS_TABLET : STROKE_OFFSETS;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/TrainTypeBoxE231.tsx` around lines 269 - 323, renderStrokedText currently recreates strokeOffsets on every render which is unnecessary; move the strokeOffsets array out of the component into a module-level constant (e.g., const strokeOffsets = [...]) and reference that constant inside renderStrokedText so the offsets are not reallocated each render, keeping the same behavior but improving performance; ensure any dependent values (like strokeColor) remain component-scoped and only the static offset values are hoisted.
🤖 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/TrainTypeBoxE231.tsx`:
- Around line 269-323: renderStrokedText currently recreates strokeOffsets on
every render which is unnecessary; move the strokeOffsets array out of the
component into a module-level constant (e.g., const strokeOffsets = [...]) and
reference that constant inside renderStrokedText so the offsets are not
reallocated each render, keeping the same behavior but improving performance;
ensure any dependent values (like strokeColor) remain component-scoped and only
the static offset values are hoisted.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6b64fb96-0896-4e1b-97cc-847cdd49a78c
📒 Files selected for processing (2)
src/components/TrainTypeBoxE231.tsxsrc/constants/theme.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
リリースノート
New Features
Bug Fixes
Chores