Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- **Multiple-spinner matcha fallback now uses a generic message that matches the actual trigger condition** — the easter-egg text no longer mentions only beer-and-coffee combinations even though the runtime still triggers on any multi-spinner selection. This keeps the CLI message aligned with the current `MultipleSpinnersDetected` behavior and hardens the regression test by pinning the exact text. Affected: `Runner/SpinnerThemes.cs`, `FolderDiffIL4DotNet.Tests/Runner/SpinnerThemesTests.cs`. Tests: `SpinnerThemesTests.cs` (1 updated).
- **HTML diff reports now use a tighter fixed width for the Timestamp column** — the embedded report stylesheet and layout script now share a dedicated `--col-ts-w` variable so `Timestamp` keeps its fixed-width old/new range format without wasting horizontal space in both the live report and downloaded reviewed HTML. Updated the HTML report regression test and synchronized the manual sample HTML with the compact timestamp width. Affected: `Services/HtmlReport/diff_report.css`, `Services/HtmlReport/js/diff_report_layout.js`, `FolderDiffIL4DotNet.Tests/Services/HtmlReportGenerateServiceTests.InlineDiff.cs`, `doc/samples/diff_report.html`. Tests: `HtmlReportGenerateServiceTests.InlineDiff.cs` (1 new).
- **Console progress bars now show a fixed-width ETA segment to the right of the percentage** — `ProgressReportService` now appends `ETA HH:mm (+00 h 12 m)` to both inline and redirected progress output, keeping the console width stable while spinner frames animate. ETA estimation is defensive: missing phase timing or invalid progress values fall back to a fixed-width placeholder, and long runs clamp to `99 h 59 m` instead of overflowing the layout. Overflow-prone extreme ETA inputs are now saturated before `TimeSpan.FromSeconds(...)` / minute rounding so the progress renderer still degrades to the documented `99 h 59 m` ceiling instead of throwing. Updated progress-service tests plus README and guide/testing docs to match the new console contract. Affected: `Services/ProgressReportService.cs`, `FolderDiffIL4DotNet.Tests/Services/ProgressReportServiceTests.cs`, `README.md`, `doc/DEVELOPER_GUIDE.md`, `doc/TESTING_GUIDE.md`. Tests: `ProgressReportServiceTests.cs` (7 new, 5 updated).
- **Oversized service files are now split into focused partials without changing runtime behavior** — `ProgramRunner` moved shared constants, injected services, and constructors into `Runner/ProgramRunner.Core.cs`; `ILOutputService` moved IL filtering/block-comparison/disassembler-label helpers into `Services/ILOutputService.Comparison.cs`; `ReportGenerateService` moved report-output and Markdown/disassembler helper logic into `Services/ReportGenerateService.Helpers.cs`; and `HtmlReportGenerateService` moved assembly semantic-change detail rows into `Services/HtmlReport/HtmlReportGenerateService.SemanticChanges.cs` while centralizing `<details>` row rendering for inline/semantic/dependency sections. Updated the developer guide partial-layout table to match the new structure. Affected: `ProgramRunner.cs`, `Runner/ProgramRunner.Core.cs`, `Services/ILOutputService.cs`, `Services/ILOutputService.Comparison.cs`, `Services/ReportGenerateService.cs`, `Services/ReportGenerateService.Helpers.cs`, `Services/HtmlReport/HtmlReportGenerateService.DetailRows.cs`, `Services/HtmlReport/HtmlReportGenerateService.SemanticChanges.cs`, `doc/DEVELOPER_GUIDE.md`. Tests: `dotnet test FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj --configuration Release --nologo` (1919 passed, 1 skipped).

#### Documentation

