@@ -379,15 +379,55 @@ def render(self):
379379 & button {
380380 padding: 0.4rem !important;
381381 }
382+
383+ & a:has(span.mobile-only-recipe-tab) {
384+ display: block !important;
385+ }
386+
387+ & ul.nav-tabs {
388+ overflow-x: auto;
389+ overflow-y: hidden;
390+ white-space: nowrap;
391+ flex-wrap: nowrap !important;
392+ display: flex;
393+ -webkit-overflow-scrolling: touch;
394+ scrollbar-width: none;
395+ gap: 0.5rem;
396+ }
397+
398+ @media (min-width: 768px) {
399+ & a:has(span.mobile-only-recipe-tab) {
400+ display: none !important;
401+ }
402+
403+ /* RUN as active tab in lg view for preview route */
404+ & span.active-lg button {
405+ color: #000;
406+ border-bottom: 2px solid black;
407+ }
408+
409+ & ul.nav-tabs {
410+ gap: 0;
411+ }
412+ }
382413 """
383414 ),
384415 gui .div (className = "position-relative" ),
385416 gui .nav_tabs (),
386417 ):
387418 for tab in self .get_tabs ():
388419 url = self .current_app_url (tab )
389- with gui .nav_item (url , active = tab == self .tab ):
390- gui .html (tab .title )
420+ with gui .tag (
421+ "span" ,
422+ className = "active-lg"
423+ if (tab == RecipeTabs .run and self .tab == RecipeTabs .preview )
424+ else "" ,
425+ ):
426+ with gui .nav_item (
427+ url ,
428+ active = tab == self .tab ,
429+ ):
430+ gui .html (tab .title )
391431
392432 self ._render_saved_generated_timestamp ()
393433 with gui .nav_tab_content ():
@@ -437,7 +477,7 @@ def _render_header(self):
437477 self .render_social_buttons ()
438478
439479 if tbreadcrumbs .has_breadcrumbs ():
440- if self .tab != RecipeTabs .run :
480+ if self .tab != RecipeTabs .run and self . tab != RecipeTabs . preview :
441481 with gui .styled ("& h1 { margin-top: 0 }" ):
442482 self ._render_title (tbreadcrumbs .h1_title )
443483 else :
@@ -1161,15 +1201,13 @@ def get_tabs(self):
11611201
11621202 def render_selected_tab (self ):
11631203 match self .tab :
1164- case RecipeTabs .run :
1204+ case RecipeTabs .run | RecipeTabs . preview :
11651205 if self .current_sr .retention_policy == RetentionPolicy .delete :
11661206 self .render_deleted_output ()
11671207 return
11681208
11691209 with gui .styled (OUTPUT_TABS_CSS ):
1170- output_col , input_col = gui .tabs (
1171- [f"{ icons .preview } Preview" , f"{ icons .edit } Edit" ]
1172- )
1210+ input_col , output_col = gui .columns ([3 , 2 ], gap = "medium" )
11731211 with input_col :
11741212 submitted = self ._render_input_col ()
11751213 with output_col :
@@ -1725,25 +1763,28 @@ def _render_report_button(self):
17251763 show_settings = True
17261764
17271765 def _render_input_col (self ):
1728- self .render_form_v2 ()
1729- placeholder = gui .div ()
1766+ with gui .div (
1767+ className = "d-none d-lg-block" if self .tab == RecipeTabs .preview else ""
1768+ ):
1769+ self .render_form_v2 ()
1770+ placeholder = gui .div ()
17301771
1731- if self .show_settings :
1732- with gui .div (className = "bg-white" ):
1733- with gui .expander ("⚙️ Settings" ):
1734- self .render_settings ()
1735- if self .functions_in_settings :
1736- functions_input (self .request .user )
1772+ if self .show_settings :
1773+ with gui .div (className = "bg-white" ):
1774+ with gui .expander ("⚙️ Settings" ):
1775+ self .render_settings ()
1776+ if self .functions_in_settings :
1777+ functions_input (self .request .user )
17371778
1738- with placeholder :
1739- self .render_variables ()
1779+ with placeholder :
1780+ self .render_variables ()
17401781
1741- submitted = self .render_submit_button ()
1742- with gui .div (style = {"textAlign" : "right" , "fontSize" : "smaller" }):
1743- terms_caption = self .get_terms_caption ()
1744- gui .caption (f"_{ terms_caption } _" )
1782+ submitted = self .render_submit_button ()
1783+ with gui .div (style = {"textAlign" : "right" , "fontSize" : "smaller" }):
1784+ terms_caption = self .get_terms_caption ()
1785+ gui .caption (f"_{ terms_caption } _" )
17451786
1746- return submitted
1787+ return submitted
17471788
17481789 def get_terms_caption (self ):
17491790 return "With each run, you agree to Gooey.AI's [terms](https://gooey.ai/terms) & [privacy policy](https://gooey.ai/privacy)."
@@ -1795,7 +1836,12 @@ def _render_output_col(self, *, submitted: bool = False, is_deleted: bool = Fals
17951836 if submitted :
17961837 self .submit_and_redirect ()
17971838
1798- with gui .div (style = dict (position = "sticky" , top = "0.5rem" )):
1839+ with gui .div (
1840+ style = dict (position = "sticky" , top = "0.5rem" ),
1841+ className = "d-none d-lg-block pb-2"
1842+ if self .tab == RecipeTabs .run and self .workflow in PREVIEW_ROUTE_WORKFLOWS
1843+ else "" ,
1844+ ):
17991845 run_state = self .get_run_state (gui .session_state )
18001846 if run_state == RecipeRunState .failed :
18011847 self ._render_failed_output ()
@@ -2487,36 +2533,16 @@ class TitleValidationError(Exception):
24872533 pass
24882534
24892535
2536+ PREVIEW_ROUTE_WORKFLOWS = [Workflow .VIDEO_BOTS ]
24902537OUTPUT_TABS_CSS = """
2491- & [data-reach-tab-list] {
2492- text-align: center; margin-top: 0
2493- }
2494- @media (min-width: 768px) {
2495- & [data-reach-tab-list] {
2496- display: none;
2538+ & {
2539+ margin: -1rem 0 1rem 0;
2540+ padding-top: 1rem;
24972541 }
2498- & [data-reach-tab-panels] {
2499- display: flex;
2500- flex-direction: row-reverse;
2501- width: 100%;
2502- background-color: #f9f9f9;
2503- padding: 10px;
2504- margin-top: -1rem;
2505- }
2506- & [data-reach-tab-panels] > div:nth-child(2) {
2507- flex: 0 1 auto;
2508- width: 60%;
2509- max-width: 100%;
2510- padding-right: 0.75rem;
2511- }
2512- & [data-reach-tab-panels] > div:nth-child(1) {
2513- flex: 0 0 auto;
2514- width: 40%;
2515- max-width: 100%;
2516- padding-left: 0.75rem;
2517- }
2518- & [data-reach-tab-panel][hidden] {
2519- display: block !important;
2542+ @media (min-width: 768px) {
2543+ & {
2544+ background-color: #f9f9f9;
2545+ }
25202546 }
2521- }
2522- """
2547+
2548+ """
0 commit comments