Merged
Conversation
UI・ロジック構造を全面的に整理し、可読性・保守性・拡張性を向上。設定・状態管理、UI初期化、プロセス監視、Discord RPC、キャラクター情報、アプリ定数などを専用クラスに分離。 多言語対応をJSONリソースベースに刷新し、言語切替・翻訳管理を強化。 テーマ・フォント・トレイアイコン・アップデートチェック等の基盤機能も新規実装し、今後の機能追加やUI拡張が容易な構成へ。
Contributor
There was a problem hiding this comment.
Pull request overview
MainForm の責務を専用クラスへ分割しつつ、翻訳・キャラクターデータを埋め込み JSON リソースへ移行して、メモリ/リソースリーク改善を狙ったリファクタリングPRです。
Changes:
- Tray/Theme/Font/I18n/Update/Process監視/RPC などをクラス分割して MainForm をスリム化
- 翻訳データ(日本語/英語)とキャラクターデータを JSON 化して埋め込みリソースからロード
- UpdateService/ProcessWatcher/NativeMethods 追加によるリソース管理とロジック整理
Reviewed changes
Copilot reviewed 22 out of 26 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| GkmStatus/src/ui/TrayIconManager.cs | トレイアイコン描画/メニュー状態更新/破棄を分離 |
| GkmStatus/src/ui/Translation.cs | I18n を JSON 埋め込みリソースからロードする実装へ移行 |
| GkmStatus/src/ui/ThemeManager.cs | テーマ適用と Win テーマ取得を分離 |
| GkmStatus/src/ui/FontManager.cs | 埋め込みフォント読み込みと破棄を分離 |
| GkmStatus/src/ui/CustomRenderer.cs | MenuStrip/ContextMenu のカスタム描画を分離 |
| GkmStatus/src/native/NativeMethods.cs | SendMessage/DestroyIcon/SetForegroundWindow 等の P/Invoke を集約 |
| GkmStatus/src/UpdateService.cs | GitHub release API による更新チェックをサービス化 |
| GkmStatus/src/ProcessWatcher.cs | プロセス監視ロジックを Timer ベースでクラス化 |
| GkmStatus/src/DiscordRpc.cs | Discord RPC をラップするサービス/状態イベントを導入 |
| GkmStatus/src/ConfigManager.cs | config.json のロード/セーブ/デフォルト生成を分離 |
| GkmStatus/src/Characters.cs | キャラクターデータを JSON リソースからロードする仕組みを追加 |
| GkmStatus/src/AppLogic.cs | enum/設定変換/URLバリデーション等のヘルパーを整理 |
| GkmStatus/src/AppConstants.cs | 定数・リソースパス・色定義を集約 |
| GkmStatus/Translation.cs | 旧 I18n 実装を削除 |
| GkmStatus/Resources/produce_characters.json | キャラクターデータ JSON を追加 |
| GkmStatus/Resources/I18n/japanese.json | 日本語翻訳 JSON を追加 |
| GkmStatus/Resources/I18n/english.json | 英語翻訳 JSON を追加 |
| GkmStatus/Properties/Resources.resx | リソースファイルを追加/更新 |
| GkmStatus/Properties/Resources.Designer.cs | resx 生成コードを追加/更新 |
| GkmStatus/MainForm.resx | トレイ関連のデザイナメタデータ追加 |
| GkmStatus/MainForm.cs | MainForm の責務を各サービス/マネージャへ移譲し整理 |
| GkmStatus/MainForm.Designer.cs | Designer を使わず動的 UI 構築する実装へ移行 |
| GkmStatus/GkmStatus.csproj | JSON リソースの埋め込み、resx 生成設定を追加 |
| GkmStatus/AboutForm.resx | AboutForm の resx を追加 |
| GkmStatus/AboutForm.cs | AboutForm を partial + ApplyComponent に寄せる変更 |
| GkmStatus/AboutForm.Designer.cs | AboutForm の動的 UI 構築をこちらへ移行 |
Files not reviewed (3)
- GkmStatus/AboutForm.Designer.cs: Language not supported
- GkmStatus/MainForm.Designer.cs: Language not supported
- GkmStatus/Properties/Resources.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)
GkmStatus/AboutForm.cs:41
ShowLicense(object, LinkLabelLinkClickedEventArgs)in this file is no longer wired up: the link click handler inAboutForm.Designer.cscalls a different parameterlessShowLicense()method, duplicating the license rendering logic across partials. Consider keeping a singleShowLicenseimplementation and wiringlnkLicense.LinkClickedto it (or removing the unused overload) to avoid future drift.
private void ShowLicense(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
var assembly = System.Reflection.Assembly.GetExecutingAssembly();
using Stream? stream = assembly.GetManifestResourceStream("GkmStatus.Resources.fonts.IBM_Plex_Sans_JP.OFL.txt");
if (stream != null)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| // 動的に上書きする | ||
| private void ApplyComponent() { | ||
| this.Text = I18n.T(I18n.Text_List.App_Name); |
There was a problem hiding this comment.
The About dialog title is set to App_Name here, which changes the window caption from the localized “About” title (About_Title) used previously. Consider using the About_Title translation key for this.Text so the dialog is labeled correctly in both languages.
Suggested change
| this.Text = I18n.T(I18n.Text_List.App_Name); | |
| this.Text = I18n.T(I18n.Text_List.About_Title); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
リファクタリング(MainForm.csダイエット計画)
パフォーマンス改善
メモリリーク、リソースリークを修正
新たなリソースリークが発生しているかも