Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic for inferring window title from Tag/TagList objects #138

Merged
merged 3 commits into from
Apr 27, 2022

Conversation

cpsievert
Copy link
Collaborator

Closes #137

Also moves get_window_title to ui._utils in anticipation of #136 (this way navs.py will be able to import bootstrap.py without introducing a circular dependency)

shiny/ui/_utils.py Outdated Show resolved Hide resolved
return " ".join([_find_child_strings(y) for y in x])
return x if isinstance(x, str) else ""
strings = [_find_child_strings(y) for y in x]
return " ".join(filter(lambda x: x != "", strings))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you filter as part of the list comprehension? [_find_child_strings(y) for y in x if y != ""]

Copy link
Collaborator Author

@cpsievert cpsievert Apr 27, 2022

Choose a reason for hiding this comment

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

I wish, but it would miss cases where y != "" and _find_child_strings(y) == ""

@cpsievert cpsievert merged commit 4b81a12 into main Apr 27, 2022
@cpsievert cpsievert deleted the panel-title-fix branch April 27, 2022 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window title isn't inferred correctly from ui.panel_title()
2 participants