diff --git a/assets/ptxqc-web-logo-horizontal.svg b/assets/ptxqc-web-logo-horizontal.svg new file mode 100644 index 0000000..cd3fe56 --- /dev/null +++ b/assets/ptxqc-web-logo-horizontal.svg @@ -0,0 +1 @@ +PTXQC web \ No newline at end of file diff --git a/content/ptxqc_configure.py b/content/ptxqc_configure.py index 5893a7a..faf36ce 100644 --- a/content/ptxqc_configure.py +++ b/content/ptxqc_configure.py @@ -10,4 +10,6 @@ # Configuration is optional — always offer the link to step 3. import streamlit as st st.divider() -st.page_link("content/ptxqc_run.py", label="Next: **3. Create Report**", icon="🚀") +st.page_link( + "content/ptxqc_run.py", label="Next step: **3. Create Report**", icon="➡️" +) diff --git a/content/ptxqc_run.py b/content/ptxqc_run.py index 41bc55b..8599c78 100644 --- a/content/ptxqc_run.py +++ b/content/ptxqc_run.py @@ -10,5 +10,7 @@ # Once a report exists, link to step 4 to view it. if wf.has_report(): import streamlit as st - st.success("✅ Report ready. Next step:") - st.page_link("content/ptxqc_results.py", label="**4. Report**", icon="📊") + st.success("✅ Report ready.") + st.page_link( + "content/ptxqc_results.py", label="Next step: **4. Report**", icon="➡️" + ) diff --git a/content/ptxqc_upload.py b/content/ptxqc_upload.py index 330562f..5c2643b 100644 --- a/content/ptxqc_upload.py +++ b/content/ptxqc_upload.py @@ -10,5 +10,7 @@ # Step 1 done once data is staged → offer the link to step 2. if wf.has_inputs(): import streamlit as st - st.success("✅ Data uploaded. Next step:") - st.page_link("content/ptxqc_configure.py", label="**2. Configure**", icon="⚙️") + st.success("✅ Data uploaded.") + st.page_link( + "content/ptxqc_configure.py", label="Next step: **2. Configure**", icon="➡️" + ) diff --git a/src/common/common.py b/src/common/common.py index da5a30e..5097c64 100644 --- a/src/common/common.py +++ b/src/common/common.py @@ -3,6 +3,7 @@ import uuid import json import time +import base64 import psutil import shutil @@ -565,6 +566,20 @@ def page_setup(page: str = "") -> dict[str, Any]: return params +@st.cache_data +def get_ptxqc_logo_data_uri() -> str: + """ + Returns the local PTXQC logo as a base64 data URI for inline HTML embedding, + or an empty string if the asset is missing. Inlined because Streamlit does not + serve assets/ over HTTP by default. + """ + logo_path = Path("assets", "ptxqc-web-logo-horizontal.svg") + if not logo_path.exists(): + return "" + encoded = base64.b64encode(logo_path.read_bytes()).decode() + return f"data:image/svg+xml;base64,{encoded}" + + def render_sidebar(page: str = "") -> None: """ Renders the sidebar on the Streamlit app, which includes the workspace switcher, @@ -776,13 +791,20 @@ def change_workspace(): """ """, @@ -792,8 +814,11 @@ def change_workspace(): meta = get_ptxqc_metadata() ver = meta["version"] if meta.get("available") else "unknown" app_name = st.session_state.settings["app-name"] + logo = get_ptxqc_logo_data_uri() + logo_img = f'PTXQC logo' if logo else "" st.markdown( - f'
{app_name} (version {ver})
', + f'
{logo_img}' + f'{app_name} (version {ver})
', unsafe_allow_html=True, )