Expand Down Expand Up @@ -1443,6 +1444,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
- **複数スピナー指定時の抹茶フォールバック文言を、実際の発火条件に合う汎用メッセージへ変更** — 現行ランタイムは複数スピナー指定なら組み合わせを問わずイースターエッグ文言を出すため、beer と coffee だけを名指ししていた文言をやめ、現在の `MultipleSpinnersDetected` 挙動と一致する表現にしました。あわせて回帰テストを「matcha を含む」ではなく完全一致で固定しました。対象: `Runner/SpinnerThemes.cs`, `FolderDiffIL4DotNet.Tests/Runner/SpinnerThemesTests.cs`。テスト: `SpinnerThemesTests.cs`(更新 1 件)。
- **HTML diff レポートの Timestamp 列を固定長のまま詰めて横幅を削減** — 埋め込みレポート CSS とレイアウト用スクリプトで専用の `--col-ts-w` 変数を共有するようにし、`Timestamp` が旧/新の固定長フォーマットを保ったまま、実レポートとダウンロード済み reviewed HTML の両方で横幅を取りすぎないようにしました。あわせて HTML レポートの回帰テストを追加し、手動管理のサンプル HTML も同じ幅に同期しました。対象: `Services/HtmlReport/diff_report.css`, `Services/HtmlReport/js/diff_report_layout.js`, `FolderDiffIL4DotNet.Tests/Services/HtmlReportGenerateServiceTests.InlineDiff.cs`, `doc/samples/diff_report.html`。テスト: `HtmlReportGenerateServiceTests.InlineDiff.cs`(追加 1 件)。
- **コンソール進捗バーの右側に固定長 ETA セグメントを追加** — `ProgressReportService` はインライン進捗とリダイレクト進捗の両方に `ETA HH:mm (+00 h 12 m)` を付与するようになり、スピナーフレームが回転してもコンソール幅がぶれないようになりました。ETA 推定は防御的で、フェーズ計測が未開始のときや進捗率が不正なときは固定長 placeholder にフォールバックし、長時間実行は `99 h 59 m` にクランプして表示崩れを防ぎます。さらに、極端に大きい ETA 入力でも `TimeSpan.FromSeconds(...)` や分丸めのオーバーフローで落ちず、文書どおり `99 h 59 m` 上限へ飽和するようにしました。あわせて、進捗サービスのテストと README / developer guide / testing guide を新しいコンソール契約に同期しました。対象: `Services/ProgressReportService.cs`, `FolderDiffIL4DotNet.Tests/Services/ProgressReportServiceTests.cs`, `README.md`, `doc/DEVELOPER_GUIDE.md`, `doc/TESTING_GUIDE.md`。テスト: `ProgressReportServiceTests.cs`(追加 7 件、更新 5 件)。
- **巨大化していたサービスファイルを、実行時挙動を変えずに責務ごとの partial へ分割** — `ProgramRunner` は共有定数・注入サービス・コンストラクターを `Runner/ProgramRunner.Core.cs` へ移し、`ILOutputService` は IL フィルタリング/ブロック比較/逆アセンブラ表示ラベル補助を `Services/ILOutputService.Comparison.cs` へ切り出し、`ReportGenerateService` はレポート出力補助と Markdown/逆アセンブラ描画補助を `Services/ReportGenerateService.Helpers.cs` へ移し、`HtmlReportGenerateService` はアセンブリセマンティック変更詳細行を `Services/HtmlReport/HtmlReportGenerateService.SemanticChanges.cs` へ分離しつつ、inline/semantic/dependency の各詳細セクションで使う `<details>` 行描画を共通化しました。あわせて、開発者ガイドの partial 構成表も新レイアウトに追従させました。対象: `ProgramRunner.cs`, `Runner/ProgramRunner.Core.cs`, `Services/ILOutputService.cs`, `Services/ILOutputService.Comparison.cs`, `Services/ReportGenerateService.cs`, `Services/ReportGenerateService.Helpers.cs`, `Services/HtmlReport/HtmlReportGenerateService.DetailRows.cs`, `Services/HtmlReport/HtmlReportGenerateService.SemanticChanges.cs`, `doc/DEVELOPER_GUIDE.md`。テスト: `dotnet test FolderDiffIL4DotNet.Tests/FolderDiffIL4DotNet.Tests.csproj --configuration Release --nologo`(1919 passed, 1 skipped)。

#### ドキュメント

