Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b7892c3
Add option to hide 'updated at' timestamp in saved workflow preview
avi-007 Jun 19, 2025
7c5043c
Removed underline and added reordering of sub text logic
avi-007 Jun 24, 2025
2152f17
Merge branch 'master' into explore-page-fix
avi-007 Jun 24, 2025
3c89f57
added logic to show run count to a user in workspace
avi-007 Jun 24, 2025
00b81b9
fixed run count shown for all users
avi-007 Jun 24, 2025
7a2c92d
fixed the styling for workspace for individual workflow pages
avi-007 Jun 24, 2025
44db178
addressed coderabbit review comments
avi-007 Jun 25, 2025
c187ffc
Merge branch 'master' into explore-page-fix
avi-007 Jun 25, 2025
639c9ac
addressed coderabbit review comments
avi-007 Jun 25, 2025
06dd3f4
removed dot chars between the sub text, updated styling for run count…
avi-007 Jun 25, 2025
e0edc9a
fixed inconsistent spacing between subtext elements
avi-007 Jun 25, 2025
adc751c
added consistent spacing in footer elements
avi-007 Jun 27, 2025
d57a376
formatting fixed
avi-007 Jun 27, 2025
27071db
Merge branch 'refs/heads/master' into explore-page-fix
avi-007 Jun 27, 2025
6cfa801
removed underline logic for hyperlink
avi-007 Jun 27, 2025
6119aad
Merge branch 'master' into explore-page-fix
avi-007 Jun 30, 2025
39ee2f7
refactor: simplify ownership check in is_user_workspace_owner functio…
avi-007 Jun 30, 2025
70fc307
fix: add missing newline at end of file in workspace.py
avi-007 Jun 30, 2025
bbdb589
refactor: enhance layout and styling of footer elements and run count…
avi-007 Jul 2, 2025
884a28f
Merge branch 'master' into explore-page-fix
avi-007 Jul 2, 2025
a89322a
refactor: update footer layout and styling for improved responsivenes…
avi-007 Jul 3, 2025
2aed697
Merge branch 'master' into explore-page-fix
avi-007 Jul 3, 2025
d823679
fix: add missing newline at end of file in saved_workflow.py
avi-007 Jul 3, 2025
0f3263d
feat: inline column selector in bulk runner
devxpy Jul 13, 2025
92f03b6
Merge branch 'master' into explore-page-fix
avi-007 Jul 14, 2025
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
19 changes: 9 additions & 10 deletions widgets/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,15 @@ def render_image(page: BasePage):
def _render_as_featured(page_cls: typing.Type[BasePage]):
page = page_cls()
render_image(page)
# total_runs = page.get_total_runs()
# render_description(page, state, total_runs)
render_description(page)


def _render_non_featured(page_cls):
def _render_non_featured(page_cls: typing.Type[BasePage]):
page = page_cls()
col1, col2 = gui.columns([1, 2])
with col1:
render_image(page)
with col2:
# total_runs = page.get_total_runs()
# render_description(page, state, total_runs)
render_description(page)


Expand All @@ -113,10 +109,13 @@ def render_description(page: BasePage):
root_pr = page.get_root_pr()
with gui.div(className="mb-3"):
gui.write(root_pr.notes, line_clamp=4)

if root_pr.run_count >= 50:
run_count = format_number_with_suffix(root_pr.run_count)
gui.caption(
f"{icons.run} {run_count} runs",
unsafe_allow_html=True,
style={"fontSize": "0.9rem"},
)
with gui.div(className="d-flex align-items-center"):
gui.caption(
f"{icons.run} {run_count} runs",
unsafe_allow_html=True,
className="text-muted",
style={"fontSize": "0.9rem"},
)
88 changes: 49 additions & 39 deletions widgets/saved_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@
def render_saved_workflow_preview(
page_cls: typing.Union["BasePage", typing.Type["BasePage"]],
published_run: PublishedRun,
*,
show_workspace_author: bool = False,
workflow_pill: str | None = None,
hide_visibility_pill: bool = False,
hide_version_notes: bool = False,
hide_last_editor: bool = False,
is_member: bool = False,
):
tb = get_title_breadcrumbs(page_cls, published_run.saved_run, published_run)

Expand Down Expand Up @@ -82,6 +84,7 @@ def render_saved_workflow_preview(
hide_version_notes=hide_version_notes,
hide_visibility_pill=hide_visibility_pill,
hide_last_editor=hide_last_editor,
is_member=is_member,
)

