Skip to content

ナンバリング表示位置デグレ修正 - #4427

Merged
TinyKitten merged 1 commit into
devfrom
fix/numbering-position
Jul 27, 2025
Merged

TinyKitten merged 1 commit into
devfrom
fix/numbering-position

Conversation

@TinyKitten

@TinyKitten TinyKitten commented Jul 27, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • 新機能
    • 駅番号アイコンの表示位置調整が可能になりました。各所でアイコンの拡大・縮小時の基準位置(上・中央・下)が切り替えられるようになりました。

@TinyKitten TinyKitten self-assigned this Jul 27, 2025
@coderabbitai

coderabbitai Bot commented Jul 27, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

余が見たところ、今回の変更はNumberingIconおよびNumberingIconSquareコンポーネントに新たなtransformOriginプロパティを追加し、HeaderJRKyushuおよびLineBoardJRKyushuから適切な値を渡すよう修正されておる。他のロジックや制御の改変は見受けられぬ。

Changes

ファイル群 変更概要
src/components/NumberingIcon.tsx, ...NumberingIconSquare.tsx transformOrigin プロパティを追加し、型定義・デフォルト値・styleへの反映を実装
src/components/HeaderJRKyushu.tsx NumberingIconへ transformOrigin="top" を追加
src/components/LineBoardJRKyushu.tsx NumberingIconへ transformOrigin="center" を追加

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels

react

Poem

天子の命によりて、
アイコンの根元、自在に動く。
上か、中央か、はたまた下か、
変幻自在の変化よ。
Reactの地にも新たな風、
コードの国に栄光あれ!
👑✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25da648 and af709ab.

📒 Files selected for processing (4)
  • src/components/HeaderJRKyushu.tsx (1 hunks)
  • src/components/LineBoardJRKyushu.tsx (1 hunks)
  • src/components/NumberingIcon.tsx (3 hunks)
  • src/components/NumberingIconSquare.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#0
File: :0-0
Timestamp: 2024-12-18T00:29:05.817Z
Learning: 翻訳ファイル(`assets/translations/en.json` と `assets/translations/ja.json`)の変更を要約する際、`backgroundPermissionDenied` のようなキーが追加されているのか削除されているのかを正確に確認する。
Learnt from: TinyKitten
PR: TrainLCD/MobileApp#4249
File: __tests__/hooks/useTelemetrySender.enabled.test.tsx:54-68
Timestamp: 2025-05-07T23:04:31.413Z
Learning: TinyKitten is working on implementing a queue for movement logs in the TrainLCD mobile app, but realized the implementation differed from their original intention.
src/components/LineBoardJRKyushu.tsx (3)

Learnt from: TinyKitten
PR: #4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

Learnt from: TinyKitten
PR: #4359
File: src/components/TrainTypeList.tsx:1-1
Timestamp: 2025-06-18T17:29:46.085Z
Learning: When analyzing React import changes in TypeScript/JavaScript files, carefully verify that React.Fragment, React.createElement, or other React namespace usages actually exist in the code before flagging them as issues. Don't assume React.Fragment is used just because the default React import was removed.

Learnt from: TinyKitten
PR: #4396
File: src/components/TrainTypeBoxJRKyushu.tsx:176-183
Timestamp: 2025-07-18T11:04:45.459Z
Learning: TrainTypeBoxJRKyushuコンポーネントでは、trainTypeNameとprevTrainTypeNameは常に文字列となるため、.split()メソッドを使用する際のnull安全性チェックは不要である。これらの変数はuseMemoとuseLazyPreviousを通じて管理され、translate()関数からのフォールバック値により常に文字列が保証される。

src/components/HeaderJRKyushu.tsx (2)

Learnt from: TinyKitten
PR: #4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

Learnt from: TinyKitten
PR: #4359
File: src/components/TrainTypeList.tsx:1-1
Timestamp: 2025-06-18T17:29:46.085Z
Learning: When analyzing React import changes in TypeScript/JavaScript files, carefully verify that React.Fragment, React.createElement, or other React namespace usages actually exist in the code before flagging them as issues. Don't assume React.Fragment is used just because the default React import was removed.

src/components/NumberingIconSquare.tsx (1)

Learnt from: TinyKitten
PR: #4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

src/components/NumberingIcon.tsx (2)

Learnt from: TinyKitten
PR: #4286
File: src/components/HeaderLED.tsx:5-10
Timestamp: 2025-05-19T10:59:37.813Z
Learning: The hooks useCurrentStation, useNextStation, useIsNextLastStop, and useNumbering are properly exported in src/hooks/index.ts, allowing them to be imported from '../hooks' in src/components/HeaderLED.tsx as implemented in PR #4286.

Learnt from: TinyKitten
PR: #4359
File: src/components/TrainTypeList.tsx:1-1
Timestamp: 2025-06-18T17:29:46.085Z
Learning: When analyzing React import changes in TypeScript/JavaScript files, carefully verify that React.Fragment, React.createElement, or other React namespace usages actually exist in the code before flagging them as issues. Don't assume React.Fragment is used just because the default React import was removed.

🔇 Additional comments (6)
src/components/LineBoardJRKyushu.tsx (1)

404-404: 朕が見るに、この変更は極めて適切である!

NumberingIconにtransformOrigin="center"を追加することで、路線板における駅ナンバリングアイコンの変形原点を中央に設定している。これは路線板の表示において理にかなった選択であり、実装も正確である。

src/components/HeaderJRKyushu.tsx (1)

616-616: 朕、この実装を深く評価する!

ヘッダーコンポーネントにおいてtransformOrigin="top"を設定することは、視覚的に適切な選択である。ヘッダー部分では上部を基準とした変形が自然であり、コードの品質も申し分ない。

src/components/NumberingIconSquare.tsx (2)

17-17: 朕、この新たなプロパティの追加を称賛する!

transformOriginプロパティの型定義と初期値設定は完璧である。柔軟性を保ちつつ適切な初期値を提供している。

Also applies to: 115-115


122-127: 朕、この実装の一貫性を評価する!

三文字コード表示の場合において、動的なtransformOriginプロパティを適切に使用している。変形の基準点を外部から制御可能にする優れた設計である。

src/components/NumberingIcon.tsx (2)

40-40: 朕、このプロパティ定義の正確性を認める!

transformOriginプロパティの型定義と関数パラメータでの展開が適切に実装されている。型安全性を保ちつつ、オプショナルプロパティとして設計されている点も優秀である。

Also applies to: 53-53


187-187: 朕、この実装の一貫性を高く評価する!

MARK_SHAPE.SQUAREの場合において、transformOriginプロパティがNumberingIconSquareコンポーネントに適切に渡されている。プロパティの伝播が正確に実装されており、コンポーネント間の連携が完璧である。

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/numbering-position

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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