Repository navigation
[feat] Add optional alt accessible name to pdf_viewer - #33
Merged
Merged
Conversation
Expose keyword-only alt on the CCv2 data payload and set aria-label (with role=region) on the viewer root so Streamlit can forward st.pdf alt. Co-authored-by: Cursor <cursoragent@cursor.com>
Assert unlabeled viewers stay unnamed and that alt sets a computed accessible name (with role=region) on pdf-container through CCv2. Co-authored-by: Cursor <cursoragent@cursor.com>
Fix unlabeled alt assertion (Playwright requires a value for not_to_have_attribute), drop stale BaseWeb select selectors, and remove an unused height-slider markdown lookup that hit strict mode. Co-authored-by: Cursor <cursoragent@cursor.com>
Current Streamlit sliders no longer expose a stable role=slider thumb for bounding_box; hover the stSlider and click like Streamlit own e2e. Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks
8 tasks done
Pass alt.strip() into CCv2 data and use trimmed string for aria-label so direct pdf_viewer callers get a clean name; assert blank FE has no name. Co-authored-by: Cursor <cursoragent@cursor.com>
sfc-gh-nbellante
approved these changes
Sep 25, 2026
Merged
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.
Summary
alt: str | None = Nonetopdf_viewer; include it in the CCv2datapayload only when non-blankViewerData.altthrough toPdfViewerand setaria-labelonpdf-container, withrole="region"only whenaltis present (so unlabeled viewers stay unchanged)This unblocks Streamlit
st.pdf(..., alt=...)(spec phase 4 /pr10-pdf). Streamlit should bump to a published minor (e.g. 2.1.0) after this lands and is released — do not forwardalt=against 2.0.1.Test plan
npm testinstreamlit_pdf/frontend(36 passed)npm run typecheck