Expand Down
47 changes: 0 additions & 47 deletions ProgramRunner.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -20,52 +19,6 @@ namespace FolderDiffIL4DotNet
/// </summary>
public sealed partial class ProgramRunner
{
private const string INITIALIZING_LOGGER = "Initializing logger...";
private const string LOGGER_INITIALIZED = "Logger initialized.";
private const string VALIDATING_ARGS = "Validating command line arguments...";
private const string LOG_ARGS_VALIDATION_COMPLETED = "Command line arguments validation completed.";
private const string LOG_APP_STARTING = "Starting " + Constants.APP_NAME + "...";
private const string LOG_APP_FINISHED = Constants.APP_NAME + " finished without errors. See Reports folder for details.";
private const string PRESS_ANY_KEY = "Press any key to exit...";
private const string ERROR_KEY_PROMPT = "An error occurred during key prompt.";
private const string WARNING_NEW_FILE_TIMESTAMP_OLDER_THAN_OLD = "One or more modified files in 'new' have older timestamps than the corresponding files in 'old'. See diff_report for details.";
private const string WARNING_IL_FILTER_STRINGS_TOO_SHORT = "One or more ILIgnoreLineContainingStrings entries are very short and may inadvertently exclude legitimate IL lines. See diff_report Warnings section for details.";
private const string TIP_PRINT_CONFIG = "Tip: Run with --print-config to display the effective configuration as JSON.";
private const string INFO_AUTO_GENERATED_REPORT_LABEL = "Report label was not specified. Using auto-generated label: ";

private readonly ILoggerService _logger;
private readonly ConfigService _configService;
private readonly Action<ProcessStartInfo> _openFolderAction;

/// <summary>
/// Initializes a new instance of <see cref="ProgramRunner"/>.
/// <see cref="ProgramRunner"/> の新しいインスタンスを初期化します。
/// </summary>
/// <param name="logger">Logger for diagnostic output. / 診断出力用ロガー。</param>
/// <param name="configService">Service for loading configuration files. / 設定ファイル読込サービス。</param>
public ProgramRunner(ILoggerService logger, ConfigService configService)
: this(logger, configService, static processStartInfo => Process.Start(processStartInfo))
{
}

/// <summary>
/// Initializes a new instance of <see cref="ProgramRunner"/> with a replaceable folder-open action for tests.
/// テスト用に差し替え可能なフォルダ開放アクション付きで <see cref="ProgramRunner"/> の新しいインスタンスを初期化します。
/// </summary>
/// <param name="logger">Logger for diagnostic output. / 診断出力用ロガー。</param>
/// <param name="configService">Service for loading configuration files. / 設定ファイル読込サービス。</param>
/// <param name="openFolderAction">Action used by `--open-*` commands to launch the folder. / `--open-*` コマンドでフォルダを起動するためのアクション。</param>
internal ProgramRunner(ILoggerService logger, ConfigService configService, Action<ProcessStartInfo> openFolderAction)
{
ArgumentNullException.ThrowIfNull(logger);
ArgumentNullException.ThrowIfNull(configService);
ArgumentNullException.ThrowIfNull(openFolderAction);

_logger = logger;
_configService = configService;
_openFolderAction = openFolderAction;
}

/// <summary>
/// Executes the main application flow and returns the process exit code.
/// アプリケーションのメインフローを実行し、終了コードを返します。
Expand Down
60 changes: 60 additions & 0 deletions Runner/ProgramRunner.Core.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System;
using System.Diagnostics;
using FolderDiffIL4DotNet.Common;
using FolderDiffIL4DotNet.Services;

namespace FolderDiffIL4DotNet
{
/// <summary>
/// Shared constants, dependencies, and constructors for <see cref="ProgramRunner"/>.
/// <see cref="ProgramRunner"/> の共有定数・依存関係・コンストラクターをまとめた partial です。
/// </summary>
public sealed partial class ProgramRunner
{
private const string INITIALIZING_LOGGER = "Initializing logger...";
private const string LOGGER_INITIALIZED = "Logger initialized.";
private const string VALIDATING_ARGS = "Validating command line arguments...";
private const string LOG_ARGS_VALIDATION_COMPLETED = "Command line arguments validation completed.";
private const string LOG_APP_STARTING = "Starting " + Constants.APP_NAME + "...";
private const string LOG_APP_FINISHED = Constants.APP_NAME + " finished without errors. See Reports folder for details.";
private const string PRESS_ANY_KEY = "Press any key to exit...";
private const string ERROR_KEY_PROMPT = "An error occurred during key prompt.";
private const string WARNING_NEW_FILE_TIMESTAMP_OLDER_THAN_OLD = "One or more modified files in 'new' have older timestamps than the corresponding files in 'old'. See diff_report for details.";
private const string WARNING_IL_FILTER_STRINGS_TOO_SHORT = "One or more ILIgnoreLineContainingStrings entries are very short and may inadvertently exclude legitimate IL lines. See diff_report Warnings section for details.";
private const string TIP_PRINT_CONFIG = "Tip: Run with --print-config to display the effective configuration as JSON.";
private const string INFO_AUTO_GENERATED_REPORT_LABEL = "Report label was not specified. Using auto-generated label: ";

private readonly ILoggerService _logger;
private readonly ConfigService _configService;
private readonly Action<ProcessStartInfo> _openFolderAction;

/// <summary>
/// Initializes a new instance of <see cref="ProgramRunner"/>.
/// <see cref="ProgramRunner"/> の新しいインスタンスを初期化します。
/// </summary>
/// <param name="logger">Logger for diagnostic output. / 診断出力用ロガー。</param>
/// <param name="configService">Service for loading configuration files. / 設定ファイル読込サービス。</param>
public ProgramRunner(ILoggerService logger, ConfigService configService)
: this(logger, configService, static processStartInfo => Process.Start(processStartInfo))
{
}

/// <summary>
/// Initializes a new instance of <see cref="ProgramRunner"/> with a replaceable folder-open action for tests.
/// テスト用に差し替え可能なフォルダ開放アクション付きで <see cref="ProgramRunner"/> の新しいインスタンスを初期化します。
/// </summary>
/// <param name="logger">Logger for diagnostic output. / 診断出力用ロガー。</param>
/// <param name="configService">Service for loading configuration files. / 設定ファイル読込サービス。</param>
/// <param name="openFolderAction">Action used by `--open-*` commands to launch the folder. / `--open-*` コマンドでフォルダを起動するためのアクション。</param>
internal ProgramRunner(ILoggerService logger, ConfigService configService, Action<ProcessStartInfo> openFolderAction)
{
ArgumentNullException.ThrowIfNull(logger);
ArgumentNullException.ThrowIfNull(configService);
ArgumentNullException.ThrowIfNull(openFolderAction);

_logger = logger;
_configService = configService;
_openFolderAction = openFolderAction;
}
}
}
Loading
Loading