Skip to content

Commit 22b79f0

Browse files
committed
Refactor progress indicator handling and improve console messages for IDE interactions
1 parent 7351853 commit 22b79f0

1 file changed

Lines changed: 26 additions & 6 deletions

File tree

  • PanoramicData.NugetManagement.Web/Components/Pages

PanoramicData.NugetManagement.Web/Components/Pages/Home.razor

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ else
157157
<div class="breadcrumb-right">
158158
@if (_isLoading || _isAssessing)
159159
{
160-
<span class="progress-indicator"><span class="spinner"></span> @_progressMessage</span>
160+
<span class="progress-indicator"><span class="spinner"></span> @GetProgressIndicatorText()</span>
161161
}
162162
else if (_lastRefreshUtc > DateTimeOffset.MinValue)
163163
{
@@ -1132,13 +1132,33 @@ else
11321132
{
11331133
_ = InvokeAsync(async () =>
11341134
{
1135-
if (!_isLoading)
1135+
if (!_isLoading && !_isAssessing && !_isRunning)
11361136
{
11371137
await RefreshAsync().ConfigureAwait(false);
11381138
}
11391139
});
11401140
}
11411141

1142+
private string GetProgressIndicatorText()
1143+
{
1144+
if (!string.IsNullOrWhiteSpace(_progressMessage))
1145+
{
1146+
return _progressMessage;
1147+
}
1148+
1149+
if (_isAssessing)
1150+
{
1151+
return "Assessing...";
1152+
}
1153+
1154+
if (_isLoading)
1155+
{
1156+
return "Refreshing packages...";
1157+
}
1158+
1159+
return "Working...";
1160+
}
1161+
11421162
private IGitHubClient CreateGitHubClient()
11431163
{
11441164
var client = new GitHubClient(new ProductHeaderValue("PanoramicData.NugetManagement.Web"));
@@ -1197,6 +1217,7 @@ else
11971217
catch (Exception ex)
11981218
{
11991219
Logger.LogError(ex, "Failed to refresh dashboard");
1220+
AppendConsole($"❌ Refresh failed: {ex.Message}");
12001221
_progressMessage = $"Error: {ex.Message}";
12011222
}
12021223
finally
@@ -1615,7 +1636,7 @@ else
16151636
AppendConsole($"⚠️ [{r.RuleId}] {r.RuleName} — no auto-fix available");
16161637
}
16171638

1618-
AppendConsole($"ℹ️ {remaining.Count} issue(s) require manual fix. Use \"Open IDE\" and \"Copy AI Prompt\" to fix with AI assistance.");
1639+
AppendConsole($"ℹ️ {remaining.Count} issue(s) require manual fix. Press \"Fix with AI\" to generate a prompt.");
16191640
}
16201641
else if (_selectedRow.TotalFailures == 0)
16211642
{
@@ -2437,9 +2458,8 @@ else
24372458

24382459
try
24392460
{
2440-
var process = IdeDetection.OpenInIde(ide, _selectedRow.LocalPath);
2441-
var pidInfo = process is not null ? $" (PID {process.Id})" : "";
2442-
AppendConsole($"✅ Opened {_selectedRow.PackageId} in {ide.DisplayName}{pidInfo}");
2461+
IdeDetection.OpenInIde(ide, _selectedRow.LocalPath);
2462+
AppendConsole($"✅ Opened {_selectedRow.PackageId} in {ide.DisplayName}");
24432463
}
24442464
catch (Exception ex)
24452465
{

0 commit comments

Comments
 (0)