Lara Monteagudo Tubau commited on
Commit Β·
8ada575
1
Parent(s): c045122
Restructure UX into page-based app flow
Browse files- Add Home dashboard with 3 function cards (Transcript, Intercoder, AI Library)
- Convert major functions into clear page-style tabs with navigation buttons
- Add quick help guidance panel for reduced cognitive load
- Improve tab naming and orientation as Page 1/2/3
- Keep workflows separated by function for clarity
1973 unmodified lines197419751976197719781979198019811982198319841985198619871988198919901991199219931980199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205419852055205620572058205920602061206220632064206520662067178 unmodified lines2246224722482170224922502251225222532254225522562257225822592260226189 unmodified lines2351235223532266235423552356235723582359236023612362236323642365236681 unmodified lines244824492450245124522453245424552456245724582459246024612462246324641973 unmodified lines # ββ Pipeline stepper (always visible) ββββββββββββββββββββββββββββββββ pipeline_html = gr.HTML(_pipeline_html("upload"))
# ββ Quick help (modal-style guidance, collapsible) βββββββββββββββββββ with gr.Accordion("Quick Help", open=False): gr.HTML( '<div style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;' 'padding:12px 14px;font-size:0.86em;color:#334155">' '<strong>Recommended flow:</strong> Home β Transcript Pipeline β Intercoder Agreement β AI Library Review.' '<ul style="margin:8px 0 0 18px;line-height:1.6">' '<li>Use the page buttons at the top of each workspace for step-by-step navigation.</li>' '<li>Validation issues are shown inline in red boxes (no disruptive popups).</li>' '<li>Each completed operation returns a small processing report with timing.</li>' '</ul>' '</div>' )
# ββ Agent activity log (shared across all tabs) βββββββββββββββββββββββ agent_log_html = gr.HTML(_agent_log_html([]))
with gr.Tabs(): with gr.Tabs(selected="home") as main_tabs:
# ================================================================== # TAB 0 β Home Dashboard (app-style entry) # ================================================================== with gr.Tab("Home", id="home"): gr.HTML( '<div style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;' 'padding:16px 18px;margin-bottom:14px">' '<h3 style="margin:0 0 6px;color:#1e293b">Choose a workspace</h3>' '<p style="margin:0;color:#64748b;font-size:0.9em">' 'Each workspace is a dedicated page, so you can focus on one task at a time.' '</p>' '</div>' ) with gr.Row(equal_height=True): with gr.Column(scale=1): gr.HTML( '<div style="background:white;border:1px solid #c7d2fe;border-radius:12px;' 'padding:16px;min-height:180px">' '<div style="font-size:0.78em;font-weight:700;color:#6366f1;' 'letter-spacing:0.08em;text-transform:uppercase">Transcript</div>' '<h4 style="margin:8px 0 6px;color:#1e293b">Pipeline Workspace</h4>' '<p style="margin:0;color:#475569;font-size:0.88em;line-height:1.5">' 'Upload transcript, detect sections, review boundaries, and code episodes.' '</p>' '</div>' ) go_pipeline_btn = gr.Button("Open Transcript Workspace", variant="primary")
with gr.Column(scale=1): gr.HTML( '<div style="background:white;border:1px solid #bfdbfe;border-radius:12px;' 'padding:16px;min-height:180px">' '<div style="font-size:0.78em;font-weight:700;color:#2563eb;' 'letter-spacing:0.08em;text-transform:uppercase">Intercoder</div>' '<h4 style="margin:8px 0 6px;color:#1e293b">Agreement Workspace</h4>' '<p style="margin:0;color:#475569;font-size:0.88em;line-height:1.5">' 'Compare two coder files, compute reliability, and resolve disagreements.' '</p>' '</div>' ) go_agreement_btn = gr.Button("Open Intercoder Workspace")
with gr.Column(scale=1): gr.HTML( '<div style="background:white;border:1px solid #bbf7d0;border-radius:12px;' 'padding:16px;min-height:180px">' '<div style="font-size:0.78em;font-weight:700;color:#16a34a;' 'letter-spacing:0.08em;text-transform:uppercase">AI Library</div>' '<h4 style="margin:8px 0 6px;color:#1e293b">Learning Review Workspace</h4>' '<p style="margin:0;color:#475569;font-size:0.88em;line-height:1.5">' 'Review and approve/reject Agent 2 proposed rules for the validated library.' '</p>' '</div>' ) go_rules_btn = gr.Button("Open AI Library Workspace")
# ================================================================== # TAB 1 β Research Pipeline # ================================================================== with gr.Tab("Research Pipeline"): with gr.Tab("Transcript Pipeline", id="pipeline"):
with gr.Row(): gr.HTML( '<div style="background:#eef2ff;border:1px solid #c7d2fe;border-radius:10px;' 'padding:10px 14px;font-size:0.86em;color:#3730a3;flex:1">' '<strong>Page 1 of 3:</strong> Transcript processing and coding workflow.' '</div>' ) to_agreement_btn = gr.Button("Next Page: Intercoder β", size="sm")
with gr.Row(equal_height=False):
178 unmodified lines # ================================================================== # TAB 2 β Inter-Rater Agreement # ================================================================== with gr.Tab("Inter-Rater Agreement"): with gr.Tab("Intercoder Agreement", id="agreement"): with gr.Row(): back_to_pipeline_btn = gr.Button("β Back to Transcript", size="sm") gr.HTML( '<div style="background:#eff6ff;border:1px solid #bfdbfe;border-radius:10px;' 'padding:10px 14px;font-size:0.86em;color:#1e3a8a;flex:1">' '<strong>Page 2 of 3:</strong> Reliability and disagreement resolution.' '</div>' ) to_rules_btn = gr.Button("Next Page: AI Library β", size="sm") with gr.Row(equal_height=False): with gr.Column(scale=4):
89 unmodified lines # ================================================================== # TAB 3 β AI Learning Review # ================================================================== with gr.Tab("AI Learning Review"): with gr.Tab("AI Library Review", id="library"): with gr.Row(): back_to_agreement_btn = gr.Button("β Back to Intercoder", size="sm") gr.HTML( '<div style="background:#f0fdf4;border:1px solid #bbf7d0;border-radius:10px;' 'padding:10px 14px;font-size:0.86em;color:#166534;flex:1">' '<strong>Page 3 of 3:</strong> Validate and curate AI learning rules.' '</div>' ) home_btn = gr.Button("Return Home", size="sm") with gr.Row(equal_height=False): with gr.Column(scale=4):
81 unmodified lines # CALLBACK WIRING # =====================================================================
# App-style page navigation go_pipeline_btn.click(fn=lambda: gr.update(selected="pipeline"), outputs=[main_tabs]) go_agreement_btn.click(fn=lambda: gr.update(selected="agreement"), outputs=[main_tabs]) go_rules_btn.click(fn=lambda: gr.update(selected="library"), outputs=[main_tabs])
to_agreement_btn.click(fn=lambda: gr.update(selected="agreement"), outputs=[main_tabs]) back_to_pipeline_btn.click(fn=lambda: gr.update(selected="pipeline"), outputs=[main_tabs]) to_rules_btn.click(fn=lambda: gr.update(selected="library"), outputs=[main_tabs]) back_to_agreement_btn.click(fn=lambda: gr.update(selected="agreement"), outputs=[main_tabs]) home_btn.click(fn=lambda: gr.update(selected="home"), outputs=[main_tabs])
parse_btn.click( fn=fn_parse, inputs=[transcript_file, session_id_box, researcher_id_box, state],app.py+112-4