Spaces:
Sleeping
Sleeping
Pointf5ive commited on
Commit Β·
1d3ee6e
1
Parent(s): 36268c6
fix: expose workbook intake panel and wire sidebar workbook upload link
Browse files
app.py
CHANGED
|
@@ -134,6 +134,12 @@ footer { display: none !important; }
|
|
| 134 |
cursor: pointer;
|
| 135 |
}
|
| 136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
/* ββ Hide legacy Gradio controls (Stage 10) βββββββββββββββββββββββββββββββ */
|
| 138 |
#hidden-export, #hidden-status {
|
| 139 |
display: none !important;
|
|
@@ -1146,9 +1152,28 @@ HEAD = """
|
|
| 1146 |
return false;
|
| 1147 |
};
|
| 1148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1149 |
const bindSidebarCodexLinks = () => {
|
| 1150 |
const bindings = [
|
| 1151 |
{ selector: '.js-open-dashboard', handler: switchToDashboardTab },
|
|
|
|
| 1152 |
{ selector: '.js-open-codex', handler: switchToCodexTab },
|
| 1153 |
{ selector: '.js-open-smoke-signal', handler: switchToSmokeSignalTab },
|
| 1154 |
];
|
|
@@ -1388,6 +1413,11 @@ def render_sidebar(active: str = "Home") -> str:
|
|
| 1388 |
attrs.append('role="button"')
|
| 1389 |
attrs.append('tabindex="0"')
|
| 1390 |
attrs.append('aria-label="Open Codex Extractor tab"')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1391 |
class_attr = " ".join(classes)
|
| 1392 |
extra_attrs = f" {' '.join(attrs)}" if attrs else ""
|
| 1393 |
items.append(f'<div class="{class_attr}"{extra_attrs}>{esc(label)}</div>')
|
|
@@ -2862,7 +2892,8 @@ with gr.Blocks(title="TOTEM Studio") as demo:
|
|
| 2862 |
)
|
| 2863 |
run_button = gr.Button("Run TOTEM Analysis", variant="secondary", scale=1)
|
| 2864 |
|
| 2865 |
-
|
|
|
|
| 2866 |
with gr.Column(elem_classes=["wrap"]):
|
| 2867 |
dashboard_workbook_file = gr.File(
|
| 2868 |
label="Workbook (.xlsx or .xlsm)",
|
|
|
|
| 134 |
cursor: pointer;
|
| 135 |
}
|
| 136 |
|
| 137 |
+
.js-workbook-intake-anchor {
|
| 138 |
+
display: block;
|
| 139 |
+
position: relative;
|
| 140 |
+
top: -10px;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
/* ββ Hide legacy Gradio controls (Stage 10) βββββββββββββββββββββββββββββββ */
|
| 144 |
#hidden-export, #hidden-status {
|
| 145 |
display: none !important;
|
|
|
|
| 1152 |
return false;
|
| 1153 |
};
|
| 1154 |
|
| 1155 |
+
const openWorkbookIntake = () => {
|
| 1156 |
+
switchToDashboardTab();
|
| 1157 |
+
setTimeout(() => {
|
| 1158 |
+
const anchor = document.querySelector('.js-workbook-intake-anchor');
|
| 1159 |
+
if (anchor) {
|
| 1160 |
+
anchor.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
| 1161 |
+
}
|
| 1162 |
+
const intake = document.getElementById('workbook-intake-panel');
|
| 1163 |
+
if (intake) {
|
| 1164 |
+
const summary = intake.querySelector('button, summary');
|
| 1165 |
+
if (summary && intake.getAttribute('open') !== 'true') {
|
| 1166 |
+
summary.click();
|
| 1167 |
+
}
|
| 1168 |
+
}
|
| 1169 |
+
}, 120);
|
| 1170 |
+
return true;
|
| 1171 |
+
};
|
| 1172 |
+
|
| 1173 |
const bindSidebarCodexLinks = () => {
|
| 1174 |
const bindings = [
|
| 1175 |
{ selector: '.js-open-dashboard', handler: switchToDashboardTab },
|
| 1176 |
+
{ selector: '.js-open-workbook-intake', handler: openWorkbookIntake },
|
| 1177 |
{ selector: '.js-open-codex', handler: switchToCodexTab },
|
| 1178 |
{ selector: '.js-open-smoke-signal', handler: switchToSmokeSignalTab },
|
| 1179 |
];
|
|
|
|
| 1413 |
attrs.append('role="button"')
|
| 1414 |
attrs.append('tabindex="0"')
|
| 1415 |
attrs.append('aria-label="Open Codex Extractor tab"')
|
| 1416 |
+
if label == "Workbook Upload":
|
| 1417 |
+
classes.append("js-open-workbook-intake")
|
| 1418 |
+
attrs.append('role="button"')
|
| 1419 |
+
attrs.append('tabindex="0"')
|
| 1420 |
+
attrs.append('aria-label="Open Workbook Intake section"')
|
| 1421 |
class_attr = " ".join(classes)
|
| 1422 |
extra_attrs = f" {' '.join(attrs)}" if attrs else ""
|
| 1423 |
items.append(f'<div class="{class_attr}"{extra_attrs}>{esc(label)}</div>')
|
|
|
|
| 2892 |
)
|
| 2893 |
run_button = gr.Button("Run TOTEM Analysis", variant="secondary", scale=1)
|
| 2894 |
|
| 2895 |
+
gr.HTML("<div class='js-workbook-intake-anchor' aria-hidden='true'></div>")
|
| 2896 |
+
with gr.Accordion("Workbook Intake (required for scoring)", open=True, elem_id="workbook-intake-panel"):
|
| 2897 |
with gr.Column(elem_classes=["wrap"]):
|
| 2898 |
dashboard_workbook_file = gr.File(
|
| 2899 |
label="Workbook (.xlsx or .xlsm)",
|