Phase 0-3: 旧UIのシフト申請モーダル(デッドコード)を削除 - #71
Merged
Merged
Conversation
新UI(日付詳細モーダル/openDateDetailModal)に置き換え済みで、開く導線が 存在しない旧シフト申請モーダル一式を削除。 削除対象(全ファイルgrepで参照ゼロを確認): - index.html: #shiftRequestModal モーダルブロック(表示する関数が呼ばれず 恒久的に非表示) - shiftRequest.js: openShiftRequestModal / updateTimeSlotCapacity / generateTimeSlots / closeShiftRequestModal / submitShiftRequest の旧UI5関数 (openShiftRequestModal はどこからも呼ばれず、残り4関数もこのモーダル 経由でのみ到達。さらに存在しない #shiftRemarks を参照していた) - state.js: 上記削除で孤立した currentShiftRequestDate のフィールド/ getter/setter/reset(setterは元々呼び出し元なし) - test/setup.js: 対応するグローバルモック行 検証: 全366テスト green、ビルド成功、サーバー起動して index.html・ shiftRequest.js・state.js が200で配信されること、配信HTMLから shiftRequestModal が消え dateDetailModal が残ることを確認。 注: 旧UIに紐づく CSS(#timeSlotContainer, .time-slot* 等)も孤立したが、 CSS整理はスクリーンショット検証を伴う Phase 4 の担当範囲のため本PRでは 据え置く。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
リファクタリング計画 Phase 0(リポジトリ衛生)の作業項目 0-3 です。純粋なデッドコード削除で、219 行の削除のみ・アプリの挙動には影響しません。
背景
シフト申請 UI は新 UI(日付詳細モーダル
openDateDetailModal/submitDateDetailShiftRequest)に置き換え済みですが、旧 UI のシフト申請モーダル一式がコードに残っていました。旧モーダルを表示する唯一の関数openShiftRequestModalがどこからも呼ばれていないため、このモーダルは恒久的に表示されないデッドコードです。削除対象(全ファイル grep で参照ゼロを確認)
index.html#shiftRequestModalモーダルブロック(18 行)js/modules/shiftRequest.jsopenShiftRequestModal/updateTimeSlotCapacity/generateTimeSlots/closeShiftRequestModal/submitShiftRequestの旧 UI 5 関数(190 行)js/modules/state.jscurrentShiftRequestDateのフィールド・getter・setter・reset(setter は元々呼び出し元なし)test/setup.js補足: 旧 4 関数(close/submit 等)は HTML の
onclickから参照されていましたが、その HTML 自体が表示されないモーダルのものです。さらにcloseShiftRequestModal/submitShiftRequestは HTML に存在しない#shiftRemarks要素を参照しており、仮に実行されれば null 参照で落ちる状態でした。検証
npm run build成功index.html・shiftRequest.js・state.jsが HTTP 200 で配信されることを確認shiftRequestModalが消え(0 件)、稼働中のdateDetailModal(1 件)が残ることを確認当初計画から外したもの(grep で実態確認した結果)
CalendarService.addShiftToCalendar/deleteShiftFromCalendar: コメントに「後方互換性のために残されています」とあり削除候補でしたが、routes/shifts.ts・routes/calendar.tsから実際に呼ばれておりデッドコードではありません。整理は Phase 2(CalendarService 分割)に回します。display:noneのタブボタン群: 全 9 タブが初期非表示でupdateTabVisibility()によりロール別に表示される条件表示要素であり、デッドコードではないため対象外。#timeSlotContainer,.time-slot*,.remarks-*): 今回の削除で孤立しましたが、埋め込み CSS の整理はスクリーンショット検証を伴う Phase 4 の担当範囲のため据え置きます(死んだ CSS はランタイムに影響しません)。🤖 Generated with Claude Code