Fix replay 2D black canvas and journey UX clarity

Stored analysis overlays now use the decoded frame; latch resets and draw failures surface. Verified with bare-video, replay-wiring, visual_policy, and analysis-progress tests.
This commit is contained in:
ykcheungab
2026-10-06 16:26:47 +08:00
parent a4313f300d
commit 425fa0d44d
13 changed files with 322 additions and 48 deletions
@@ -0,0 +1,30 @@
"""Analysis progress banner titles follow the result state."""
from __future__ import annotations
from orisys_app_shared.i18n import set_locale, t
from orisys_studio.ui.analysis_progress import AnalysisProgress
def test_analysis_progress_titles_name_the_outcome(qt_app) -> None:
set_locale("en_US")
banner = AnalysisProgress(theme="dark")
banner.start()
assert banner.title_label.text() == t("analysis.title")
assert banner.progress_bar.isVisible()
assert banner.cancel_button.isVisible()
banner.reused(frames=12)
assert banner.title_label.text() == t("analysis.title_reused")
assert not banner.progress_bar.isVisible()
assert not banner.cancel_button.isVisible()
banner.complete(frames=12, elapsed_s=1.5)
assert banner.title_label.text() == t("analysis.title_complete")
banner.cancelled(frames=3)
assert banner.title_label.text() == t("analysis.title_cancelled")
banner.failed(reason="boom", frames=1)
assert banner.title_label.text() == t("analysis.title_failed")
@@ -42,6 +42,7 @@ from orisys_app_shared.acquisition.arrows import (
)
from orisys_app_shared.acquisition.image_backend import (
ARROW_PURE,
ARROW_STITCHED,
DEPTH,
RECORDED,
RESULT_FAILED,
@@ -395,6 +396,18 @@ def test_a_bare_video_is_analysed_and_scrubbed_in_both_directions(
"the arrow view is the video's raw picture"
)
# ---- overlay: arrows on the captured frame, not on the black placeholder -
set_mode(window, ARROW_STITCHED)
QApplication.processEvents()
overlay = panel_bgr(window)
assert painted(overlay, canvas) > 0, "the overlay painted no arrows"
assert float(np.mean(overlay)) > 8.0, (
"the overlay is still a near-black canvas; the captured frame was not under the arrows"
)
assert not np.array_equal(overlay, middle_shot), (
"the overlay view is the pure-colour canvas"
)
# ---- the depth view, from the same stored frame -------------------------
set_mode(window, DEPTH)
QApplication.processEvents()