Skip to content

Conversation

@raethlein
Copy link
Collaborator

@raethlein raethlein commented Jan 13, 2025

Describe your changes

Closes #10165

Fixes the printing layout of st.logo. Right now it shows on the side (see #10165) but then it will show on the top left and only on the first page.

This PR adds the Streamlit logo to the e2e version of the hello_app test so that the logo printing is tested.

Portrait:

Screenshot 2025-01-13 at 14 25 34 Screenshot 2025-01-13 at 14 25 49

Landscape:

Screenshot 2025-01-13 at 14 26 57 Screenshot 2025-01-13 at 14 26 46

GitHub Issue Link (if applicable)

Testing Plan

  • E2E Tests
    • Add st.logo to the hello_app e2e test to ensure that printing is working as expected

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@raethlein raethlein force-pushed the fix/print-logo-10165 branch from 4c58fc7 to e8147a8 Compare January 13, 2025 13:24
@raethlein raethlein added security-assessment-completed Security assessment has been completed for PR change:chore PR contains maintenance or housekeeping change impact:users PR changes affect end users labels Jan 13, 2025
@raethlein raethlein force-pushed the fix/print-logo-10165 branch from 94cd4c0 to ee2ce89 Compare January 13, 2025 14:09
@raethlein raethlein marked this pull request as ready for review January 13, 2025 14:30
@raethlein raethlein changed the title [WIP] Print st.logo only on first page on the top Print st.logo only on first page on the top Jan 13, 2025
@streamlit streamlit deleted a comment from sfc-gh-lmasuch Jan 13, 2025
Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be more specific to target the img of the logo only?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I have updated the selector to use the stLogo test id. Does this sound good?

Copy link
Collaborator

@lukasmasuch lukasmasuch Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of test-id, it would be better to use a proper class or we could directly link to StyledLogo here (preferred) like its done here:

[`& ${StyledElementContainer}:last-of-type > ${StyledCheckbox}`]: {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great hint, I have updated it to [`& > ${StyledLogo}`]

@raethlein raethlein force-pushed the fix/print-logo-10165 branch from 968c68b to 2f420e9 Compare January 14, 2025 11:36
@raethlein raethlein merged commit 5da1e76 into develop Jan 14, 2025
33 checks passed
edegp pushed a commit to edegp/streamlit that referenced this pull request Jan 19, 2025
## Describe your changes

Closes streamlit#10165

Fixes the printing layout of `st.logo`. Right now it shows on the side
(see streamlit#10165) but with this change it
will show on the top left and only on the first page.

This PR adds the Streamlit logo to the e2e version of the `hello_app`
test so that the logo printing is tested.

## GitHub Issue Link (if applicable)

## Testing Plan

- E2E Tests
- Add `st.logo` to the `hello_app` e2e test to ensure that printing is
working as expected

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
@lukasmasuch lukasmasuch deleted the fix/print-logo-10165 branch March 13, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:chore PR contains maintenance or housekeeping change impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

st.logo makes printing look bad

3 participants