Fix sidebar parameter action alignment and PDF report print rendering Issue#38#48
Open
EddW1219 wants to merge 3 commits into
Open
Fix sidebar parameter action alignment and PDF report print rendering Issue#38#48EddW1219 wants to merge 3 commits into
EddW1219 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR addresses UI layout issues in the sidebar parameter actions and improves PDF/print rendering for the report view to prevent chart/text overlap and math rendering artifacts.
Changes:
- Adds scoped CSS to align “Reset Parameters” and “Save Parameters” controls consistently in the sidebar action row.
- Consolidates print-only CSS rules to improve chart spacing, heading separation, and formula rendering in exported PDFs.
- Adjusts a report model snippet to wrap a LaTeX block with centered HTML.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/epicc/main.py | Adds CSS for action-row alignment and print/PDF rendering; refactors parameter action buttons into a keyed container for styling. |
| src/epicc/model/models/tb_isolation.yaml | Wraps a display-math block in a centered HTML div and tweaks the LaTeX test string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+245
to
+250
| button_col2.button( | ||
| "Save Parameters", | ||
| disabled=True, | ||
| width="stretch", | ||
| help="Fix parameter errors first", | ||
| ) |
Comment on lines
+35
to
+140
| st.markdown( | ||
| """ | ||
| <style> | ||
| /* Action row wrapper */ | ||
| .st-key-param-actions-row [data-testid="stHorizontalBlock"] { | ||
| align-items: flex-start !important; | ||
| } | ||
|
|
||
| /* Normalize column internal spacing */ | ||
| .st-key-param-actions-row [data-testid="column"] > div { | ||
| padding-top: 0 !important; | ||
| } | ||
| .st-key-param-actions-row [data-testid="stElementContainer"] { | ||
| margin-top: 0 !important; | ||
| margin-bottom: 0 !important; | ||
| } | ||
|
|
||
| /* Make trigger controls fill width and remove extra top offset */ | ||
| .st-key-param-actions-row [data-testid="stButton"], | ||
| .st-key-param-actions-row [data-testid="stPopover"] { | ||
| width: 100%; | ||
| margin-top: 0 !important; | ||
| padding-top: 0 !important; | ||
| } | ||
| .st-key-param-actions-row [data-testid="stButton"] > button, | ||
| .st-key-param-actions-row [data-testid="stPopover"] > button { | ||
| width: 100%; | ||
| } | ||
|
|
||
| /* Report spacing: keep headings away from charts */ | ||
| .st-key-results-report [data-testid="stPlotlyChart"], | ||
| .st-key-results-report [data-testid="stVegaLiteChart"], | ||
| .st-key-results-report [data-testid="stPyplot"] { | ||
| margin-bottom: 2rem !important; | ||
| } | ||
|
|
||
| .st-key-results-report [data-testid="stMarkdownContainer"] h1, | ||
| .st-key-results-report [data-testid="stMarkdownContainer"] h2, | ||
| .st-key-results-report [data-testid="stMarkdownContainer"] h3 { | ||
| margin-top: 1.25rem !important; | ||
| } | ||
|
|
||
| /* -------- Print/PDF display fixes only (SINGLE CONSOLIDATED BLOCK) -------- */ | ||
| @media print { | ||
| /* Scope strictly to report area */ | ||
| .st-key-results-report { | ||
| overflow: visible !important; | ||
| } | ||
|
|
||
| /* 1) Keep chart block in flow + reserve vertical space below chart */ | ||
| .st-key-results-report [data-testid="stPlotlyChart"], | ||
| .st-key-results-report [data-testid="stVegaLiteChart"], | ||
| .st-key-results-report [data-testid="stPyplot"] { | ||
| display: block !important; | ||
| position: static !important; | ||
| clear: both !important; | ||
| overflow: visible !important; | ||
| break-inside: avoid !important; | ||
| page-break-inside: avoid !important; | ||
| margin: 0 0 2.8rem 0 !important; | ||
| padding-bottom: 1.2rem !important; | ||
| } | ||
|
|
||
| /* Prevent Plotly print-height collapse */ | ||
| .st-key-results-report [data-testid="stPlotlyChart"] .js-plotly-plot { | ||
| min-height: 520px !important; | ||
| } | ||
|
|
||
| /* 2) Ensure headings/text start after chart and have breathing room */ | ||
| .st-key-results-report h1, | ||
| .st-key-results-report h2, | ||
| .st-key-results-report h3, | ||
| .st-key-results-report h4, | ||
| .st-key-results-report p, | ||
| .st-key-results-report [data-testid="stMarkdownContainer"] { | ||
| clear: both !important; | ||
| position: static !important; | ||
| z-index: auto !important; | ||
| margin-top: 1.5rem !important; | ||
| } | ||
|
|
||
| .st-key-results-report [data-testid="stMarkdownContainer"] h1, | ||
| .st-key-results-report [data-testid="stMarkdownContainer"] h2, | ||
| .st-key-results-report [data-testid="stMarkdownContainer"] h3 { | ||
| margin-top: 1.5rem !important; | ||
| clear: both !important; | ||
| } | ||
|
|
||
| /* 3) Formula print fix: show only visual layer, hide assistive MathML */ | ||
| .st-key-results-report .katex, | ||
| .st-key-results-report .katex-display, | ||
| .st-key-results-report mjx-container, | ||
| .st-key-results-report .MathJax { | ||
| visibility: visible !important; | ||
| opacity: 1 !important; | ||
| } | ||
|
|
||
| .st-key-results-report .katex .katex-mathml, | ||
| .st-key-results-report mjx-assistive-mml { | ||
| display: none !important; | ||
| } | ||
| } | ||
| </style> | ||
| """, | ||
| unsafe_allow_html=True, | ||
| ) |
Comment on lines
+330
to
+336
| <div style="text-align: center;"> | ||
|
|
||
| $$ | ||
| \LaTeX \text{ test.} | ||
| \text{LaTeX test.} | ||
| $$ | ||
|
|
||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix Reset/Save parameter button alignment
Aligns Reset Parameters and Save Parameters buttons consistently in the sidebar.
Fix PDF print layout (report view).
Improves print-only chart/text flow to prevent overlap in exported PDF.
Consolidates print CSS behavior for chart spacing and heading separation.
Fixes formula rendering in PDF by preserving visual math output and suppressing assistive MathML in print.