if output_url:
Expand Down Expand Up @@ -129,7 +132,7 @@ def render_title_pills(published_run: PublishedRun, workflow_pill: str | None):
white-space: nowrap;
}
& .author-name {
max-width: 150px;
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
}
Expand All @@ -141,31 +144,32 @@ def render_title_pills(published_run: PublishedRun, workflow_pill: str | None):
margin: 0 2px;
text-align: center;
}
& > :not(:empty):not(:first-child):not(.newline-sm):before {
content: "•";
margin: 0 0.5rem;
color: black;
display: inline-block;
vertical-align: middle;
& > div {
margin-right: 0.75rem;
display: flex;
align-items: center;
}
@media (max-width: 768px) {
& .newline-sm {
width: 100%;
height: 0.12rem;
& {
gap: 0.25rem 0.75rem;
align-items: start;
white-space: normal;
}
& .newline-sm:before, & .newline-sm + :before {
content: unset !important;
& > div {
margin: 0;
}
}
"""


def render_footer_breadcrumbs(
*,
published_run: PublishedRun,
show_workspace_author: bool,
hide_visibility_pill: bool,
hide_version_notes: bool,
hide_last_editor: bool,
is_member: bool,
):
latest_version = published_run.versions.latest()

Expand All @@ -175,47 +179,53 @@ def render_footer_breadcrumbs(
className="flex-grow-1 d-flex align-items-end flex-wrap flex-lg-nowrap"
),
):
if not hide_version_notes and latest_version and latest_version.change_notes:
gui.caption(
f"{icons.notes} {html.escape(latest_version.change_notes)}",
unsafe_allow_html=True,
line_clamp=1,
lineClampExpand=False,
)
gui.div(className="newline-sm")

if published_run.workspace.is_personal:
show_workspace_author = False
if show_workspace_author:
# don't repeat author for personal workspaces
with gui.div(className="d-flex align-items-center"):
with gui.div():
render_author_from_workspace(
published_run.workspace, image_size="24px", responsive=False
published_run.workspace,
image_size="24px",
responsive=False,
)

if not hide_last_editor and published_run.last_edited_by:
with gui.div(className="d-flex align-items-center text-truncate"):
with gui.div(className="text-truncate"):
render_author_from_user(
published_run.last_edited_by, image_size="24px", responsive=False
published_run.last_edited_by,
image_size="24px",
responsive=False,
)
if show_workspace_author:
gui.div(className="newline-sm")

if not hide_version_notes and latest_version and latest_version.change_notes:
with gui.div(
className="text-truncate text-muted",
style={"maxWidth": "250px"},
):
gui.html(f"{icons.notes} {html.escape(latest_version.change_notes)}")

updated_at = published_run.saved_run.updated_at
if updated_at and isinstance(updated_at, datetime.datetime):
gui.write(
f"{icons.time} {get_relative_time(updated_at)}",
unsafe_allow_html=True,
)
if (
updated_at
and isinstance(updated_at, datetime.datetime)
and not hide_last_editor
):
with gui.div():
gui.write(
f"{icons.time} {get_relative_time(updated_at)}",
unsafe_allow_html=True,
className="text-muted",
)

if published_run.run_count >= 50:
if published_run.run_count and (published_run.run_count >= 50 or is_member):
run_count = format_number_with_suffix(published_run.run_count)
gui.write(
f"{icons.run} {run_count} runs",
unsafe_allow_html=True,
className="text-dark text-nowrap",
)
gui.div(className="newline-sm")
with gui.div():
gui.write(
f"{icons.run} {run_count} runs",
unsafe_allow_html=True,
className="text-muted text-nowrap",
)

if not hide_visibility_pill:
gui.caption(
Expand Down
29 changes: 17 additions & 12 deletions widgets/workflow_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,25 @@ def _render_selectbox(
def render_search_results(user: AppUser | None, search_filters: SearchFilters):
qs = get_filtered_published_runs(user, search_filters)
qs = qs.select_related("workspace", "created_by", "saved_run")
grid_layout(1, qs, _render_run)

def _render_run(pr: PublishedRun):
workflow = Workflow(pr.workflow)

show_workspace_author = not bool(search_filters and search_filters.workspace)
is_member = bool(getattr(pr, "is_member", False))
hide_last_editor = bool(pr.workspace_id and not is_member)

render_saved_workflow_preview(
workflow.page_cls,
pr,
workflow_pill=f"{workflow.get_or_create_metadata().emoji} {workflow.short_title}",
hide_visibility_pill=True,
show_workspace_author=show_workspace_author,
hide_last_editor=hide_last_editor,
is_member=is_member,
)

def _render_run(pr: PublishedRun):
workflow = Workflow(pr.workflow)
hide_last_editor = bool(pr.workspace_id and not getattr(pr, "is_member", False))
render_saved_workflow_preview(
workflow.page_cls,
pr,
workflow_pill=f"{workflow.get_or_create_metadata().emoji} {workflow.short_title}",
hide_visibility_pill=True,
show_workspace_author=True,
hide_last_editor=hide_last_editor,
)
grid_layout(1, qs, _render_run)


def get_filtered_published_runs(
Expand Down