From 0862d160e5c091d4778ee62ca369168332c19988 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 16 Oct 2026 11:13:43 +0200 Subject: [PATCH] Give the sync progress bar colour and animation The bar in the Sync popup is now an AnimatedProgressBar: taller, with a darker track and the theme's accent fill (orange, frost blue in Nord, green with a gold shine for Christmas). It shows Godot's busy animation until the server reports progress, glides to each new value, has a soft highlight sweeping along the filled part inside its rounded corners, and fills and pops before the result shows. With Reduce animations it only jumps to its values. The styles are SyncProgressBar, SyncProgressBarFill and SyncProgressBarText in every theme. Anim.stop stops a keyed animation without starting an empty one. The server now sends sync times as "MM:SS"; the spec is updated from MusicServer develop (also the linux-package route), and the test data and screenshots use the new format. Co-Authored-By: Claude Opus 5.5 --- common/anim.gd | 15 +- common/animated_progress_bar.gd | 118 +++++++ common/animated_progress_bar.gd.uid | 1 + popups/SyncPopup.tscn | 7 +- popups/sync_popup.gd | 18 +- server/generated/progress_response.gd | 1 + server/generated/sync_response.gd | 1 + server/openapi.json | 70 +++++ tests/data/layout_baseline.json | 314 +++++++++++++++++-- tests/fakes/ui_tour.gd | 4 +- tests/integration/test_scene_split.gd | 2 +- tests/integration/test_sync_popup.gd | 27 +- tests/integration/test_theme.gd | 4 + tests/unit/test_animated_progress_bar.gd | 88 ++++++ tests/unit/test_animated_progress_bar.gd.uid | 1 + tests/unit/test_api_types.gd | 8 +- themes/christmas_theme.tres | 39 +++ themes/main_theme.tres | 39 +++ themes/nord_theme.tres | 39 +++ themes/original_web_theme.tres | 39 +++ 20 files changed, 791 insertions(+), 44 deletions(-) create mode 100644 common/animated_progress_bar.gd create mode 100644 common/animated_progress_bar.gd.uid create mode 100644 tests/unit/test_animated_progress_bar.gd create mode 100644 tests/unit/test_animated_progress_bar.gd.uid diff --git a/common/anim.gd b/common/anim.gd index ec68edb..cf75678 100644 --- a/common/anim.gd +++ b/common/anim.gd @@ -24,15 +24,20 @@ static func enabled() -> bool: ## one with the same key so they don't fight. Returns null when animations are off or the ## node is not in the tree. static func tween(node: Node, key: StringName = &"anim") -> Tween: + stop(node, key) + if !enabled() || !node.is_inside_tree(): + return null + var new_tween: Tween = node.create_tween() + node.set_meta(StringName("_tween_" + key), new_tween) + return new_tween + + +## Stops the animation called [param key] on [param node], if one is running. +static func stop(node: Node, key: StringName = &"anim") -> void: var meta: StringName = StringName("_tween_" + key) var old: Variant = node.get_meta(meta) if node.has_meta(meta) else null if old is Tween && (old as Tween).is_valid(): (old as Tween).kill() - if !enabled() || !node.is_inside_tree(): - return null - var new_tween: Tween = node.create_tween() - node.set_meta(meta, new_tween) - return new_tween ## Makes [param control] grow from its middle. diff --git a/common/animated_progress_bar.gd b/common/animated_progress_bar.gd new file mode 100644 index 0000000..c1375ba --- /dev/null +++ b/common/animated_progress_bar.gd @@ -0,0 +1,118 @@ +class_name AnimatedProgressBar +extends ProgressBar +## A progress bar with some life in it: +## - [method wait] shows Godot's busy animation until there is any progress; +## - [method move_to] glides to each new value instead of jumping; +## - a soft highlight sweeps along the filled part, kept inside its rounded corners. +## +## The bar's style, e.g. [code]SyncProgressBar[/code], has a [code]shine[/code] colour for +## the highlight, and two more styles go with it: [code]