Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/ptxqc-web-logo-horizontal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion content/ptxqc_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="➡️"
)
6 changes: 4 additions & 2 deletions content/ptxqc_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="➡️"
)
6 changes: 4 additions & 2 deletions content/ptxqc_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="➡️"
)
31 changes: 28 additions & 3 deletions src/common/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import uuid
import json
import time
import base64
import psutil
import shutil

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -776,13 +791,20 @@ def change_workspace():
"""
<style>
.version-box {
border: 1px solid #a4a5ad;
border: 1px solid #a4a5ad;
padding: 10px;
border-radius: 0.5rem;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
align-items: center;
gap: 8px;
}
.version-box img {
width: 100%;
max-width: 220px;
height: auto;
}
</style>
""",
Expand All @@ -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'<img src="{logo}" alt="PTXQC logo">' if logo else ""
st.markdown(
f'<div class="version-box">{app_name} (version {ver})</div>',
f'<div class="version-box">{logo_img}'
f'<span>{app_name} (version {ver})</span></div>',
unsafe_allow_html=True,
)

Expand Down
Loading