Spaces:
Sleeping
Sleeping
Harden workflow UI contrast
Browse files- app.py +148 -9
- tests/test_app_ui.py +10 -0
app.py
CHANGED
|
@@ -61,19 +61,53 @@ body,
|
|
| 61 |
.gradio-container {
|
| 62 |
--body-background-fill: #f7f8fa;
|
| 63 |
--body-text-color: #111827;
|
|
|
|
| 64 |
--background-fill-primary: #ffffff;
|
| 65 |
--background-fill-secondary: #f8fafc;
|
|
|
|
|
|
|
|
|
|
| 66 |
--block-background-fill: #ffffff;
|
| 67 |
--block-border-color: #d9dee7;
|
| 68 |
--block-label-text-color: #111827;
|
|
|
|
|
|
|
| 69 |
--input-background-fill: #ffffff;
|
|
|
|
| 70 |
--input-border-color: #cbd5e1;
|
|
|
|
| 71 |
--input-placeholder-color: #6b7280;
|
|
|
|
| 72 |
--button-primary-background-fill: #f97316;
|
| 73 |
--button-primary-background-fill-hover: #ea580c;
|
| 74 |
--button-primary-text-color: #ffffff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
--table-border-color: #d9dee7;
|
|
|
|
|
|
|
| 76 |
--table-row-focus: #eff6ff;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
background: #f7f8fa !important;
|
| 78 |
color: #111827 !important;
|
| 79 |
}
|
|
@@ -105,7 +139,8 @@ body,
|
|
| 105 |
}
|
| 106 |
.gradio-container input,
|
| 107 |
.gradio-container textarea,
|
| 108 |
-
.gradio-container select
|
|
|
|
| 109 |
background: #ffffff !important;
|
| 110 |
border-color: #cbd5e1 !important;
|
| 111 |
color: #111827 !important;
|
|
@@ -117,20 +152,55 @@ textarea, .cm-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
|
|
| 117 |
background: #ffffff !important;
|
| 118 |
color: #111827 !important;
|
| 119 |
}
|
| 120 |
-
.compact-panel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
overflow-x: auto;
|
| 122 |
}
|
| 123 |
-
.compact-panel table
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
.compact-panel table,
|
| 125 |
.compact-panel thead,
|
| 126 |
.compact-panel tbody,
|
| 127 |
.compact-panel tr,
|
| 128 |
.compact-panel th,
|
| 129 |
.compact-panel td,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
.compact-panel [role="grid"],
|
| 131 |
.compact-panel [role="row"],
|
| 132 |
.compact-panel [role="columnheader"],
|
| 133 |
.compact-panel [role="gridcell"],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
.compact-panel .ag-root-wrapper,
|
| 135 |
.compact-panel .ag-root,
|
| 136 |
.compact-panel .ag-header,
|
|
@@ -140,34 +210,84 @@ textarea, .cm-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
|
|
| 140 |
.compact-panel .ag-body,
|
| 141 |
.compact-panel .ag-body-viewport,
|
| 142 |
.compact-panel .ag-row,
|
| 143 |
-
.compact-panel .ag-cell
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
background: #ffffff !important;
|
| 145 |
color: #111827 !important;
|
| 146 |
border-color: #d9dee7 !important;
|
| 147 |
}
|
| 148 |
.compact-panel th,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
.compact-panel [role="columnheader"],
|
| 150 |
.compact-panel .ag-header,
|
| 151 |
-
.compact-panel .ag-header-cell
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
background: #f8fafc !important;
|
| 153 |
color: #374151 !important;
|
| 154 |
font-weight: 700 !important;
|
| 155 |
}
|
| 156 |
.compact-panel tbody tr:nth-child(even),
|
| 157 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
background: #f8fafc !important;
|
| 159 |
}
|
| 160 |
.compact-panel tbody tr:nth-child(even) td,
|
| 161 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
background: #f8fafc !important;
|
| 163 |
}
|
| 164 |
.compact-panel .ag-row-selected,
|
| 165 |
-
.compact-panel .ag-row-selected .ag-cell
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
background: #eff6ff !important;
|
| 167 |
color: #111827 !important;
|
| 168 |
}
|
| 169 |
.compact-panel button,
|
| 170 |
-
.compact-panel svg
|
|
|
|
|
|
|
| 171 |
color: #374151 !important;
|
| 172 |
}
|
| 173 |
.workflow-topbar {
|
|
@@ -469,6 +589,25 @@ textarea, .cm-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco,
|
|
| 469 |
.score-gate-row {
|
| 470 |
align-items: stretch;
|
| 471 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 472 |
.stage-result-card {
|
| 473 |
border: 1px solid #d9dee7;
|
| 474 |
border-left: 5px solid #64748b;
|
|
|
|
| 61 |
.gradio-container {
|
| 62 |
--body-background-fill: #f7f8fa;
|
| 63 |
--body-text-color: #111827;
|
| 64 |
+
--body-text-color-subdued: #4b5563;
|
| 65 |
--background-fill-primary: #ffffff;
|
| 66 |
--background-fill-secondary: #f8fafc;
|
| 67 |
+
--border-color-primary: #d9dee7;
|
| 68 |
+
--border-color-accent: #cbd5e1;
|
| 69 |
+
--border-color-accent-subdued: #d9dee7;
|
| 70 |
--block-background-fill: #ffffff;
|
| 71 |
--block-border-color: #d9dee7;
|
| 72 |
--block-label-text-color: #111827;
|
| 73 |
+
--block-label-background-fill: #f8fafc;
|
| 74 |
+
--block-title-text-color: #111827;
|
| 75 |
--input-background-fill: #ffffff;
|
| 76 |
+
--input-background-fill-focus: #ffffff;
|
| 77 |
--input-border-color: #cbd5e1;
|
| 78 |
+
--input-border-color-focus: #2563eb;
|
| 79 |
--input-placeholder-color: #6b7280;
|
| 80 |
+
--input-text-color: #111827;
|
| 81 |
--button-primary-background-fill: #f97316;
|
| 82 |
--button-primary-background-fill-hover: #ea580c;
|
| 83 |
--button-primary-text-color: #ffffff;
|
| 84 |
+
--button-secondary-background-fill: #f8fafc;
|
| 85 |
+
--button-secondary-background-fill-hover: #f1f5f9;
|
| 86 |
+
--button-secondary-border-color: #cbd5e1;
|
| 87 |
+
--button-secondary-border-color-hover: #94a3b8;
|
| 88 |
+
--button-secondary-text-color: #111827;
|
| 89 |
+
--button-secondary-text-color-hover: #111827;
|
| 90 |
+
--checkbox-background-color: #ffffff;
|
| 91 |
+
--checkbox-background-color-hover: #f8fafc;
|
| 92 |
+
--checkbox-background-color-focus: #ffffff;
|
| 93 |
+
--checkbox-background-color-selected: #f97316;
|
| 94 |
+
--checkbox-border-color: #cbd5e1;
|
| 95 |
+
--checkbox-border-color-hover: #94a3b8;
|
| 96 |
+
--checkbox-border-color-focus: #f97316;
|
| 97 |
+
--checkbox-border-color-selected: #f97316;
|
| 98 |
--table-border-color: #d9dee7;
|
| 99 |
+
--table-even-background-fill: #f8fafc;
|
| 100 |
+
--table-odd-background-fill: #ffffff;
|
| 101 |
--table-row-focus: #eff6ff;
|
| 102 |
+
--ag-background-color: #ffffff;
|
| 103 |
+
--ag-foreground-color: #111827;
|
| 104 |
+
--ag-data-color: #111827;
|
| 105 |
+
--ag-border-color: #d9dee7;
|
| 106 |
+
--ag-header-background-color: #f8fafc;
|
| 107 |
+
--ag-header-foreground-color: #374151;
|
| 108 |
+
--ag-odd-row-background-color: #f8fafc;
|
| 109 |
+
--ag-row-hover-color: #eff6ff;
|
| 110 |
+
--ag-selected-row-background-color: #eff6ff;
|
| 111 |
background: #f7f8fa !important;
|
| 112 |
color: #111827 !important;
|
| 113 |
}
|
|
|
|
| 139 |
}
|
| 140 |
.gradio-container input,
|
| 141 |
.gradio-container textarea,
|
| 142 |
+
.gradio-container select,
|
| 143 |
+
.gradio-container [contenteditable="true"] {
|
| 144 |
background: #ffffff !important;
|
| 145 |
border-color: #cbd5e1 !important;
|
| 146 |
color: #111827 !important;
|
|
|
|
| 152 |
background: #ffffff !important;
|
| 153 |
color: #111827 !important;
|
| 154 |
}
|
| 155 |
+
.compact-panel,
|
| 156 |
+
.gradio-container [data-testid="dataframe"],
|
| 157 |
+
.gradio-container .dataframe,
|
| 158 |
+
.gradio-container .table-wrap,
|
| 159 |
+
.gradio-container .table-wrapper {
|
| 160 |
+
background: #ffffff !important;
|
| 161 |
+
color: #111827 !important;
|
| 162 |
overflow-x: auto;
|
| 163 |
}
|
| 164 |
+
.compact-panel table,
|
| 165 |
+
.gradio-container [data-testid="dataframe"] table,
|
| 166 |
+
.gradio-container .dataframe table,
|
| 167 |
+
.gradio-container .table-wrap table {
|
| 168 |
+
font-size: 12px;
|
| 169 |
+
}
|
| 170 |
.compact-panel table,
|
| 171 |
.compact-panel thead,
|
| 172 |
.compact-panel tbody,
|
| 173 |
.compact-panel tr,
|
| 174 |
.compact-panel th,
|
| 175 |
.compact-panel td,
|
| 176 |
+
.gradio-container [data-testid="dataframe"] table,
|
| 177 |
+
.gradio-container [data-testid="dataframe"] thead,
|
| 178 |
+
.gradio-container [data-testid="dataframe"] tbody,
|
| 179 |
+
.gradio-container [data-testid="dataframe"] tr,
|
| 180 |
+
.gradio-container [data-testid="dataframe"] th,
|
| 181 |
+
.gradio-container [data-testid="dataframe"] td,
|
| 182 |
+
.gradio-container .dataframe table,
|
| 183 |
+
.gradio-container .dataframe thead,
|
| 184 |
+
.gradio-container .dataframe tbody,
|
| 185 |
+
.gradio-container .dataframe tr,
|
| 186 |
+
.gradio-container .dataframe th,
|
| 187 |
+
.gradio-container .dataframe td,
|
| 188 |
+
.gradio-container .table-wrap table,
|
| 189 |
+
.gradio-container .table-wrap thead,
|
| 190 |
+
.gradio-container .table-wrap tbody,
|
| 191 |
+
.gradio-container .table-wrap tr,
|
| 192 |
+
.gradio-container .table-wrap th,
|
| 193 |
+
.gradio-container .table-wrap td,
|
| 194 |
.compact-panel [role="grid"],
|
| 195 |
.compact-panel [role="row"],
|
| 196 |
.compact-panel [role="columnheader"],
|
| 197 |
.compact-panel [role="gridcell"],
|
| 198 |
+
.compact-panel .table-container,
|
| 199 |
+
.compact-panel .virtual-table-viewport,
|
| 200 |
+
.compact-panel .virtual-body,
|
| 201 |
+
.compact-panel .virtual-row,
|
| 202 |
+
.compact-panel .body-cell,
|
| 203 |
+
.compact-panel .cell-wrap,
|
| 204 |
.compact-panel .ag-root-wrapper,
|
| 205 |
.compact-panel .ag-root,
|
| 206 |
.compact-panel .ag-header,
|
|
|
|
| 210 |
.compact-panel .ag-body,
|
| 211 |
.compact-panel .ag-body-viewport,
|
| 212 |
.compact-panel .ag-row,
|
| 213 |
+
.compact-panel .ag-cell,
|
| 214 |
+
.gradio-container [role="grid"],
|
| 215 |
+
.gradio-container [role="row"],
|
| 216 |
+
.gradio-container [role="columnheader"],
|
| 217 |
+
.gradio-container [role="gridcell"],
|
| 218 |
+
.gradio-container .table-container,
|
| 219 |
+
.gradio-container .virtual-table-viewport,
|
| 220 |
+
.gradio-container .virtual-body,
|
| 221 |
+
.gradio-container .virtual-row,
|
| 222 |
+
.gradio-container .body-cell,
|
| 223 |
+
.gradio-container .cell-wrap,
|
| 224 |
+
.gradio-container .ag-root-wrapper,
|
| 225 |
+
.gradio-container .ag-root,
|
| 226 |
+
.gradio-container .ag-header,
|
| 227 |
+
.gradio-container .ag-header-row,
|
| 228 |
+
.gradio-container .ag-center-cols-container,
|
| 229 |
+
.gradio-container .ag-center-cols-viewport,
|
| 230 |
+
.gradio-container .ag-body,
|
| 231 |
+
.gradio-container .ag-body-viewport,
|
| 232 |
+
.gradio-container .ag-row,
|
| 233 |
+
.gradio-container .ag-cell {
|
| 234 |
background: #ffffff !important;
|
| 235 |
color: #111827 !important;
|
| 236 |
border-color: #d9dee7 !important;
|
| 237 |
}
|
| 238 |
.compact-panel th,
|
| 239 |
+
.gradio-container [data-testid="dataframe"] th,
|
| 240 |
+
.gradio-container .dataframe th,
|
| 241 |
+
.gradio-container .table-wrap th,
|
| 242 |
+
.compact-panel .header-table,
|
| 243 |
+
.compact-panel .header-cell,
|
| 244 |
.compact-panel [role="columnheader"],
|
| 245 |
.compact-panel .ag-header,
|
| 246 |
+
.compact-panel .ag-header-cell,
|
| 247 |
+
.gradio-container .header-table,
|
| 248 |
+
.gradio-container .header-cell,
|
| 249 |
+
.gradio-container [role="columnheader"],
|
| 250 |
+
.gradio-container .ag-header,
|
| 251 |
+
.gradio-container .ag-header-cell {
|
| 252 |
background: #f8fafc !important;
|
| 253 |
color: #374151 !important;
|
| 254 |
font-weight: 700 !important;
|
| 255 |
}
|
| 256 |
.compact-panel tbody tr:nth-child(even),
|
| 257 |
+
.gradio-container [data-testid="dataframe"] tbody tr:nth-child(even),
|
| 258 |
+
.gradio-container .dataframe tbody tr:nth-child(even),
|
| 259 |
+
.gradio-container .table-wrap tbody tr:nth-child(even),
|
| 260 |
+
.compact-panel .virtual-row.row-odd,
|
| 261 |
+
.gradio-container .virtual-row.row-odd,
|
| 262 |
+
.compact-panel .ag-row-even,
|
| 263 |
+
.gradio-container .ag-row-even {
|
| 264 |
background: #f8fafc !important;
|
| 265 |
}
|
| 266 |
.compact-panel tbody tr:nth-child(even) td,
|
| 267 |
+
.gradio-container [data-testid="dataframe"] tbody tr:nth-child(even) td,
|
| 268 |
+
.gradio-container .dataframe tbody tr:nth-child(even) td,
|
| 269 |
+
.gradio-container .table-wrap tbody tr:nth-child(even) td,
|
| 270 |
+
.compact-panel .virtual-row.row-odd .body-cell,
|
| 271 |
+
.compact-panel .virtual-row.row-odd .cell-wrap,
|
| 272 |
+
.gradio-container .virtual-row.row-odd .body-cell,
|
| 273 |
+
.gradio-container .virtual-row.row-odd .cell-wrap,
|
| 274 |
+
.compact-panel .ag-row-even .ag-cell,
|
| 275 |
+
.gradio-container .ag-row-even .ag-cell {
|
| 276 |
background: #f8fafc !important;
|
| 277 |
}
|
| 278 |
.compact-panel .ag-row-selected,
|
| 279 |
+
.compact-panel .ag-row-selected .ag-cell,
|
| 280 |
+
.gradio-container .ag-row-selected,
|
| 281 |
+
.gradio-container .ag-row-selected .ag-cell,
|
| 282 |
+
.gradio-container tr[aria-selected="true"],
|
| 283 |
+
.gradio-container tr[aria-selected="true"] td {
|
| 284 |
background: #eff6ff !important;
|
| 285 |
color: #111827 !important;
|
| 286 |
}
|
| 287 |
.compact-panel button,
|
| 288 |
+
.compact-panel svg,
|
| 289 |
+
.gradio-container [data-testid="dataframe"] button,
|
| 290 |
+
.gradio-container [data-testid="dataframe"] svg {
|
| 291 |
color: #374151 !important;
|
| 292 |
}
|
| 293 |
.workflow-topbar {
|
|
|
|
| 589 |
.score-gate-row {
|
| 590 |
align-items: stretch;
|
| 591 |
}
|
| 592 |
+
.score-gate .form,
|
| 593 |
+
.score-gate .wrap,
|
| 594 |
+
.score-gate .contain,
|
| 595 |
+
.score-gate .block,
|
| 596 |
+
.score-gate [data-testid="row"],
|
| 597 |
+
.score-gate [data-testid="column"],
|
| 598 |
+
.screen-card .form,
|
| 599 |
+
.screen-card .wrap,
|
| 600 |
+
.screen-card .contain {
|
| 601 |
+
background: #f8fafc !important;
|
| 602 |
+
color: #111827 !important;
|
| 603 |
+
border-color: #d9dee7 !important;
|
| 604 |
+
}
|
| 605 |
+
.screen-card .block,
|
| 606 |
+
.artifact-workspace .block {
|
| 607 |
+
background: #ffffff !important;
|
| 608 |
+
color: #111827 !important;
|
| 609 |
+
border-color: #d9dee7 !important;
|
| 610 |
+
}
|
| 611 |
.stage-result-card {
|
| 612 |
border: 1px solid #d9dee7;
|
| 613 |
border-left: 5px solid #64748b;
|
tests/test_app_ui.py
CHANGED
|
@@ -97,11 +97,21 @@ def test_activity_messages_render_distinct_pending_and_complete_states():
|
|
| 97 |
def test_light_theme_css_covers_gradio_dataframes_and_action_hierarchy():
|
| 98 |
assert ":root" in CSS
|
| 99 |
assert "color-scheme: light" in CSS
|
|
|
|
|
|
|
|
|
|
| 100 |
assert ".compact-panel .ag-header" in CSS
|
| 101 |
assert '.compact-panel [role="gridcell"]' in CSS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
assert ".production-action" in CSS
|
| 103 |
assert ".approval-action" in CSS
|
| 104 |
assert ".score-gate" in CSS
|
|
|
|
| 105 |
|
| 106 |
|
| 107 |
def test_stage_score_gate_panel_renders_pending_and_scored_states():
|
|
|
|
| 97 |
def test_light_theme_css_covers_gradio_dataframes_and_action_hierarchy():
|
| 98 |
assert ":root" in CSS
|
| 99 |
assert "color-scheme: light" in CSS
|
| 100 |
+
assert "--border-color-primary: #d9dee7" in CSS
|
| 101 |
+
assert "--body-text-color-subdued: #4b5563" in CSS
|
| 102 |
+
assert "--ag-background-color: #ffffff" in CSS
|
| 103 |
assert ".compact-panel .ag-header" in CSS
|
| 104 |
assert '.compact-panel [role="gridcell"]' in CSS
|
| 105 |
+
assert ".compact-panel .virtual-row" in CSS
|
| 106 |
+
assert ".compact-panel .body-cell" in CSS
|
| 107 |
+
assert '.gradio-container [data-testid="dataframe"] tbody tr:nth-child(even)' in CSS
|
| 108 |
+
assert '.gradio-container [role="gridcell"]' in CSS
|
| 109 |
+
assert ".gradio-container .header-table" in CSS
|
| 110 |
+
assert ".gradio-container .virtual-row.row-odd" in CSS
|
| 111 |
assert ".production-action" in CSS
|
| 112 |
assert ".approval-action" in CSS
|
| 113 |
assert ".score-gate" in CSS
|
| 114 |
+
assert '.score-gate [data-testid="column"]' in CSS
|
| 115 |
|
| 116 |
|
| 117 |
def test_stage_score_gate_panel_renders_pending_and_scored_states():
|