Skip to content

Enhancement: Streamlit UI improvements (Loading screen & Downloads) + import fix#1046

Open
detoxj7 wants to merge 5 commits into
datalab-to:masterfrom
detoxj7:master
Open

Enhancement: Streamlit UI improvements (Loading screen & Downloads) + import fix#1046
detoxj7 wants to merge 5 commits into
datalab-to:masterfrom
detoxj7:master

Conversation

@detoxj7

@detoxj7 detoxj7 commented Jun 6, 2026

Copy link
Copy Markdown

Description

This PR introduces several polished UX improvements to the Streamlit app interface and resolves a module resolution bug that occurs when launching the Streamlit app via the CLI subprocess.

Changes Made

1. Streamlit App UI Improvements (marker/scripts/streamlit_app.py)

  • Animated Loading Screen: Added a full-screen, premium animated loading overlay (with CSS animations, a pulsing logo, and a sliding progress bar) that displays while load_models() executes. Implemented Javascript to hide the default Streamlit chrome (headers, sidebars) while loading, with a smooth fade-out animation once the models are fully cached. This eliminates the awkward "bare" UI state and provides a much better first-impression user experience during the heavy initial AI model download/loading phase.
  • Result Download Button: Added a dynamic download button to the UI that allows users to easily download the processed output. It automatically handles the correct file extension (.md, .json, .html) and MIME type based on the user's selected output format.

2. Module Resolution Fix (marker/scripts/run_streamlit_app.py)

  • Bug Fix: Fixed an issue where the streamlit run subprocess could fail with a ModuleNotFoundError for the marker package depending on the user's environment.
  • Solution: Dynamically resolves the project's root directory and injects it into the PYTHONPATH environment variable before executing the Streamlit subprocess, ensuring the local marker package is always successfully discovered.

Testing

  • Verified that python run_streamlit_app.py correctly passes the PYTHONPATH and boots without import errors.
  • Verified that the loading screen appears on the initial load, properly hides Streamlit's default headers, and smoothly fades away to reveal the UI once the models are loaded.
  • Verified the download button correctly downloads the generated output with the appropriate formatting and file extension.

detoxj7 added 4 commits June 1, 2026 10:58
The Streamlit subprocess could not find the 'marker' package because the project root directory was not in the Python path. This fix dynamically calculates the root directory and injects it into PYTHONPATH when launching the Streamlit app via subprocess.
Added a premium full-screen loading overlay with CSS animations (pulsing icon, gradient title, sliding progress bar, animated dots) that displays while load_models() runs. The loading screen is rendered via st.empty() and cleared once models are cached, providing a polished first-load experience instead of the default 'Running load_models()' text.
Added javascript to hide default Streamlit chrome during the loading overlay and implemented a fade-out animation when the loading finishes for a smoother transition to the app.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@detoxj7

detoxj7 commented Jun 6, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant