+
Skip to content

Give unique button ids to help buttons in create app #3645

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- Update zentered/bluesky-post-action action to v0.3.0 ([#3626](https://github.com/nf-core/tools/pull/3626))
- Update dependency textual to v3.5.0 ([#3636](https://github.com/nf-core/tools/pull/3636))
- Make changelog bot push to correct remote ([#3638](https://github.com/nf-core/tools/pull/3638))
- Give unique button ids to help buttons in create app ([#3645](https://github.com/nf-core/tools/pull/3645))
- Parallelize pytest runs and speed up coverage step ([#3635](https://github.com/nf-core/tools/pull/3635))

## [v3.3.1 - Tungsten Tamarin Patch](https://github.com/nf-core/tools/releases/tag/3.3.1) - [2025-06-02]
Expand Down
8 changes: 4 additions & 4 deletions nf_core/pipelines/create/create.tcss
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ Vertical{
display: block;
height: 12;
}
#show_help {
.show_help {
display: block;
}
#hide_help {
.hide_help {
display: none;
}
.displayed #show_help {
.displayed .show_help {
display: none;
}
.displayed #hide_help {
.displayed .hide_help {
display: block;
}

Expand Down
8 changes: 4 additions & 4 deletions nf_core/pipelines/create/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ def __init__(self, markdown: str, title: str, subtitle: str, field_id: str, defa

def on_button_pressed(self, event: Button.Pressed) -> None:
"""When the button is pressed, change the type of the button."""
if event.button.id == "show_help":
if event.button.id and event.button.id.startswith("show_help_"):
self.add_class("displayed")
elif event.button.id == "hide_help":
elif event.button.id and event.button.id.startswith("hide_help_"):
self.remove_class("displayed")

def compose(self) -> ComposeResult:
Expand All @@ -203,8 +203,8 @@ def compose(self) -> ComposeResult:
Switch(value=self.default, id=self.field_id),
Static(self.title, classes="feature_title"),
Static(self.subtitle, classes="feature_subtitle"),
Button("Show help", id="show_help", variant="primary"),
Button("Hide help", id="hide_help"),
Button("Show help", id="show_help_" + self.field_id, classes="show_help", variant="primary"),
Button("Hide help", id="hide_help_" + self.field_id, classes="hide_help"),
classes="custom_grid",
)
yield HelpText(markdown=self.markdown, classes="help_box")
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions tests/pipelines/test_create_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,8 @@ async def run_before(pilot) -> None:
await pilot.press("tab")
await pilot.press("M", "e")
await pilot.click("#next")
await pilot.press("^p")
await pilot.click("#github_badges")
await pilot.press("tab")
await pilot.press("enter")
await pilot.pause(delay=1)
await pilot.click("#show_help_github_badges")

assert snap_compare(INIT_FILE, terminal_size=(100, 50), run_before=run_before)

Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载