Fix layer search cursor and refresh project revisions

This commit is contained in:
livio committed 2026-09-25 22:44:54 +02:00
1 parent f65451c414
commit b600412285
6 files changed
+40 -6

No files matched your search

+23 -1
View File
@@ -374,6 +374,14 @@
}
</select>
</label>
@if (!string.IsNullOrWhiteSpace(SelectedProjectId) && ProjectVersions.Count == 0)
{
<small class="field-help">Non ci sono ancora revisioni: la prima viene creata quando salvi nuovamente un progetto già esistente.</small>
}
else if (ProjectVersions.Count > 0)
{
<small class="field-help">@ProjectVersions.Count revisioni disponibili, ordinate dalla più recente.</small>
}
<div class="button-row">
<button class="secondary-command" @onclick="LoadProjectVersion" disabled="@(string.IsNullOrWhiteSpace(SelectedVersionId))">Apri revisione</button>
<button class="secondary-command" @onclick="CompareProjectVersion" disabled="@(string.IsNullOrWhiteSpace(SelectedVersionId))">Confronta</button>
@@ -905,6 +913,7 @@
await JS.InvokeVoidAsync("lmeMap.clearLegacyProjectSnapshot");
await RefreshProjectsAsync();
SelectedProjectId = migrated.Id;
await RefreshProjectVersionsAsync(true);
await InvokeAsync(StateHasChanged);
}
catch
@@ -1366,6 +1375,7 @@
{
SelectedProjectId = string.Empty;
}
await RefreshProjectVersionsAsync();
ProjectArchiveMessage = Projects.Count == 0
? "Nessun progetto salvato."
: $"{Projects.Count} {(Projects.Count == 1 ? "progetto salvato" : "progetti salvati")} nell'archivio interno.";
@@ -1380,10 +1390,18 @@
{
SelectedProjectId = args.Value?.ToString() ?? string.Empty;
ProjectFolder = SelectedProject?.Folder ?? string.Empty;
SelectedVersionId = string.Empty;
await RefreshProjectVersionsAsync(true);
}
private async Task RefreshProjectVersionsAsync(bool resetSelection = false)
{
ProjectVersions = string.IsNullOrWhiteSpace(SelectedProjectId)
? []
: await ProjectStorageService.GetVersionsAsync(SelectedProjectId);
if (resetSelection || ProjectVersions.All(version => version.Id != SelectedVersionId))
{
SelectedVersionId = string.Empty;
}
}
private Task UndoMapChange() => JS.InvokeVoidAsync("lmeMap.undoMapChange").AsTask();
@@ -1405,6 +1423,7 @@
await RefreshProjectsAsync();
SelectedProjectId = copy.Id;
ProjectFolder = copy.Folder;
await RefreshProjectVersionsAsync(true);
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto duplicato: {copy.Name}.");
}
@@ -1424,6 +1443,7 @@
var renamed = await ProjectStorageService.RenameAsync(project.Id, requestedName);
await RefreshProjectsAsync();
SelectedProjectId = renamed.Id;
await RefreshProjectVersionsAsync();
NewProjectName = renamed.Name;
if (!HasUnsavedChanges)
{
@@ -1488,6 +1508,7 @@
var imported = await ProjectStorageService.ImportProjectAsync(path);
await RefreshProjectsAsync();
SelectedProjectId = imported.Id;
await RefreshProjectVersionsAsync(true);
await JS.InvokeVoidAsync("lmeMap.showInfo", $"Progetto importato: {imported.Name}.");
}
@@ -1588,6 +1609,7 @@
existing?.Id);
await RefreshProjectsAsync();
SelectedProjectId = saved.Id;
await RefreshProjectVersionsAsync();
NewProjectName = saved.Name;
await JS.InvokeVoidAsync("lmeMap.setProjectReadOnly", false);
await JS.InvokeVoidAsync("lmeMap.markProjectSaved");