Conversation
挙動は一切変えない純粋なリファクタ。差分は +408/-480 で純減、テストは 790 → 848。
- sync/httpJson.ts を新設: CheckedFetch / HttpError(status 付き)/ jsonInit / getJson / postJson /
putJson / patchJson / deleteJson。Content-Type の定型 20箇所を 0 に、!res.ok throw を 33 → 21。
401/409/502 を分岐する経路(GitHub 系・tasklists の 403・非 throw フォールバック)は挙動を
変えないため jsonInit 適用のみに留めた。同期系はエラーメッセージから「どのカレンダーか」が
消えないよう自前 throw を維持
- layout/localStore.ts を新設: try/catch のコピペ 14 ブロックを全廃し、window.localStorage の
実参照は1箇所だけになった(CalendarPane の2組はキー名以外バイト同一だった)
- layout/viewRange.ts を新設: dayCountForView / isView / initialTimelineStart / timelineRangeMs を
App.tsx から移設してテスト可能に。isPaneMode は型の定義元 layout/paneMode.ts へ寄せ、
isViewAllowedForWidth は既存の keyboard/shortcuts.ts のまま(重複を作らない)
- 座標変換: plannedBlockTopPx/HeightPx を gridMetrics の msToTopPx/msRangeToHeightPx へ移設・改名し、
手書き計算 13箇所(DayColumn 9 / EventBlock 2 / mapActivity / mapCiRuns)を置換。床(Math.max(…,4))と
hourHeight 必須引数は維持
- layout/keys.ts を新設: `${accountId}:${calendarId}` の手書き 16箇所 + BlockRulesOverlay の
プライベート版を置換。Occurrence の optional な id 向けに calendarKeyOf を併設(従来の
"undefined:undefined" と同じ「どれにも一致しない」挙動を明記)
- Set トグルを setOps に一本化(toggleSetMember を移設)し、手書きトグル4箇所を置換。
「変化が無ければ同参照」の再レンダー抑制性質は維持。これに伴い一部の state/prop 型を
Set → ReadonlySet に(型のみ、実行時挙動なし)
web 848 tests, typecheck/build clean。lint 警告は変更前と同一(既存分のみ)。
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HGESE2zBNzoW8MYvtEySBQ
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.
挙動不変の純粋リファクタ。差分 +408/-480(純減)、テスト 790 → 848。
web 848 tests / typecheck / build clean。
🤖 Generated with Claude Code
https://claude.ai/code/session_01HGESE2zBNzoW8MYvtEySBQ