TagEditButton / TagEditModal を非React化する#9809
Conversation
- Reactコンポーネント(TagEditButton.jsx, TagEditModal.jsx)を削除 - Slimテンプレート(app/views/shared/_tag_edit_button.html.slim)で置き換え - 既存のtag_edit.js(バニラJS)を活用してモーダル機能を実現 - users/index, pages/index, questions/indexの各ビューを更新
📝 WalkthroughウォークスルーReact で実装されていたタグ編集機能(TagEditButton と TagEditModal)を削除し、Rails のサーバーサイド部分テンプレートに置き換えています。3 つのビューファイルで React コンポーネント呼び出しを削除し、新しく作成した 変更内容
推定コードレビュー工数🎯 3 (Moderate) | ⏱️ ~20 分 関連の可能性がある課題
関連の可能性がある PR
詩
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/views/pages/index.html.slim`:
- Around line 20-21: Wrap the entire li.page-header-actions__item in the same
condition that determines whether the 'shared/tag_edit_button' partial is shown
so an empty <li> is not rendered for non-admins; locate the li containing the
render 'shared/tag_edit_button' (and references to `@tag.id` / `@tag.name`) and move
the visibility check (e.g., the admin/permission check or helper like
can_edit_tag?) to the outer element so the li is only emitted when the partial
will actually render.
In `@app/views/shared/_tag_edit_button.html.slim`:
- Line 22: cancel-change-tag-button は div になっているためキーボードでフォーカス/実行できません。Slim
の該当要素(クラス cancel-change-tag-button / card-main-actions__muted-action)を div から
button[type="button"] に置き換え、保存ボタンと同様に button
要素として実装してテキスト「キャンセル」を維持し、type="button" を必ず指定してフォーム送信を防いでください。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f45aa38b-130d-4f75-9adb-2b2e012a39dc
📒 Files selected for processing (6)
app/javascript/components/Tags/TagEditButton.jsxapp/javascript/components/Tags/TagEditModal.jsxapp/views/pages/index.html.slimapp/views/questions/index.html.slimapp/views/shared/_tag_edit_button.html.slimapp/views/users/index.html.slim
💤 Files with no reviewable changes (2)
- app/javascript/components/Tags/TagEditModal.jsx
- app/javascript/components/Tags/TagEditButton.jsx
closes #9798
概要
TagEditButton / TagEditModal コンポーネントを React から非React(Rails view + バニラJS)に移行しました。
変更内容
注意
TagsInput.jsx は今回は対象外(tagifyライブラリ依存で別対応)。
これは #9798 の部分対応で、TagsInput は別Issue化を検討予定です。
Summary by CodeRabbit
リリースノート