Skip to content

Commit b2a8f13

Browse files
committed
feat: always show run count when sorting by most runs
1 parent 53e473b commit b2a8f13

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

widgets/saved_workflow.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def render_saved_workflow_preview(
2525
page_cls: typing.Union["BasePage", typing.Type["BasePage"]],
2626
published_run: PublishedRun,
2727
*,
28-
show_workspace_author: bool = False,
2928
workflow_pill: str | None = None,
29+
show_workspace_author: bool = False,
30+
show_run_count: bool = False,
3031
hide_visibility_pill: bool = False,
3132
hide_version_notes: bool = False,
3233
hide_last_editor: bool = False,
33-
is_member: bool = False,
3434
):
3535
tb = get_title_breadcrumbs(page_cls, published_run.saved_run, published_run)
3636

@@ -81,10 +81,10 @@ def render_saved_workflow_preview(
8181
render_footer_breadcrumbs(
8282
published_run=published_run,
8383
show_workspace_author=show_workspace_author,
84+
show_run_count=show_run_count,
8485
hide_version_notes=hide_version_notes,
8586
hide_visibility_pill=hide_visibility_pill,
8687
hide_last_editor=hide_last_editor,
87-
is_member=is_member,
8888
)
8989

9090
if output_url:
@@ -166,10 +166,10 @@ def render_footer_breadcrumbs(
166166
*,
167167
published_run: PublishedRun,
168168
show_workspace_author: bool,
169+
show_run_count: bool,
169170
hide_visibility_pill: bool,
170171
hide_version_notes: bool,
171172
hide_last_editor: bool,
172-
is_member: bool,
173173
):
174174
latest_version = published_run.versions.latest()
175175

@@ -218,7 +218,9 @@ def render_footer_breadcrumbs(
218218
className="text-muted",
219219
)
220220

221-
if published_run.run_count and (published_run.run_count >= 50 or is_member):
221+
if show_run_count or (
222+
published_run.run_count and published_run.run_count >= 50
223+
):
222224
run_count = format_number_with_suffix(published_run.run_count)
223225
with gui.div():
224226
gui.write(

widgets/workflow_search.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,16 @@ def _render_run(pr: PublishedRun):
348348
show_workspace_author = not bool(search_filters and search_filters.workspace)
349349
is_member = bool(getattr(pr, "is_member", False))
350350
hide_last_editor = bool(pr.workspace_id and not is_member)
351+
show_run_count = is_member or search_filters.sort == SortOptions.MOST_RUNS.value
351352

352353
render_saved_workflow_preview(
353354
workflow.page_cls,
354355
pr,
355356
workflow_pill=f"{workflow.get_or_create_metadata().emoji} {workflow.short_title}",
356-
hide_visibility_pill=True,
357357
show_workspace_author=show_workspace_author,
358+
show_run_count=show_run_count,
358359
hide_last_editor=hide_last_editor,
359-
is_member=is_member,
360+
hide_visibility_pill=True,
360361
)
361362

362363
grid_layout(1, qs, _render_run)

0 commit comments

Comments
 (0)