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 <noreply@anthropic.com>
This commit is contained in:
1 parent
f39865fffc
commit
0862d160e5
20 files changed
+791
-44
No files matched your search
@@ -10,6 +10,8 @@ var _window: Control
|
||||
func before_test() -> void:
|
||||
_snapshot = AutoloadSnapshot.take([Settings])
|
||||
Settings.currently_syncing = false
|
||||
# The bar jumps to its values and the result shows at once
|
||||
Settings.reduce_animations = true
|
||||
_server = FakeHttpTransport.new().install()
|
||||
_server.respond_bytes("/sync", PackedByteArray())
|
||||
_runner = scene_runner("res://popups/SyncPopup.tscn")
|
||||
@@ -38,7 +40,7 @@ func _empty_result() -> Dictionary:
|
||||
"soundtracks_changed_content": [],
|
||||
"soundtracks_removed": [],
|
||||
"catched_errors": [],
|
||||
"total_time": "00:00:03",
|
||||
"total_time": "00:03",
|
||||
}
|
||||
|
||||
|
||||
@@ -64,12 +66,29 @@ func test_start_sync_does_nothing_while_already_syncing() -> void:
|
||||
|
||||
func test_progress_updates_progress_bar() -> void:
|
||||
_runner.invoke("start_sync")
|
||||
_server.respond_json("/sync/progress", {"progress": "42", "time_spent": "00:00:12"})
|
||||
_server.respond_json("/sync/progress", {"progress": "42", "time_spent": "00:12"})
|
||||
|
||||
_runner.invoke("_on_sync_timeout")
|
||||
|
||||
assert_float(_node("SyncProgressBar").value).is_equal(42.0)
|
||||
assert_str(_node("SyncTime").text).is_equal("00:00:12")
|
||||
assert_str(_node("SyncTime").text).is_equal("00:12")
|
||||
|
||||
|
||||
func test_finished_sync_fills_the_bar_before_the_result() -> void:
|
||||
Settings.reduce_animations = false
|
||||
_runner.invoke("start_sync")
|
||||
var bar: AnimatedProgressBar = _node("SyncProgressBar")
|
||||
assert_bool(bar.indeterminate).is_true()
|
||||
|
||||
_finish_sync(_empty_result())
|
||||
|
||||
assert_bool(_node("ProgressHBoxContainer").visible).is_true()
|
||||
await await_millis(int(Anim.SLOW * 1000) + 100)
|
||||
assert_float(bar.value).is_equal(100.0)
|
||||
assert_bool(_node("ProgressHBoxContainer").visible).is_true()
|
||||
await await_millis(int(Anim.SLOW * 1000) + 100)
|
||||
assert_bool(_node("ProgressHBoxContainer").visible).is_false()
|
||||
assert_str(_node("SyncTitleLabel").text).is_equal("Sync Result")
|
||||
|
||||
|
||||
func test_finished_sync_shows_only_sections_with_changes() -> void:
|
||||
@@ -88,7 +107,7 @@ func test_finished_sync_shows_only_sections_with_changes() -> void:
|
||||
assert_bool(_node("NoChangesLabel").visible).is_false()
|
||||
# Header plus one label per soundtrack
|
||||
assert_int(_node("SoundtracksAddedVBox").get_child_count()).is_equal(3)
|
||||
assert_str(_node("SyncTime").text).is_equal("Total time: 00:00:03")
|
||||
assert_str(_node("SyncTime").text).is_equal("Total time: 00:03")
|
||||
assert_bool(Settings.currently_syncing).is_false()
|
||||
await assert_signal(_window).is_emitted("sync_finished")
|
||||
|
||||
|
||||
Reference in new issue
Block a user