refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,112 @@
|
||||
using Chronos.Core.Project;
|
||||
|
||||
namespace Chronos.App.Editor;
|
||||
|
||||
/// <summary>
|
||||
/// Undo and redo of the editor's project (Ctrl+Z / Ctrl+Y). Projects are immutable, so each step is a snapshot.
|
||||
/// Consecutive edits with the same <c>mergeKey</c> (one slider drag, typing in one field) form a single step until
|
||||
/// <see cref="EndRun"/> (the drag or key press ended); any other edit, undo or redo also ends the run. The oldest steps
|
||||
/// are dropped beyond <see cref="Capacity"/>.
|
||||
/// </summary>
|
||||
public sealed class ProjectHistory(ProjectSettings initial, int capacity = 200)
|
||||
{
|
||||
private readonly LinkedList<ProjectSettings> _undo = new();
|
||||
private readonly LinkedList<ProjectSettings> _redo = new();
|
||||
private string? _runKey;
|
||||
|
||||
/// <summary>The project, after any edit, undo, redo or <see cref="Replace"/>.</summary>
|
||||
public event Action? Changed;
|
||||
|
||||
public ProjectSettings Current { get; private set; } = initial ?? throw new ArgumentNullException(nameof(initial));
|
||||
|
||||
public int Capacity { get; } = capacity > 0 ? capacity : throw new ArgumentOutOfRangeException(nameof(capacity));
|
||||
|
||||
public bool CanUndo => _undo.Count > 0;
|
||||
|
||||
public bool CanRedo => _redo.Count > 0;
|
||||
|
||||
/// <summary>Makes <paramref name="next"/> current as an undoable step; false (and nothing recorded) when it stores the same values.</summary>
|
||||
public bool Apply(ProjectSettings next, string? mergeKey = null)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(next);
|
||||
if (ProjectMerge.SameValues(next, Current)) return false;
|
||||
if (mergeKey is null || mergeKey != _runKey || _undo.Count == 0)
|
||||
{
|
||||
_undo.AddLast(Current);
|
||||
if (_undo.Count > Capacity) _undo.RemoveFirst();
|
||||
}
|
||||
_runKey = mergeKey;
|
||||
_redo.Clear();
|
||||
Current = next;
|
||||
Changed?.Invoke();
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>The gesture behind a run of merged edits ended: the next edit is a new step even with the same key.</summary>
|
||||
public void EndRun() => _runKey = null;
|
||||
|
||||
public bool Undo()
|
||||
{
|
||||
if (_undo.Last is not { } previous) return false;
|
||||
_undo.RemoveLast();
|
||||
_redo.AddLast(Current);
|
||||
return Move(previous.Value);
|
||||
}
|
||||
|
||||
public bool Redo()
|
||||
{
|
||||
if (_redo.Last is not { } next) return false;
|
||||
_redo.RemoveLast();
|
||||
_undo.AddLast(Current);
|
||||
return Move(next.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adopts a project changed outside the editor (analysis advice, another client's edit merged on save) without an
|
||||
/// undo step. Every undo and redo snapshot takes the same outside change, so undo reverts only the user's own steps
|
||||
/// and never brings back a value that predates the adopted change.
|
||||
/// </summary>
|
||||
public void Replace(ProjectSettings current)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(current);
|
||||
if (ProjectMerge.SameValues(current, Current)) return;
|
||||
var rebase = new ProjectMerge.Rebase(Current, current);
|
||||
Rebase(_undo, rebase);
|
||||
Rebase(_redo, rebase);
|
||||
_runKey = null;
|
||||
Current = current;
|
||||
Changed?.Invoke();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rewrites the project and every undo and redo snapshot with <paramref name="remap"/>, without an undo step: a change
|
||||
/// of what the values mean rather than of the values (frame positions following frames inserted under the editor), so
|
||||
/// undo and redo keep naming the same frames.
|
||||
/// </summary>
|
||||
public void Remap(Func<ProjectSettings, ProjectSettings> remap)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(remap);
|
||||
foreach (var steps in new[] { _undo, _redo })
|
||||
{
|
||||
for (var node = steps.First; node is not null; node = node.Next) node.Value = remap(node.Value);
|
||||
}
|
||||
var current = remap(Current);
|
||||
if (ProjectMerge.SameValues(current, Current)) return;
|
||||
_runKey = null;
|
||||
Current = current;
|
||||
Changed?.Invoke();
|
||||
}
|
||||
|
||||
private static void Rebase(LinkedList<ProjectSettings> steps, ProjectMerge.Rebase rebase)
|
||||
{
|
||||
for (var node = steps.First; node is not null; node = node.Next) node.Value = rebase.Apply(node.Value);
|
||||
}
|
||||
|
||||
private bool Move(ProjectSettings target)
|
||||
{
|
||||
_runKey = null;
|
||||
Current = target;
|
||||
Changed?.Invoke();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user