Spaces:
Sleeping
Sleeping
Round 2 revisions: update Intro heading, stream hero video via HF CDN, always-visible How to rate bar, low-key progress strip, centered buttons with brighter saturated colors
Browse files
src/jamendo_instruct/demo/human_validation_app.py
CHANGED
|
@@ -132,18 +132,29 @@ def _render_stage_header(
|
|
| 132 |
q_text = f'<span class="ji-stage-count">{answered_count} / {total_questions} answered</span>'
|
| 133 |
st.markdown(
|
| 134 |
(
|
| 135 |
-
'<
|
| 136 |
'<div class="ji-stage-bar-top">'
|
| 137 |
-
'<span class="ji-brand-name">Composed Music Retrieval validation</span>'
|
| 138 |
-
'<div class="ji-stage-pills">'
|
| 139 |
-
f"{q_text}"
|
| 140 |
f'<span class="ji-stage-count">Session {current_item} / {session_goal}</span>'
|
| 141 |
-
"
|
| 142 |
"</div>"
|
| 143 |
'<div class="ji-progress-track">'
|
| 144 |
f'<div class="ji-progress-bar" style="width:{progress_pct:.1f}%"></div>'
|
| 145 |
"</div>"
|
| 146 |
-
"</
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
),
|
| 148 |
unsafe_allow_html=True,
|
| 149 |
)
|
|
@@ -271,12 +282,6 @@ def _render_more_info_panel(
|
|
| 271 |
variant_index: int,
|
| 272 |
) -> None:
|
| 273 |
with st.expander("More information", expanded=False):
|
| 274 |
-
st.markdown(
|
| 275 |
-
"**How to rate this item.** The instruction asks to move from the source track toward the target track. "
|
| 276 |
-
"It should ask for one or more real changes, and it may ask to keep an important property. "
|
| 277 |
-
"The target is allowed to change in other ways too. Use **Cannot judge** when you do not have enough "
|
| 278 |
-
"evidence to answer; not being able to tell is not the same as the instruction being wrong."
|
| 279 |
-
)
|
| 280 |
st.caption(
|
| 281 |
f"Annotator: `{annotator_id}` (bookmark this URL to keep your progress) · "
|
| 282 |
f"Chain `{chain_id}` · Turn `{turn_index}` · Variant `{variant_index}`"
|
|
@@ -284,6 +289,27 @@ def _render_more_info_panel(
|
|
| 284 |
|
| 285 |
|
| 286 |
REMIX_VIDEO = Path(__file__).resolve().parents[3] / "website" / "public" / "remix.mp4"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 287 |
|
| 288 |
_STAGES = [
|
| 289 |
("1. Enrich", "Start with open music catalogs. For every track, a model writes a short description of how it sounds and types out the lyrics. Now each song has real words describing it, plus tags."),
|
|
@@ -296,7 +322,8 @@ _STAGES = [
|
|
| 296 |
|
| 297 |
def _render_intro_tab(st: Any, rate_page: Any = None) -> None:
|
| 298 |
# The 20-second read + hero video up front; everything else lives in "More information".
|
| 299 |
-
|
|
|
|
| 300 |
hero_left, hero_right = st.columns([1.02, 1.0], gap="large")
|
| 301 |
else:
|
| 302 |
hero_left, hero_right = st.container(), None
|
|
@@ -305,7 +332,7 @@ def _render_intro_tab(st: Any, rate_page: Any = None) -> None:
|
|
| 305 |
st.markdown(
|
| 306 |
"""
|
| 307 |
<section class="ji-panel ji-intro-hero">
|
| 308 |
-
<h2>
|
| 309 |
<p><b>What is ReMIX?</b> A dataset of back-and-forth music searches. Someone looks for a song,
|
| 310 |
then keeps adjusting it: <em>“make it punchier”</em>, <em>“keep the vocals”</em>,
|
| 311 |
<em>“bring back the piano”</em>. For every adjustment, an AI wrote the instruction.</p>
|
|
@@ -324,9 +351,10 @@ def _render_intro_tab(st: Any, rate_page: Any = None) -> None:
|
|
| 324 |
else:
|
| 325 |
st.success("👉 Ready? Open the **Rate** page to start.")
|
| 326 |
|
| 327 |
-
if hero_right is not None:
|
|
|
|
| 328 |
with hero_right:
|
| 329 |
-
st.video(
|
| 330 |
st.caption("The whole pipeline in about 90 seconds (no sound).")
|
| 331 |
|
| 332 |
with st.expander("More information — how it is built and examples", expanded=False):
|
|
@@ -439,15 +467,10 @@ def _validation_css() -> str:
|
|
| 439 |
padding: 0.9rem 1.05rem;
|
| 440 |
}
|
| 441 |
|
| 442 |
-
/*
|
| 443 |
-
.ji-stage-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
-webkit-backdrop-filter: blur(12px);
|
| 447 |
-
border: 1px solid var(--ji-stroke);
|
| 448 |
-
border-radius: 10px;
|
| 449 |
-
padding: 0.65rem 0.95rem 0.75rem;
|
| 450 |
-
margin-bottom: 0.9rem;
|
| 451 |
}
|
| 452 |
.ji-stage-bar-top {
|
| 453 |
display: flex;
|
|
@@ -455,38 +478,55 @@ def _validation_css() -> str:
|
|
| 455 |
justify-content: space-between;
|
| 456 |
gap: 0.75rem;
|
| 457 |
flex-wrap: wrap;
|
| 458 |
-
margin-bottom: 0.
|
| 459 |
-
}
|
| 460 |
-
.ji-brand-name {
|
| 461 |
-
font-size: 0.95rem;
|
| 462 |
-
font-weight: 700;
|
| 463 |
-
color: var(--ji-text);
|
| 464 |
-
}
|
| 465 |
-
.ji-stage-pills {
|
| 466 |
-
display: inline-flex;
|
| 467 |
-
align-items: center;
|
| 468 |
-
gap: 0.85rem;
|
| 469 |
-
flex-wrap: wrap;
|
| 470 |
}
|
| 471 |
.ji-stage-count {
|
| 472 |
-
font-size: 0.
|
| 473 |
-
font-weight:
|
| 474 |
font-variant-numeric: tabular-nums;
|
| 475 |
color: var(--ji-muted);
|
| 476 |
}
|
| 477 |
.ji-progress-track {
|
| 478 |
-
height:
|
| 479 |
border-radius: 999px;
|
| 480 |
-
background: #
|
| 481 |
overflow: hidden;
|
| 482 |
}
|
| 483 |
.ji-progress-bar {
|
| 484 |
height: 100%;
|
| 485 |
border-radius: 999px;
|
| 486 |
-
background:
|
| 487 |
transition: width 0.25s ease;
|
| 488 |
}
|
| 489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 490 |
/* Center Instruction panel */
|
| 491 |
.ji-instruction-bridge {
|
| 492 |
min-height: 152px;
|
|
@@ -678,7 +718,7 @@ def _validation_css() -> str:
|
|
| 678 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] {
|
| 679 |
display: grid !important;
|
| 680 |
grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(106px, 0.85fr) minmax(112px, 0.85fr) !important;
|
| 681 |
-
gap: 0.
|
| 682 |
align-items: stretch !important;
|
| 683 |
width: 100% !important;
|
| 684 |
}
|
|
@@ -688,93 +728,128 @@ def _validation_css() -> str:
|
|
| 688 |
justify-content: center !important;
|
| 689 |
text-align: center !important;
|
| 690 |
margin: 0 !important;
|
| 691 |
-
padding: 0.
|
| 692 |
-
min-height: 2.
|
| 693 |
border-radius: 8px !important;
|
| 694 |
border: 1px solid #d4dcd5 !important;
|
| 695 |
background: #ffffff !important;
|
| 696 |
box-shadow: none !important;
|
| 697 |
cursor: pointer !important;
|
|
|
|
| 698 |
transition: background 0.12s ease, border-color 0.12s ease !important;
|
| 699 |
}
|
| 700 |
-
/* Hide default radio circle dot
|
| 701 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label > div:first-child {
|
| 702 |
display: none !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 703 |
}
|
| 704 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label p {
|
| 705 |
-
font-size: 0.
|
| 706 |
-
font-weight:
|
| 707 |
line-height: 1.2 !important;
|
| 708 |
color: #1f241f !important;
|
| 709 |
margin: 0 !important;
|
|
|
|
|
|
|
|
|
|
| 710 |
}
|
| 711 |
|
| 712 |
-
/*
|
| 713 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(1) {
|
| 714 |
-
background: #
|
| 715 |
-
border-color: #
|
|
|
|
|
|
|
|
|
|
| 716 |
}
|
| 717 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(2) {
|
| 718 |
-
background: #
|
| 719 |
-
border-color: #
|
|
|
|
|
|
|
|
|
|
| 720 |
}
|
| 721 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(3) {
|
| 722 |
-
background: #
|
| 723 |
-
border-color: #
|
|
|
|
|
|
|
|
|
|
| 724 |
}
|
| 725 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(4) {
|
| 726 |
-
background: #
|
| 727 |
-
border-color: #
|
|
|
|
|
|
|
|
|
|
| 728 |
}
|
| 729 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(5) {
|
| 730 |
-
background: #
|
| 731 |
-
border-color: #
|
|
|
|
|
|
|
|
|
|
| 732 |
}
|
| 733 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(6),
|
| 734 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(7) {
|
| 735 |
-
background: #
|
| 736 |
-
border-color: #
|
| 737 |
}
|
| 738 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(6) p,
|
| 739 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(7) p {
|
| 740 |
-
color: #
|
| 741 |
}
|
| 742 |
|
| 743 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:hover {
|
| 744 |
border-color: #171917 !important;
|
| 745 |
-
filter: brightness(0.
|
| 746 |
}
|
| 747 |
|
| 748 |
-
/*
|
| 749 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(1):has(input:checked) {
|
| 750 |
-
background: #
|
| 751 |
-
border-color: #
|
| 752 |
}
|
| 753 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(2):has(input:checked) {
|
| 754 |
-
background: #
|
| 755 |
-
border-color: #
|
| 756 |
}
|
| 757 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(3):has(input:checked) {
|
| 758 |
-
background: #
|
| 759 |
-
border-color: #
|
| 760 |
}
|
| 761 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(4):has(input:checked) {
|
| 762 |
-
background: #
|
| 763 |
-
border-color: #
|
| 764 |
}
|
| 765 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(5):has(input:checked) {
|
| 766 |
-
background: #
|
| 767 |
-
border-color: #
|
| 768 |
}
|
| 769 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(6):has(input:checked),
|
| 770 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(7):has(input:checked) {
|
| 771 |
-
background: #
|
| 772 |
-
border-color: #
|
| 773 |
}
|
| 774 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:has(input:checked) p {
|
| 775 |
color: #ffffff !important;
|
| 776 |
font-weight: 700 !important;
|
| 777 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 778 |
|
| 779 |
/* Buttons: clean solid strokes & solid forest green primary */
|
| 780 |
div[data-testid="stButton"] button[kind="secondary"] {
|
|
@@ -1847,6 +1922,7 @@ def _render_rating_tab(st: Any, dataset: DemoDataset, samples: Sequence[Dict[str
|
|
| 1847 |
answered_count=answered_so_far,
|
| 1848 |
total_questions=len(RATING_QUESTIONS),
|
| 1849 |
)
|
|
|
|
| 1850 |
|
| 1851 |
# Main focused comparison flow: Track A -> Instruction -> Track B
|
| 1852 |
col_a, col_mid, col_b = st.columns([1.15, 0.88, 1.15], gap="medium")
|
|
|
|
| 132 |
q_text = f'<span class="ji-stage-count">{answered_count} / {total_questions} answered</span>'
|
| 133 |
st.markdown(
|
| 134 |
(
|
| 135 |
+
'<div class="ji-stage-strip">'
|
| 136 |
'<div class="ji-stage-bar-top">'
|
|
|
|
|
|
|
|
|
|
| 137 |
f'<span class="ji-stage-count">Session {current_item} / {session_goal}</span>'
|
| 138 |
+
f"{q_text}"
|
| 139 |
"</div>"
|
| 140 |
'<div class="ji-progress-track">'
|
| 141 |
f'<div class="ji-progress-bar" style="width:{progress_pct:.1f}%"></div>'
|
| 142 |
"</div>"
|
| 143 |
+
"</div>"
|
| 144 |
+
),
|
| 145 |
+
unsafe_allow_html=True,
|
| 146 |
+
)
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
def _render_how_to_rate_bar(st: Any) -> None:
|
| 150 |
+
st.markdown(
|
| 151 |
+
(
|
| 152 |
+
'<section class="ji-howto-bar">'
|
| 153 |
+
"<b>How to rate this item.</b> The instruction asks to move from the source track toward the target track. "
|
| 154 |
+
"It should ask for one or more real changes, and it may ask to keep an important property. "
|
| 155 |
+
"The target is allowed to change in other ways too. Use <b>Cannot judge</b> when you do not have enough "
|
| 156 |
+
"evidence to answer; not being able to tell is not the same as the instruction being wrong."
|
| 157 |
+
"</section>"
|
| 158 |
),
|
| 159 |
unsafe_allow_html=True,
|
| 160 |
)
|
|
|
|
| 282 |
variant_index: int,
|
| 283 |
) -> None:
|
| 284 |
with st.expander("More information", expanded=False):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
st.caption(
|
| 286 |
f"Annotator: `{annotator_id}` (bookmark this URL to keep your progress) · "
|
| 287 |
f"Chain `{chain_id}` · Turn `{turn_index}` · Variant `{variant_index}`"
|
|
|
|
| 289 |
|
| 290 |
|
| 291 |
REMIX_VIDEO = Path(__file__).resolve().parents[3] / "website" / "public" / "remix.mp4"
|
| 292 |
+
REMIX_VIDEO_PUBLIC_URL = os.environ.get(
|
| 293 |
+
"REMIX_VIDEO_URL",
|
| 294 |
+
"https://huggingface.co/spaces/Pliploop/Remix-Ratings/resolve/main/website/public/remix.mp4",
|
| 295 |
+
)
|
| 296 |
+
|
| 297 |
+
|
| 298 |
+
def _hero_video_source() -> tuple[str, bool] | None:
|
| 299 |
+
"""Return ``(src, is_remote_url)`` for the Intro hero video.
|
| 300 |
+
|
| 301 |
+
In Hugging Face Docker Spaces, Git LFS files in the build context can arrive as
|
| 302 |
+
132-byte pointer files rather than the real MP4; when running on a Space (or when
|
| 303 |
+
the local file is missing / an LFS pointer), stream directly from the public HF CDN.
|
| 304 |
+
"""
|
| 305 |
+
local_ok = REMIX_VIDEO.is_file() and REMIX_VIDEO.stat().st_size > 10_000
|
| 306 |
+
if os.environ.get("DATASET_REPO", "").strip() and REMIX_VIDEO_PUBLIC_URL:
|
| 307 |
+
return REMIX_VIDEO_PUBLIC_URL, True
|
| 308 |
+
if local_ok:
|
| 309 |
+
return str(REMIX_VIDEO), False
|
| 310 |
+
if REMIX_VIDEO_PUBLIC_URL:
|
| 311 |
+
return REMIX_VIDEO_PUBLIC_URL, True
|
| 312 |
+
return None
|
| 313 |
|
| 314 |
_STAGES = [
|
| 315 |
("1. Enrich", "Start with open music catalogs. For every track, a model writes a short description of how it sounds and types out the lyrics. Now each song has real words describing it, plus tags."),
|
|
|
|
| 322 |
|
| 323 |
def _render_intro_tab(st: Any, rate_page: Any = None) -> None:
|
| 324 |
# The 20-second read + hero video up front; everything else lives in "More information".
|
| 325 |
+
video_info = _hero_video_source()
|
| 326 |
+
if video_info is not None:
|
| 327 |
hero_left, hero_right = st.columns([1.02, 1.0], gap="large")
|
| 328 |
else:
|
| 329 |
hero_left, hero_right = st.container(), None
|
|
|
|
| 332 |
st.markdown(
|
| 333 |
"""
|
| 334 |
<section class="ji-panel ji-intro-hero">
|
| 335 |
+
<h2>Validate instructions for music retrieval</h2>
|
| 336 |
<p><b>What is ReMIX?</b> A dataset of back-and-forth music searches. Someone looks for a song,
|
| 337 |
then keeps adjusting it: <em>“make it punchier”</em>, <em>“keep the vocals”</em>,
|
| 338 |
<em>“bring back the piano”</em>. For every adjustment, an AI wrote the instruction.</p>
|
|
|
|
| 351 |
else:
|
| 352 |
st.success("👉 Ready? Open the **Rate** page to start.")
|
| 353 |
|
| 354 |
+
if hero_right is not None and video_info is not None:
|
| 355 |
+
video_src, _is_remote = video_info
|
| 356 |
with hero_right:
|
| 357 |
+
st.video(video_src, autoplay=True, muted=True, loop=True)
|
| 358 |
st.caption("The whole pipeline in about 90 seconds (no sound).")
|
| 359 |
|
| 360 |
with st.expander("More information — how it is built and examples", expanded=False):
|
|
|
|
| 467 |
padding: 0.9rem 1.05rem;
|
| 468 |
}
|
| 469 |
|
| 470 |
+
/* Low-key background progress strip (no outer box) */
|
| 471 |
+
.ji-stage-strip {
|
| 472 |
+
margin-bottom: 0.65rem;
|
| 473 |
+
padding: 0 0.1rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 474 |
}
|
| 475 |
.ji-stage-bar-top {
|
| 476 |
display: flex;
|
|
|
|
| 478 |
justify-content: space-between;
|
| 479 |
gap: 0.75rem;
|
| 480 |
flex-wrap: wrap;
|
| 481 |
+
margin-bottom: 0.32rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 482 |
}
|
| 483 |
.ji-stage-count {
|
| 484 |
+
font-size: 0.78rem;
|
| 485 |
+
font-weight: 550;
|
| 486 |
font-variant-numeric: tabular-nums;
|
| 487 |
color: var(--ji-muted);
|
| 488 |
}
|
| 489 |
.ji-progress-track {
|
| 490 |
+
height: 4px;
|
| 491 |
border-radius: 999px;
|
| 492 |
+
background: #e1e6e2;
|
| 493 |
overflow: hidden;
|
| 494 |
}
|
| 495 |
.ji-progress-bar {
|
| 496 |
height: 100%;
|
| 497 |
border-radius: 999px;
|
| 498 |
+
background: #78a88d;
|
| 499 |
transition: width 0.25s ease;
|
| 500 |
}
|
| 501 |
|
| 502 |
+
/* Always-visible "How to rate this item" banner */
|
| 503 |
+
.ji-howto-bar {
|
| 504 |
+
background: rgba(255, 255, 255, 0.78);
|
| 505 |
+
backdrop-filter: blur(12px);
|
| 506 |
+
-webkit-backdrop-filter: blur(12px);
|
| 507 |
+
border: 1px solid var(--ji-stroke);
|
| 508 |
+
border-left: 3px solid var(--ji-accent);
|
| 509 |
+
border-radius: 10px;
|
| 510 |
+
padding: 0.68rem 0.95rem;
|
| 511 |
+
margin-bottom: 0.85rem;
|
| 512 |
+
font-size: 0.88rem;
|
| 513 |
+
line-height: 1.5;
|
| 514 |
+
color: #242a25;
|
| 515 |
+
}
|
| 516 |
+
|
| 517 |
+
/* Hero video frame */
|
| 518 |
+
.ji-video-frame {
|
| 519 |
+
border: 1px solid var(--ji-stroke);
|
| 520 |
+
border-radius: 10px;
|
| 521 |
+
overflow: hidden;
|
| 522 |
+
background: #ffffff;
|
| 523 |
+
}
|
| 524 |
+
.ji-video-frame video {
|
| 525 |
+
display: block;
|
| 526 |
+
width: 100%;
|
| 527 |
+
height: auto;
|
| 528 |
+
}
|
| 529 |
+
|
| 530 |
/* Center Instruction panel */
|
| 531 |
.ji-instruction-bridge {
|
| 532 |
min-height: 152px;
|
|
|
|
| 718 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] {
|
| 719 |
display: grid !important;
|
| 720 |
grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(106px, 0.85fr) minmax(112px, 0.85fr) !important;
|
| 721 |
+
gap: 0.42rem !important;
|
| 722 |
align-items: stretch !important;
|
| 723 |
width: 100% !important;
|
| 724 |
}
|
|
|
|
| 728 |
justify-content: center !important;
|
| 729 |
text-align: center !important;
|
| 730 |
margin: 0 !important;
|
| 731 |
+
padding: 0.45rem 0.5rem !important;
|
| 732 |
+
min-height: 2.4rem !important;
|
| 733 |
border-radius: 8px !important;
|
| 734 |
border: 1px solid #d4dcd5 !important;
|
| 735 |
background: #ffffff !important;
|
| 736 |
box-shadow: none !important;
|
| 737 |
cursor: pointer !important;
|
| 738 |
+
gap: 0 !important;
|
| 739 |
transition: background 0.12s ease, border-color 0.12s ease !important;
|
| 740 |
}
|
| 741 |
+
/* Hide default radio circle dot & zero out Streamlit's left-offset text wrapper so labels center cleanly */
|
| 742 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label > div:first-child {
|
| 743 |
display: none !important;
|
| 744 |
+
width: 0 !important;
|
| 745 |
+
margin: 0 !important;
|
| 746 |
+
padding: 0 !important;
|
| 747 |
+
}
|
| 748 |
+
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label > div:last-child {
|
| 749 |
+
margin: 0 !important;
|
| 750 |
+
padding: 0 !important;
|
| 751 |
+
width: 100% !important;
|
| 752 |
+
display: flex !important;
|
| 753 |
+
align-items: center !important;
|
| 754 |
+
justify-content: center !important;
|
| 755 |
+
text-align: center !important;
|
| 756 |
}
|
| 757 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label p {
|
| 758 |
+
font-size: 0.81rem !important;
|
| 759 |
+
font-weight: 600 !important;
|
| 760 |
line-height: 1.2 !important;
|
| 761 |
color: #1f241f !important;
|
| 762 |
margin: 0 !important;
|
| 763 |
+
padding: 0 !important;
|
| 764 |
+
width: 100% !important;
|
| 765 |
+
text-align: center !important;
|
| 766 |
}
|
| 767 |
|
| 768 |
+
/* Bright, clean 1-5 color coding on unselected buttons */
|
| 769 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(1) {
|
| 770 |
+
background: #ffe4e6 !important;
|
| 771 |
+
border-color: #fda4af !important;
|
| 772 |
+
}
|
| 773 |
+
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(1) p {
|
| 774 |
+
color: #9f1239 !important;
|
| 775 |
}
|
| 776 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(2) {
|
| 777 |
+
background: #ffedd5 !important;
|
| 778 |
+
border-color: #fdba74 !important;
|
| 779 |
+
}
|
| 780 |
+
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(2) p {
|
| 781 |
+
color: #9a3412 !important;
|
| 782 |
}
|
| 783 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(3) {
|
| 784 |
+
background: #fef9c3 !important;
|
| 785 |
+
border-color: #fde047 !important;
|
| 786 |
+
}
|
| 787 |
+
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(3) p {
|
| 788 |
+
color: #854d0e !important;
|
| 789 |
}
|
| 790 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(4) {
|
| 791 |
+
background: #dcfce7 !important;
|
| 792 |
+
border-color: #86efac !important;
|
| 793 |
+
}
|
| 794 |
+
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(4) p {
|
| 795 |
+
color: #166534 !important;
|
| 796 |
}
|
| 797 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(5) {
|
| 798 |
+
background: #d1fae5 !important;
|
| 799 |
+
border-color: #34d399 !important;
|
| 800 |
+
}
|
| 801 |
+
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(5) p {
|
| 802 |
+
color: #065f46 !important;
|
| 803 |
}
|
| 804 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(6),
|
| 805 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(7) {
|
| 806 |
+
background: #f1f5f9 !important;
|
| 807 |
+
border-color: #cbd5e1 !important;
|
| 808 |
}
|
| 809 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(6) p,
|
| 810 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(7) p {
|
| 811 |
+
color: #475569 !important;
|
| 812 |
}
|
| 813 |
|
| 814 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:hover {
|
| 815 |
border-color: #171917 !important;
|
| 816 |
+
filter: brightness(0.96);
|
| 817 |
}
|
| 818 |
|
| 819 |
+
/* Bright, saturated active fills */
|
| 820 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(1):has(input:checked) {
|
| 821 |
+
background: #f43f5e !important;
|
| 822 |
+
border-color: #e11d48 !important;
|
| 823 |
}
|
| 824 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(2):has(input:checked) {
|
| 825 |
+
background: #f97316 !important;
|
| 826 |
+
border-color: #ea580c !important;
|
| 827 |
}
|
| 828 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(3):has(input:checked) {
|
| 829 |
+
background: #facc15 !important;
|
| 830 |
+
border-color: #eab308 !important;
|
| 831 |
}
|
| 832 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(4):has(input:checked) {
|
| 833 |
+
background: #22c55e !important;
|
| 834 |
+
border-color: #16a34a !important;
|
| 835 |
}
|
| 836 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(5):has(input:checked) {
|
| 837 |
+
background: #10b981 !important;
|
| 838 |
+
border-color: #059669 !important;
|
| 839 |
}
|
| 840 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(6):has(input:checked),
|
| 841 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(7):has(input:checked) {
|
| 842 |
+
background: #64748b !important;
|
| 843 |
+
border-color: #475569 !important;
|
| 844 |
}
|
| 845 |
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:has(input:checked) p {
|
| 846 |
color: #ffffff !important;
|
| 847 |
font-weight: 700 !important;
|
| 848 |
}
|
| 849 |
+
/* High-contrast dark text on bright yellow Mixed/Some button */
|
| 850 |
+
.st-key-rating_questions_grid div[data-testid="stRadio"] div[role="radiogroup"] label:nth-of-type(3):has(input:checked) p {
|
| 851 |
+
color: #1c1917 !important;
|
| 852 |
+
}
|
| 853 |
|
| 854 |
/* Buttons: clean solid strokes & solid forest green primary */
|
| 855 |
div[data-testid="stButton"] button[kind="secondary"] {
|
|
|
|
| 1922 |
answered_count=answered_so_far,
|
| 1923 |
total_questions=len(RATING_QUESTIONS),
|
| 1924 |
)
|
| 1925 |
+
_render_how_to_rate_bar(st)
|
| 1926 |
|
| 1927 |
# Main focused comparison flow: Track A -> Instruction -> Track B
|
| 1928 |
col_a, col_mid, col_b = st.columns([1.15, 0.88, 1.15], gap="medium")
|