Repository navigation
設定モーダルのボタンでカッコ内テキストを本文より小さく表示する - #5950
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)
📝 WalkthroughWalkthroughSelectBoundSettingListModalで、括弧内の部分を小さく太字で表示する新スタイルと、括弧を検出して分割・レンダリングするヘルパーを追加し、trainTypeNameとthemeLabelの出力に適用しています。 変更内容括弧付きテキストスタイル
🎯 2 (Simple) | ⏱️ ~8分
🚥 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)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/SelectBoundSettingListModal.tsx (1)
85-96: ⚡ Quick win全角カッコ(
(...))が縮小対象から漏れる可能性があります。Line 86 と Line 88 の正規表現は半角
()のみ対象です。日本語ラベルで全角カッコが混在すると縮小表示されないため、両対応にしておくのが安全です。#!/bin/bash # 目的: # 1) この画面で使う翻訳キーの定義周辺を確認 # 2) リポジトリ内に全角カッコ文字列がどの程度存在するか確認 # 期待: # - trainTypeDefault / autoTheme が全角カッコを含む場合、現状ロジックだと縮小されない可能性を確認できる rg -n -C2 "trainTypeDefault|autoTheme" src rg -n --iglob '*.{ts,tsx,js,jsx,json,yml,yaml}' '([^)]*)' src修正案(差分)
-const renderWithSmallParens = (text: string) => { - const parts = text.split(/(\([^)]*\))/); +const renderWithSmallParens = (text: string) => { + const parts = text.split(/([((][^))]*[))])/); return parts.map((part, index) => - /^\(.*\)$/.test(part) ? ( + /^(?:\([^)]*\)|([^)]*))$/.test(part) ? ( <Typography key={`${index}-${part}`} style={styles.trainTypeNameParens}> {part} </Typography> ) : ( part ) ); };🤖 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/SelectBoundSettingListModal.tsx` around lines 85 - 96, The split/regex logic in renderWithSmallParens only handles halfwidth parentheses so fullwidth Japanese parentheses won’t be matched; update the regexes used in renderWithSmallParens (the split regex /(\([^)]*\))/ and the test /^\(.*\)$/ ) to accept both halfwidth and fullwidth parens (e.g. use a character class like [()()] in both the split and the test) so parts that are wrapped in (...) also render with styles.trainTypeNameParens inside the Typography element.
🤖 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.
Nitpick comments:
In `@src/components/SelectBoundSettingListModal.tsx`:
- Around line 85-96: The split/regex logic in renderWithSmallParens only handles
halfwidth parentheses so fullwidth Japanese parentheses won’t be matched; update
the regexes used in renderWithSmallParens (the split regex /(\([^)]*\))/ and the
test /^\(.*\)$/ ) to accept both halfwidth and fullwidth parens (e.g. use a
character class like [()()] in both the split and the test) so parts that are
wrapped in (...) also render with styles.trainTypeNameParens inside the
Typography element.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c71acdd1-572d-4ea7-9d85-f7f846afd120
📒 Files selected for processing (1)
src/components/SelectBoundSettingListModal.tsx
概要
設定モーダル(
SelectBoundSettingListModal)の「列車種別」「テーマ」ボタンに表示されるテキストで、カッコ内の文字が本文と同じフォントサイズで描画されてしまう不具合を修正しました。CommonCard系のモーダルではすでにカッコ内を小さく表示する処理が入っていましたが、本モーダルでは独自レンダリングのため対象外になっていました。変更の種類
変更内容
src/components/SelectBoundSettingListModal.tsxにtrainTypeNameParensスタイル(fontSize: RFValue(9))を追加し、本文trainTypeNameText(RFValue(12))の約 75% のサイズで描画されるようにした。renderWithSmallParensを追加し、(...)部分を別のTypographyとして切り出して縮小フォントを当てる。スマホ・タブレット双方で本文と一定の比率を保ちつつカッコだけが小さく表示されるようになる。Typographyで同ヘルパーを使うように変更。カッコを含まない通常文字列ではこれまで通り単一フラグメントとして描画される。テスト
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Generated by Claude Code
Summary by CodeRabbit