Skip to content

Conversation

@sfc-gh-kbregula
Copy link
Contributor

📚 Context

Please describe the project or issue background here

Header elements have anchors that show up when hovering. Sometimes they are visually annoying (e.g. on component.streamlit.app). We already have a parameter anchor – let’s just allow anchor=False to turn them off.

  • What kind of change does this PR introduce?

    • Bugfix
    • Feature
    • Refactoring
    • Other, please describe:

🧠 Description of Changes

  • Add bullet points summarizing your changes here

    • This is a breaking API change
    • This is a visible (user-facing) change

Revised:

Insert screenshot of your updated UI/code here

Current:

Insert screenshot of existing UI/code here

🧪 Testing Done

  • Screenshots included
  • Added/Updated unit tests
  • Added/Updated e2e tests

🌐 References

Does this depend on other work, documents, or tickets?

  • Issue: Closes #XXXX

Contribution License Agreement

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

@sfc-gh-kbregula sfc-gh-kbregula marked this pull request as ready for review February 22, 2023 08:59
Copy link
Contributor

@sfc-gh-tszerszen sfc-gh-tszerszen left a comment

Choose a reason for hiding this comment

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

Just a few questions, generally LGTM 👍

supported colors: blue, green, orange, red, violet.
anchor : str
anchor : str or False
Copy link
Contributor

@sfc-gh-tszerszen sfc-gh-tszerszen Feb 22, 2023

Choose a reason for hiding this comment

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

Will empty string or None be interpreted as anchor=False? should it? In my opinion it should, otherwise LGTM 👍 then maybe we should do anchor : str or None or False and empty sting is interpreted as None / False?

Copy link
Contributor Author

@sfc-gh-kbregula sfc-gh-kbregula Feb 22, 2023

Choose a reason for hiding this comment

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

None means that the value should be generated automatically. It is covered by docstring. We cannot change it, because it will be a breaking change.

If omitted, it generates an anchor using the body.

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it 👍


string anchor = 2;
string body = 3;
bool hide_anchor = 4;
Copy link
Contributor

@sfc-gh-tszerszen sfc-gh-tszerszen Feb 22, 2023

Choose a reason for hiding this comment

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

NIT: I don't mind having more Proto at all, I guess it would be cleaner if we could just hide the anchor when anchor is empty then we don't show it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

an empty anchor field has its existing meaning, so we can't re-use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok 👍

@sfc-gh-tszerszen sfc-gh-tszerszen added the security-assessment-completed Security assessment has been completed for PR label Feb 22, 2023
Copy link
Contributor

@snehankekre snehankekre left a comment

Choose a reason for hiding this comment

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

Approving the docstring changes that LGTM 👍

Copy link
Contributor

@sfc-gh-mnowotka sfc-gh-mnowotka left a comment

Choose a reason for hiding this comment

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

Left 3 comments.

@sfc-gh-kbregula sfc-gh-kbregula force-pushed the sfc-gh-kbregula-anchors branch 2 times, most recently from 74801f9 to 6b01af8 Compare March 9, 2023 22:07
@sfc-gh-kbregula sfc-gh-kbregula force-pushed the sfc-gh-kbregula-anchors branch from 6b01af8 to fb1939b Compare March 10, 2023 08:28
@sfc-gh-mnowotka sfc-gh-mnowotka merged commit b36c33b into develop Mar 20, 2023
tconkling added a commit to tconkling/streamlit that referenced this pull request Mar 27, 2023
* develop:
  StreamlitEndpoints.buildMediaURL (streamlit#6366)
  Set a default for RuntimeConfig.cache_storage_manager (streamlit#6361)
  FullScreenWrapper: add a type declaration for react context usage (streamlit#6364)
  Improve st.help (and st.write's usage of st.help!) (streamlit#5857)
  Fix regression with query_params  (streamlit#6348)
  Have util.calc_md5 also take bytes (streamlit#6358)
  Improve deploy button (streamlit#6223)
  Return whether a secrets.toml file is successfully parsed (streamlit#6333)
  Add `.webp` to list of safe static file extensions (streamlit#6331)
  AppContext docstrings (streamlit#6353)
  fix: upgrade command-line-args from 5.0.2 to 5.2.1 (streamlit#6258)
  fix: upgrade flatbuffers from 1.11.0 to 1.12.0 (streamlit#6259)
  sendMessageToHost: no longer a global function (streamlit#6345)
  Tweak no-else-return config options (streamlit#6343)
  Allow users to set a secrets.toml file in their home directory (streamlit#6230)
  Add support for number and boolean types in categorical columns (streamlit#6248)
  Add support for period type in st.table and st.dataframe (streamlit#5429)
  Add ability to turn off anchors (streamlit#6158)
  Add sqlalchemy mypy types to test-requirements.txt (streamlit#6329)
@sfc-gh-kmcgrady sfc-gh-kmcgrady deleted the sfc-gh-kbregula-anchors branch October 5, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants