Skip to content

Commit 34fb8a8

Browse files
committed
Merge branch 'main' into renderer_gen
* main: docs: Add Tooltip section in experimental (#673) Bump version to 0.5.1 Add missing sidebar stylesheet dep (#667) GitHub action cleanup (#662) Add a triage label to issues created by non-maintainers (#647) Bump version to 0.5.0.9000 Model score example (#650)
2 parents 296e8ff + f469421 commit 34fb8a8

23 files changed

+18792
-51
lines changed

.github/workflows/create-issue.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/triage-issues.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Issue Management
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
jobs:
8+
triage_or_add_to_project:
9+
runs-on: ubuntu-latest
10+
11+
env:
12+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
14+
steps:
15+
- name: Check if the issue creator is a maintainer
16+
id: check_maintainer
17+
run: |
18+
IS_ADMIN=`gh api /repos/rstudio/py-shiny/collaborators/${{ github.event.issue.user.login }}/permission --jq='.user.permissions.admin'`
19+
echo "is_maintainer=$IS_ADMIN" >> "$GITHUB_OUTPUT"
20+
21+
- name: Apply "needs triage" label to issues created by non-maintainers
22+
if: steps.check_maintainer.outputs.is_maintainer == 'false'
23+
run: |
24+
gh issue edit ${{ github.event.issue.number }} --add-label "needs-triage" --repo ${{ github.repository }}

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
### Other changes
1818

1919

20+
## [0.5.1] - 2023-08-08
21+
22+
### Bug fixes
23+
24+
* Fixed #666: Added missing sidebar stylesheet dependency. (#667)
25+
26+
2027
## [0.5.0] - 2023-08-01
2128

2229
### New features

docs/_quartodoc.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,16 @@ quartodoc:
296296
- experimental.ui.value_box
297297
- experimental.ui.showcase_left_center
298298
- experimental.ui.showcase_top_right
299+
- kind: page
300+
path: ExTooltip
301+
summary:
302+
name: "Tooltips"
303+
desc: "Display additional information when focusing (or hovering over) a UI element."
304+
flatten: true
305+
contents:
306+
- experimental.ui.tooltip
307+
- experimental.ui.tooltip_toggle
308+
- experimental.ui.update_tooltip
299309
- kind: page
300310
path: ExFillingLayout
301311
summary:

e2e/bugs/0666-sidebar/app.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
from colors import bg_color, fg_color
2+
3+
from shiny import App, ui
4+
5+
app_ui = ui.page_fluid(
6+
ui.tags.style(
7+
f"""
8+
:root .bslib-sidebar-layout {{
9+
--bslib-sidebar-bg: {bg_color};
10+
--bslib-sidebar-fg: {fg_color};
11+
}}
12+
"""
13+
),
14+
ui.layout_sidebar(
15+
ui.panel_sidebar("`main` - Sidebar content", id="main-sidebar"),
16+
ui.panel_main("`main` - Main content", id="main-content"),
17+
),
18+
# # Can not use X sidebar as only one htmldependency wins.
19+
# import shiny.experimental as x
20+
# x.ui.layout_sidebar(
21+
# x.ui.sidebar(
22+
# "`x` - Sidebar content",
23+
# open="always",
24+
# width=f"{int(4 / 12 * 100)}%",
25+
# id="x-sidebar",
26+
# ),
27+
# "`x` - Main content",
28+
# id="x-content",
29+
# ),
30+
)
31+
32+
app = App(app_ui, None)

e2e/bugs/0666-sidebar/colors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Must use resolved rgb colors
2+
3+
bg_color: str = "rgb(0, 100, 0)" # `darkgreen`
4+
fg_color: str = "rgb(254, 254, 254)" # ~`white` - 1
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from __future__ import annotations
2+
3+
from colors import bg_color, fg_color
4+
from conftest import ShinyAppProc
5+
from playwright.sync_api import Page, expect
6+
7+
8+
def test_colors_are_rgb() -> None:
9+
assert bg_color.startswith("rgb(")
10+
assert fg_color.startswith("rgb(")
11+
12+
13+
def test_sidebar_bg_colors(page: Page, local_app: ShinyAppProc) -> None:
14+
page.goto(local_app.url)
15+
16+
main_content = page.locator("#main-content")
17+
main_sidebar = page.locator("#main-sidebar")
18+
main_layout = main_sidebar.locator("..")
19+
20+
# x_content = page.locator("#x-content")
21+
# x_sidebar = page.locator("#x-sidebar")
22+
# x_layout = x_sidebar.locator("..")
23+
24+
expect(main_layout).to_have_attribute("data-bslib-sidebar-open", "always")
25+
# expect(x_layout).to_have_attribute("data-bslib-sidebar-open", "always")
26+
27+
expect(main_content).to_have_text("`main` - Main content")
28+
# expect(x_content).to_have_text("`x` - Main content")
29+
expect(main_sidebar).to_have_text("`main` - Sidebar content")
30+
# expect(x_sidebar).to_have_text("`x` - Sidebar content")
31+
32+
# Only works if css file is loaded
33+
expect(main_sidebar).to_have_css("background-color", bg_color)
34+
# expect(x_sidebar).to_have_css("background-color", bg_color)
35+
expect(main_sidebar).to_have_css("color", fg_color)
36+
# expect(x_sidebar).to_have_css("color", fg_color)

examples/model-score/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data

0 commit comments

Comments
 (0)