Fix transparent foreground prop assets
#2
by AliIqbal05 - opened
.gitattributes
CHANGED
|
@@ -59,3 +59,5 @@ assets/characters/sources/niccolo-machiavelli-chroma.png filter=lfs diff=lfs mer
|
|
| 59 |
assets/courtroom-dickinson.jpg filter=lfs diff=lfs merge=lfs -text
|
| 60 |
assets/foreground/foregroundFence.png filter=lfs diff=lfs merge=lfs -text
|
| 61 |
assets/foreground/JudgeTable.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 59 |
assets/courtroom-dickinson.jpg filter=lfs diff=lfs merge=lfs -text
|
| 60 |
assets/foreground/foregroundFence.png filter=lfs diff=lfs merge=lfs -text
|
| 61 |
assets/foreground/JudgeTable.png filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
assets/foreground/sources/foregroundFence-baked-matte.png filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
assets/foreground/sources/JudgeTable-baked-matte.png filter=lfs diff=lfs merge=lfs -text
|
assets/foreground/JudgeTable.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/foreground/foregroundFence.png
CHANGED
|
Git LFS Details
|
|
Git LFS Details
|
assets/foreground/sources/JudgeTable-baked-matte.png
ADDED
|
Git LFS Details
|
assets/foreground/sources/foregroundFence-baked-matte.png
ADDED
|
Git LFS Details
|
tests/test_ui_rendering.py
CHANGED
|
@@ -1,4 +1,7 @@
|
|
| 1 |
import inspect
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
import app
|
| 4 |
from sovereign_bench.models import AgentTurn, EvidenceItem, JurorVote, TrialEvent
|
|
@@ -105,6 +108,10 @@ def test_courtroom_splits_six_jurors_between_side_benches():
|
|
| 105 |
assert "jury-benches right" in html
|
| 106 |
assert html.count("<a class='juror") == 6
|
| 107 |
assert html.find("jury-benches left") < html.find("jury-benches right")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
def test_courtroom_threads_show_model_input_output_on_hover_and_click():
|
|
@@ -141,6 +148,18 @@ def test_courtroom_renders_foreground_fences_and_judge_table_above_characters():
|
|
| 141 |
assert "z-index: 8;" in app.CSS
|
| 142 |
|
| 143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
def test_latest_speaker_sets_stage_class_and_speech_bubble():
|
| 145 |
html = app.render_court([_speaker_event("Advocate Auric", phase="claims")], started=True)
|
| 146 |
|
|
@@ -190,6 +209,18 @@ def test_lawyer_movement_css_is_speaker_specific_not_phase_wide():
|
|
| 190 |
assert ".phase-opening .puppet.sable" not in app.CSS
|
| 191 |
|
| 192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
def test_run_ui_yields_five_outputs_without_download_status(monkeypatch):
|
| 194 |
event = _event_with_lower_tab_data()
|
| 195 |
monkeypatch.setattr(app, "get_events", lambda request: iter([event]))
|
|
|
|
| 1 |
import inspect
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
from PIL import Image
|
| 5 |
|
| 6 |
import app
|
| 7 |
from sovereign_bench.models import AgentTurn, EvidenceItem, JurorVote, TrialEvent
|
|
|
|
| 108 |
assert "jury-benches right" in html
|
| 109 |
assert html.count("<a class='juror") == 6
|
| 110 |
assert html.find("jury-benches left") < html.find("jury-benches right")
|
| 111 |
+
assert ".jury-benches.left {\n left: 1%;" in app.CSS
|
| 112 |
+
assert ".jury-benches.right {\n right: 1%;" in app.CSS
|
| 113 |
+
assert ".jury-benches.left {\n left: .5%;" in app.CSS
|
| 114 |
+
assert ".jury-benches.right {\n right: .5%;" in app.CSS
|
| 115 |
|
| 116 |
|
| 117 |
def test_courtroom_threads_show_model_input_output_on_hover_and_click():
|
|
|
|
| 148 |
assert "z-index: 8;" in app.CSS
|
| 149 |
|
| 150 |
|
| 151 |
+
def test_foreground_prop_assets_have_real_transparency():
|
| 152 |
+
for path in [
|
| 153 |
+
Path("assets/foreground/foregroundFence.png"),
|
| 154 |
+
Path("assets/foreground/JudgeTable.png"),
|
| 155 |
+
]:
|
| 156 |
+
alpha = Image.open(path).convert("RGBA").getchannel("A")
|
| 157 |
+
histogram = alpha.histogram()
|
| 158 |
+
|
| 159 |
+
assert histogram[0] > 0, f"{path} has no fully transparent pixels"
|
| 160 |
+
assert histogram[255] > 0, f"{path} has no fully opaque prop pixels"
|
| 161 |
+
|
| 162 |
+
|
| 163 |
def test_latest_speaker_sets_stage_class_and_speech_bubble():
|
| 164 |
html = app.render_court([_speaker_event("Advocate Auric", phase="claims")], started=True)
|
| 165 |
|
|
|
|
| 209 |
assert ".phase-opening .puppet.sable" not in app.CSS
|
| 210 |
|
| 211 |
|
| 212 |
+
def test_closed_book_is_smaller_and_key_characters_are_lowered():
|
| 213 |
+
assert ".episode-book.closed {\n top: 61%;\n width: min(163px, 20vw);" in app.CSS
|
| 214 |
+
assert ".puppet.judge {\n left: 50%;\n top: 56%;" in app.CSS
|
| 215 |
+
assert ".puppet.auric {\n left: 24%;\n top: 87%;" in app.CSS
|
| 216 |
+
assert ".speaker-auric .puppet.auric {\n left: 43%;\n top: 91%;" in app.CSS
|
| 217 |
+
assert ".puppet.auditor {\n left: 71%;\n top: 80%;" in app.CSS
|
| 218 |
+
assert ".episode-book.closed {\n top: 750px;\n width: 140px;" in app.CSS
|
| 219 |
+
assert ".puppet.judge {\n top: 717px;" in app.CSS
|
| 220 |
+
assert ".puppet.auric {\n left: 20%;\n top: 970px;" in app.CSS
|
| 221 |
+
assert ".puppet.auditor {\n left: 78%;\n top: 860px;" in app.CSS
|
| 222 |
+
|
| 223 |
+
|
| 224 |
def test_run_ui_yields_five_outputs_without_download_status(monkeypatch):
|
| 225 |
event = _event_with_lower_tab_data()
|
| 226 |
monkeypatch.setattr(app, "get_events", lambda request: iter([event]))
|