From aa8f33448255c3a22a9a818e6d13abcd6a8958d7 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Tue, 14 Nov 2023 22:46:52 +0530 Subject: [PATCH] Add breadcrumb when run was taken from an example --- daras_ai_v2/base.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/daras_ai_v2/base.py b/daras_ai_v2/base.py index 9558568ec..498360956 100644 --- a/daras_ai_v2/base.py +++ b/daras_ai_v2/base.py @@ -196,13 +196,20 @@ def render(self): ) if example_id or run_id: - with st.breadcrumbs(className="mt-5"): + with st.breadcrumbs(className="mt-5", divider="/"): st.breadcrumb_item( self.get_recipe_page_title(st.session_state).upper(), link_to=self.app_url(), className="text-muted", - style={"background-color": "#A5FFEE"}, ) + saved_run = self.get_sr_from_query_params(example_id, run_id, uid) + if saved_run.parent and saved_run.parent.example_id: + st.breadcrumb_item( + self.get_page_title(saved_run.parent.to_dict()), + link_to=self.app_url( + example_id=saved_run.parent.example_id, + ), + ) st.write(f"# {self.get_page_title(st.session_state)}") else: with st.link(