From dec44632314cfdc7f681ee8c1f1a8da29364c033 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 18 Sep 2025 14:29:28 -0700 Subject: [PATCH 1/3] update repos for deprecation warnings --- account_management_dashboard/rxconfig.py | 2 +- admin_dashboard/rxconfig.py | 2 +- admin_panel/rxconfig.py | 2 +- ai_image_gen/ai_image_gen/backend/options.py | 12 ++++++++++ ai_image_gen/rxconfig.py | 2 +- .../api_admin_panel/states/queries.py | 13 +++++++++++ api_admin_panel/rxconfig.py | 2 +- business_analytics_dashboard/rxconfig.py | 2 +- chat_app/rxconfig.py | 2 +- ci_template/cijob/backend/table_state.py | 8 +++++++ ci_template/cijob/templates/template.py | 8 +++++++ ci_template/rxconfig.py | 2 +- company_dashboard/rxconfig.py | 2 +- customer_data_app/rxconfig.py | 2 +- dalle/rxconfig.py | 2 +- dashboard/dashboard/backend/table_state.py | 8 +++++++ dashboard/dashboard/templates/template.py | 8 +++++++ dashboard/dashboard/views/charts.py | 4 ++++ dashboard/rxconfig.py | 2 +- futuristic_dashboard/rxconfig.py | 2 +- .../components/spc_chart.py | 14 ++++++------ manufacturing_dashboard/rxconfig.py | 2 +- nba/nba/backend/backend.py | 8 +++++++ nba/nba/views/stats.py | 4 ++++ nba/rxconfig.py | 2 +- reflex-chat | 2 +- reflex-llamaindex-template | 2 +- retail_analytics_dashboard/rxconfig.py | 2 +- retail_dashboard/rxconfig.py | 2 +- retention_dashboard/rxconfig.py | 2 +- sales/rxconfig.py | 2 +- sales/sales/backend/backend.py | 4 ++++ space_dashboard/rxconfig.py | 2 +- stock_graph_app/rxconfig.py | 2 +- stock_market_dashboard/rxconfig.py | 2 +- table_dashboard/rxconfig.py | 2 +- .../table_dashboard/states/dashboard_state.py | 22 +++++++++++++++++++ text_annotation_app/rxconfig.py | 2 +- 38 files changed, 132 insertions(+), 33 deletions(-) diff --git a/account_management_dashboard/rxconfig.py b/account_management_dashboard/rxconfig.py index 5bc618e..de087c4 100644 --- a/account_management_dashboard/rxconfig.py +++ b/account_management_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="account_management_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/admin_dashboard/rxconfig.py b/admin_dashboard/rxconfig.py index b3886b1..363ba29 100644 --- a/admin_dashboard/rxconfig.py +++ b/admin_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="admin_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/admin_panel/rxconfig.py b/admin_panel/rxconfig.py index e178160..2ff65d9 100644 --- a/admin_panel/rxconfig.py +++ b/admin_panel/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="admin_panel", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/ai_image_gen/ai_image_gen/backend/options.py b/ai_image_gen/ai_image_gen/backend/options.py index 1bcd2fe..14e66d8 100644 --- a/ai_image_gen/ai_image_gen/backend/options.py +++ b/ai_image_gen/ai_image_gen/backend/options.py @@ -76,6 +76,18 @@ def set_num_outputs(self, value: list): def set_steps(self, value: list): self.steps = value[0] + @rx.event + def set_prompt(self, value: str): + self.prompt = value + + @rx.event + def set_negative_prompt(self, value: str): + self.negative_prompt = value + + @rx.event + def set_scheduler(self, value: str): + self.scheduler = value + @rx.event def set_guidance_scale(self, value: list): self.guidance_scale = value[0] diff --git a/ai_image_gen/rxconfig.py b/ai_image_gen/rxconfig.py index e60e46a..75c18cd 100644 --- a/ai_image_gen/rxconfig.py +++ b/ai_image_gen/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="ai_image_gen", - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/api_admin_panel/api_admin_panel/states/queries.py b/api_admin_panel/api_admin_panel/states/queries.py index 25532f7..8663bb1 100644 --- a/api_admin_panel/api_admin_panel/states/queries.py +++ b/api_admin_panel/api_admin_panel/states/queries.py @@ -1,6 +1,7 @@ import uuid import httpx +import reflex as rx from api_admin_panel.states.base import BaseState @@ -43,24 +44,33 @@ class QueryState(BaseState): total_pages: int = 1 formatted_headers: dict + @rx.event + def set_req_url(self, url: str): + self.req_url = url + + @rx.event def get_request(self, method: str): self.current_req = method + @rx.event def add_header(self): self.headers.append( {"id": str(uuid.uuid4()), "identifier": "headers", "key": "", "value": ""} ) + @rx.event def add_body(self): self.body.append( {"id": str(uuid.uuid4()), "identifier": "body", "key": "", "value": ""} ) + @rx.event def add_cookies(self): self.cookies.append( {"id": str(uuid.uuid4()), "identifier": "cookies", "key": "", "value": ""} ) + @rx.event def remove_entry(self, data: dict[str, str]): if data["identifier"] == "headers": self.headers = [item for item in self.headers if item["id"] != data["id"]] @@ -71,6 +81,7 @@ def remove_entry(self, data: dict[str, str]): if data["identifier"] == "cookies": self.cookies = [item for item in self.cookies if item["id"] != data["id"]] + @rx.event async def update_attribute(self, data: dict[str, str], attribute: str, value: str): data[attribute] = value @@ -89,9 +100,11 @@ async def update_attribute(self, data: dict[str, str], attribute: str, value: st data if item["id"] == data["id"] else item for item in self.cookies ] + @rx.event async def update_keyy(self, key: str, data: dict[str, str]): await self.update_attribute(data, "key", key) + @rx.event async def update_value(self, value: str, data: dict[str, str]): await self.update_attribute(data, "value", value) diff --git a/api_admin_panel/rxconfig.py b/api_admin_panel/rxconfig.py index b1dc8c3..dcf807f 100644 --- a/api_admin_panel/rxconfig.py +++ b/api_admin_panel/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="api_admin_panel", - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/business_analytics_dashboard/rxconfig.py b/business_analytics_dashboard/rxconfig.py index 7a1d36f..61eb962 100644 --- a/business_analytics_dashboard/rxconfig.py +++ b/business_analytics_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="business_analytics_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/chat_app/rxconfig.py b/chat_app/rxconfig.py index 2d0a0fa..ae39db3 100644 --- a/chat_app/rxconfig.py +++ b/chat_app/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="chat_app", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/ci_template/cijob/backend/table_state.py b/ci_template/cijob/backend/table_state.py index 397b6a5..41f2408 100644 --- a/ci_template/cijob/backend/table_state.py +++ b/ci_template/cijob/backend/table_state.py @@ -28,6 +28,14 @@ class TableState(rx.State): offset: int = 0 limit: int = 12 # Number of rows per page + @rx.event + def set_search_value(self, value: str): + self.search_value = value + + @rx.event + def set_sort_value(self, value: str): + self.sort_value = value + @rx.var(cache=True) def filtered_sorted_items(self) -> List[Item]: items = self.items diff --git a/ci_template/cijob/templates/template.py b/ci_template/cijob/templates/template.py index ceda687..efa9fd8 100644 --- a/ci_template/cijob/templates/template.py +++ b/ci_template/cijob/templates/template.py @@ -45,6 +45,14 @@ class ThemeState(rx.State): scaling: str = "100%" + @rx.event + def set_scaling(self, value: str): + self.scaling = value + + @rx.event + def set_radius(self, value: str): + self.radius = value + ALL_PAGES = [] diff --git a/ci_template/rxconfig.py b/ci_template/rxconfig.py index e9f3187..870b901 100644 --- a/ci_template/rxconfig.py +++ b/ci_template/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="cijob", - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/company_dashboard/rxconfig.py b/company_dashboard/rxconfig.py index e6ba7f4..9e08707 100644 --- a/company_dashboard/rxconfig.py +++ b/company_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="company_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/customer_data_app/rxconfig.py b/customer_data_app/rxconfig.py index a3aba25..826fb65 100644 --- a/customer_data_app/rxconfig.py +++ b/customer_data_app/rxconfig.py @@ -7,5 +7,5 @@ config = rx.Config( app_name="customer_data", db_url=database_url, - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/dalle/rxconfig.py b/dalle/rxconfig.py index 2e2ea7a..52dbaca 100644 --- a/dalle/rxconfig.py +++ b/dalle/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="dalle", - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/dashboard/dashboard/backend/table_state.py b/dashboard/dashboard/backend/table_state.py index fc505b2..b19cf97 100644 --- a/dashboard/dashboard/backend/table_state.py +++ b/dashboard/dashboard/backend/table_state.py @@ -27,6 +27,14 @@ class TableState(rx.State): offset: int = 0 limit: int = 12 # Number of rows per page + @rx.event + def set_search_value(self, value: str): + self.search_value = value + + @rx.event + def set_sort_value(self, value: str): + self.sort_value = value + @rx.var(cache=True) def filtered_sorted_items(self) -> List[Item]: items = self.items diff --git a/dashboard/dashboard/templates/template.py b/dashboard/dashboard/templates/template.py index e5cb29d..b7f7280 100644 --- a/dashboard/dashboard/templates/template.py +++ b/dashboard/dashboard/templates/template.py @@ -45,6 +45,14 @@ class ThemeState(rx.State): scaling: str = "100%" + @rx.event + def set_scaling(self, value: str): + self.scaling = value + + @rx.event + def set_radius(self, value: str): + self.radius = value + ALL_PAGES = [] diff --git a/dashboard/dashboard/views/charts.py b/dashboard/dashboard/views/charts.py index c0884d5..e61b286 100644 --- a/dashboard/dashboard/views/charts.py +++ b/dashboard/dashboard/views/charts.py @@ -17,6 +17,10 @@ class StatsState(rx.State): device_data = [] yearly_device_data = [] + @rx.event + def set_timeframe(self, value: str): + self.timeframe = value + @rx.event def set_selected_tab(self, tab: str | list[str]): self.selected_tab = tab if isinstance(tab, str) else tab[0] diff --git a/dashboard/rxconfig.py b/dashboard/rxconfig.py index 9058b28..bc07034 100644 --- a/dashboard/rxconfig.py +++ b/dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="dashboard", - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/futuristic_dashboard/rxconfig.py b/futuristic_dashboard/rxconfig.py index 55c5fb8..540e637 100644 --- a/futuristic_dashboard/rxconfig.py +++ b/futuristic_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="futuristic_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/manufacturing_dashboard/manufacturing_dashboard/components/spc_chart.py b/manufacturing_dashboard/manufacturing_dashboard/components/spc_chart.py index c7e4c13..9608a31 100644 --- a/manufacturing_dashboard/manufacturing_dashboard/components/spc_chart.py +++ b/manufacturing_dashboard/manufacturing_dashboard/components/spc_chart.py @@ -83,19 +83,19 @@ def spc_chart() -> rx.Component: height=10, ), rx.recharts.reference_area( - y1=DashboardState.lsl.to_string(), - y2=DashboardState.usl.to_string(), - stroke_opacity=0.3, - fill="#0d9488", - fill_opacity=0.1, - stroke="#0f766e", - label=rx.recharts.label( + rx.recharts.label( value="Spec", position="insideTopRight", fill="#5eead4", offset=10, font_size="10px", ), + y1=DashboardState.lsl.to_string(), + y2=DashboardState.usl.to_string(), + stroke_opacity=0.3, + fill="#0d9488", + fill_opacity=0.1, + stroke="#0f766e", ), rx.recharts.reference_line( y=DashboardState.target_mean.to_string(), diff --git a/manufacturing_dashboard/rxconfig.py b/manufacturing_dashboard/rxconfig.py index ecb320c..17b2c86 100644 --- a/manufacturing_dashboard/rxconfig.py +++ b/manufacturing_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="manufacturing_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/nba/nba/backend/backend.py b/nba/nba/backend/backend.py index c0aa0a0..f17b5db 100644 --- a/nba/nba/backend/backend.py +++ b/nba/nba/backend/backend.py @@ -37,6 +37,14 @@ def set_age(self, value: list[int | float]): def set_salary(self, value: list[int | float]): self.salary = (int(value[0]), int(value[1])) + @rx.event + def set_sort_value(self, value: str): + self.sort_value = value + + @rx.event + def set_search_value(self, value: str): + self.search_value = value + @rx.var(cache=True) def filtered_sorted_players(self) -> list[Player]: players = self.players diff --git a/nba/nba/views/stats.py b/nba/nba/views/stats.py index 6a735c7..b1143b6 100644 --- a/nba/nba/views/stats.py +++ b/nba/nba/views/stats.py @@ -15,6 +15,10 @@ def toggle_radarchart(self): def toggle_areachart(self): self.area_toggle = not self.area_toggle + @rx.event + def set_stats_view(self, value: str): + self.stats_view = value + def _age_salary_chart() -> rx.Component: return rx.cond( diff --git a/nba/rxconfig.py b/nba/rxconfig.py index 0370b4b..289c041 100644 --- a/nba/rxconfig.py +++ b/nba/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="nba", - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/reflex-chat b/reflex-chat index f3a04d1..4f63168 160000 --- a/reflex-chat +++ b/reflex-chat @@ -1 +1 @@ -Subproject commit f3a04d1703bf99745c2e39af809b5b045a2d0dc5 +Subproject commit 4f63168793bc1a2fdf9b0491e5d78334481b1f5d diff --git a/reflex-llamaindex-template b/reflex-llamaindex-template index 04236c7..a8a4148 160000 --- a/reflex-llamaindex-template +++ b/reflex-llamaindex-template @@ -1 +1 @@ -Subproject commit 04236c7e4e5218628d8935c6f687f2107c5d9906 +Subproject commit a8a4148370add7f770979af1ba974aaca08b408e diff --git a/retail_analytics_dashboard/rxconfig.py b/retail_analytics_dashboard/rxconfig.py index 5564bf3..b425bba 100644 --- a/retail_analytics_dashboard/rxconfig.py +++ b/retail_analytics_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="retail_analytics_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/retail_dashboard/rxconfig.py b/retail_dashboard/rxconfig.py index f4a8358..c42bd50 100644 --- a/retail_dashboard/rxconfig.py +++ b/retail_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="retail_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/retention_dashboard/rxconfig.py b/retention_dashboard/rxconfig.py index 2f99ad6..69ab284 100644 --- a/retention_dashboard/rxconfig.py +++ b/retention_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="retention_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/sales/rxconfig.py b/sales/rxconfig.py index 8220027..1f44dc7 100644 --- a/sales/rxconfig.py +++ b/sales/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="sales", - tailwind=None, + plugins=[rx.plugins.SitemapPlugin()], ) diff --git a/sales/sales/backend/backend.py b/sales/sales/backend/backend.py index bfc670d..7a27a52 100644 --- a/sales/sales/backend/backend.py +++ b/sales/sales/backend/backend.py @@ -73,6 +73,10 @@ class State(rx.State): sort_value: str = "" sort_reverse: bool = False + @rx.event + def set_tone(self, value: str): + self.tone = value + @rx.event def set_length(self, value: list[int | float]): self.length = int(value[0]) diff --git a/space_dashboard/rxconfig.py b/space_dashboard/rxconfig.py index a85a63b..d2bd962 100644 --- a/space_dashboard/rxconfig.py +++ b/space_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="space_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/stock_graph_app/rxconfig.py b/stock_graph_app/rxconfig.py index 23edc1d..358bb65 100644 --- a/stock_graph_app/rxconfig.py +++ b/stock_graph_app/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="stock_graph_app", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/stock_market_dashboard/rxconfig.py b/stock_market_dashboard/rxconfig.py index 96ba22b..4d54327 100644 --- a/stock_market_dashboard/rxconfig.py +++ b/stock_market_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="stock_market_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/table_dashboard/rxconfig.py b/table_dashboard/rxconfig.py index babbf72..1752434 100644 --- a/table_dashboard/rxconfig.py +++ b/table_dashboard/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="table_dashboard", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) diff --git a/table_dashboard/table_dashboard/states/dashboard_state.py b/table_dashboard/table_dashboard/states/dashboard_state.py index 6ccd1e2..1f9aad1 100644 --- a/table_dashboard/table_dashboard/states/dashboard_state.py +++ b/table_dashboard/table_dashboard/states/dashboard_state.py @@ -162,11 +162,13 @@ def all_rows_on_page_selected(self) -> bool: return False return self.page_item_ids.issubset(self.selected_rows) + @rx.event def set_search_owner(self, value: str): """Update the search owner filter.""" self.search_owner = value self.current_page = 1 + @rx.event def toggle_sort(self, column_name: str): """Toggle sorting for a column.""" if self.sort_column == column_name: @@ -175,21 +177,25 @@ def toggle_sort(self, column_name: str): self.sort_column = column_name self.sort_ascending = True + @rx.event def go_to_page(self, page_number: int): """Navigate to a specific page.""" if 1 <= page_number <= self.total_pages: self.current_page = page_number + @rx.event def next_page(self): """Go to the next page.""" if self.current_page < self.total_pages: self.current_page += 1 + @rx.event def previous_page(self): """Go to the previous page.""" if self.current_page > 1: self.current_page -= 1 + @rx.event def toggle_row_selection(self, row_id: int): """Toggle selection state for a single row using its ID.""" if row_id in self.selected_rows: @@ -197,6 +203,7 @@ def toggle_row_selection(self, row_id: int): else: self.selected_rows.add(row_id) + @rx.event def toggle_select_all_on_page(self): """Select or deselect all rows on the current page.""" page_ids = self.page_item_ids @@ -205,6 +212,7 @@ def toggle_select_all_on_page(self): else: self.selected_rows.update(page_ids) + @rx.event def toggle_status_filter(self): is_opening = not self.show_status_filter self.show_status_filter = is_opening @@ -213,6 +221,7 @@ def toggle_status_filter(self): if is_opening: self.temp_selected_statuses = self.selected_statuses.copy() + @rx.event def toggle_region_filter(self): is_opening = not self.show_region_filter self.show_region_filter = is_opening @@ -221,6 +230,7 @@ def toggle_region_filter(self): if is_opening: self.temp_selected_regions = self.selected_regions.copy() + @rx.event def toggle_costs_filter(self): is_opening = not self.show_costs_filter self.show_costs_filter = is_opening @@ -234,34 +244,41 @@ def toggle_costs_filter(self): str(self.max_cost) if self.max_cost is not None else "" ) + @rx.event def toggle_temp_status(self, status: str): if status in self.temp_selected_statuses: self.temp_selected_statuses.remove(status) else: self.temp_selected_statuses.add(status) + @rx.event def toggle_temp_region(self, region: str): if region in self.temp_selected_regions: self.temp_selected_regions.remove(region) else: self.temp_selected_regions.add(region) + @rx.event def set_temp_min_cost(self, value: str): self.temp_min_cost_str = value + @rx.event def set_temp_max_cost(self, value: str): self.temp_max_cost_str = value + @rx.event def apply_status_filter(self): self.selected_statuses = self.temp_selected_statuses.copy() self.show_status_filter = False self.current_page = 1 + @rx.event def apply_region_filter(self): self.selected_regions = self.temp_selected_regions.copy() self.show_region_filter = False self.current_page = 1 + @rx.event def apply_costs_filter(self): new_min_cost = None new_max_cost = None @@ -280,18 +297,21 @@ def apply_costs_filter(self): self.show_costs_filter = False self.current_page = 1 + @rx.event def reset_status_filter(self): self.temp_selected_statuses = set() self.selected_statuses = set() self.show_status_filter = False self.current_page = 1 + @rx.event def reset_region_filter(self): self.temp_selected_regions = set() self.selected_regions = set() self.show_region_filter = False self.current_page = 1 + @rx.event def reset_costs_filter(self): self.temp_min_cost_str = "" self.temp_max_cost_str = "" @@ -300,6 +320,7 @@ def reset_costs_filter(self): self.show_costs_filter = False self.current_page = 1 + @rx.event def reset_all_filters(self): """Reset all filters and search.""" self.search_owner = "" @@ -319,6 +340,7 @@ def reset_all_filters(self): self.sort_column = None self.sort_ascending = True + @rx.event def close_filter_dropdowns(self): self.show_status_filter = False self.show_region_filter = False diff --git a/text_annotation_app/rxconfig.py b/text_annotation_app/rxconfig.py index a5dd49a..8226dfe 100644 --- a/text_annotation_app/rxconfig.py +++ b/text_annotation_app/rxconfig.py @@ -2,5 +2,5 @@ config = rx.Config( app_name="text_annotation_app", - plugins=[rx.plugins.TailwindV3Plugin()], + plugins=[rx.plugins.SitemapPlugin(), rx.plugins.TailwindV3Plugin()], ) From 4a638672f0e3ff5040710bd0f93f24e58eae6762 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 18 Sep 2025 14:37:31 -0700 Subject: [PATCH 2/3] get rid of some more deprec warning --- admin_dashboard/admin_dashboard/states/navigation_state.py | 2 +- ai_image_gen/ai_image_gen/backend/generation.py | 2 +- nba/nba/views/table.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin_dashboard/admin_dashboard/states/navigation_state.py b/admin_dashboard/admin_dashboard/states/navigation_state.py index b27bc9d..7c498d4 100644 --- a/admin_dashboard/admin_dashboard/states/navigation_state.py +++ b/admin_dashboard/admin_dashboard/states/navigation_state.py @@ -7,4 +7,4 @@ class NavigationState(rx.State): @rx.var def current_page(self) -> str: """Get the current page route.""" - return self.router.page.path + return self.router.url.path diff --git a/ai_image_gen/ai_image_gen/backend/generation.py b/ai_image_gen/ai_image_gen/backend/generation.py index 177d5d6..061daa4 100644 --- a/ai_image_gen/ai_image_gen/backend/generation.py +++ b/ai_image_gen/ai_image_gen/backend/generation.py @@ -240,7 +240,7 @@ async def copy_image(self): ) if image_url == DEFAULT_IMAGE: image_url = ( - self.router.page.full_raw_path + DEFAULT_IMAGE[1:] + self.router.url.removesuffix("/") + DEFAULT_IMAGE ) # Remove the / yield rx.set_clipboard(image_url) except Exception as e: diff --git a/nba/nba/views/table.py b/nba/nba/views/table.py index a2f2b3a..e3bf73e 100644 --- a/nba/nba/views/table.py +++ b/nba/nba/views/table.py @@ -139,7 +139,7 @@ def main_table() -> rx.Component: rx.icon("x"), justify="end", cursor="pointer", - on_click=State.setvar("search_value", ""), + on_click=State.set_search_value(""), display=rx.cond(State.search_value, "flex", "none"), ), value=State.search_value, From e4c8098b376da5284362d8440fcaa3795b233f8b Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Thu, 18 Sep 2025 14:45:58 -0700 Subject: [PATCH 3/3] do more --- ai_image_gen/ai_image_gen/backend/generation.py | 4 ++++ ai_image_gen/ai_image_gen/backend/options.py | 8 ++++++++ .../ai_image_gen/components/options_ui.py | 16 ++++++++-------- ai_image_gen/ai_image_gen/pages/index.py | 2 +- ci_template/cijob/templates/template.py | 8 ++++++++ ci_template/cijob/views/color_picker.py | 4 ++-- ci_template/cijob/views/table.py | 2 +- dashboard/dashboard/templates/template.py | 8 ++++++++ dashboard/dashboard/views/color_picker.py | 4 ++-- dashboard/dashboard/views/table.py | 2 +- 10 files changed, 43 insertions(+), 15 deletions(-) diff --git a/ai_image_gen/ai_image_gen/backend/generation.py b/ai_image_gen/ai_image_gen/backend/generation.py index 061daa4..dbcb393 100644 --- a/ai_image_gen/ai_image_gen/backend/generation.py +++ b/ai_image_gen/ai_image_gen/backend/generation.py @@ -32,6 +32,10 @@ class GeneratorState(rx.State): upscaled_image: str = "" is_downloading: bool = False + @rx.event + def set_output_image(self, value: str): + self.output_image = value + @rx.event(background=True) async def generate_image(self): try: diff --git a/ai_image_gen/ai_image_gen/backend/options.py b/ai_image_gen/ai_image_gen/backend/options.py index 14e66d8..c2b07e0 100644 --- a/ai_image_gen/ai_image_gen/backend/options.py +++ b/ai_image_gen/ai_image_gen/backend/options.py @@ -92,6 +92,14 @@ def set_scheduler(self, value: str): def set_guidance_scale(self, value: list): self.guidance_scale = value[0] + @rx.event + def set_selected_style(self, value: str): + self.selected_style = value + + @rx.event + def set_advanced_options_open(self, value: bool): + self.advanced_options_open = value + @rx.event def randomize_prompt(self): self.prompt = random.choice(prompt_list) diff --git a/ai_image_gen/ai_image_gen/components/options_ui.py b/ai_image_gen/ai_image_gen/components/options_ui.py index c1bbc68..da2fb56 100644 --- a/ai_image_gen/ai_image_gen/components/options_ui.py +++ b/ai_image_gen/ai_image_gen/components/options_ui.py @@ -67,7 +67,7 @@ def prompt_input() -> rx.Component: color=rx.color("gray", 10), cursor="pointer", _hover={"opacity": "0.8"}, - on_click=OptionsState.setvar("prompt", ""), + on_click=OptionsState.set_prompt(""), ), ), rx.tooltip( @@ -252,7 +252,7 @@ def _style_preview(style_preset: list) -> rx.Component: height="auto", cursor="pointer", background=rx.color("accent", 9), - on_click=OptionsState.setvar("selected_style", ""), + on_click=OptionsState.set_selected_style(""), ), content=style_preset[0], ), @@ -270,7 +270,7 @@ def _style_preview(style_preset: list) -> rx.Component: height="auto", cursor="pointer", background=rx.color("accent", 9), - on_click=OptionsState.setvar("selected_style", style_preset[0]), + on_click=OptionsState.set_selected_style(style_preset[0]), ), content=style_preset[0], ), @@ -293,7 +293,7 @@ def style_selector() -> rx.Component: color=rx.color("gray", 10), cursor="pointer", _hover={"opacity": "0.8"}, - on_click=OptionsState.setvar("selected_style", ""), + on_click=OptionsState.set_selected_style(""), ), spacing="4", align="center", @@ -345,7 +345,7 @@ def _negative_prompt() -> rx.Component: color=rx.color("gray", 10), cursor="pointer", _hover={"opacity": "0.8"}, - on_click=OptionsState.setvar("negative_prompt", ""), + on_click=OptionsState.set_negative_prompt(""), ), ), spacing="4", @@ -382,7 +382,7 @@ def _seed_input() -> rx.Component: color=rx.color("gray", 10), cursor="pointer", _hover={"opacity": "0.8"}, - on_click=OptionsState.setvar("seed", 0), + on_click=OptionsState.set_seed("0"), ), ), spacing="4", @@ -545,7 +545,7 @@ def advanced_options() -> rx.Component: width="100%", cursor="pointer", _hover={"opacity": "0.8"}, - on_click=OptionsState.setvar("advanced_options_open", False), + on_click=OptionsState.set_advanced_options_open(False), ), rx.hstack( rx.icon( @@ -559,7 +559,7 @@ def advanced_options() -> rx.Component: width="100%", cursor="pointer", _hover={"opacity": "0.8"}, - on_click=OptionsState.setvar("advanced_options_open", True), + on_click=OptionsState.set_advanced_options_open(True), ), ), rx.cond( diff --git a/ai_image_gen/ai_image_gen/pages/index.py b/ai_image_gen/ai_image_gen/pages/index.py index 124dc71..8c15f71 100644 --- a/ai_image_gen/ai_image_gen/pages/index.py +++ b/ai_image_gen/ai_image_gen/pages/index.py @@ -64,7 +64,7 @@ def _image_list_item(image: str) -> rx.Component: max_width="5em", cursor="pointer", background=rx.color("accent", 9), - on_click=GeneratorState.setvar("output_image", image), + on_click=GeneratorState.set_output_image(image), ), loading=GeneratorState.is_generating | GeneratorState.is_upscaling, ) diff --git a/ci_template/cijob/templates/template.py b/ci_template/cijob/templates/template.py index efa9fd8..1f1381e 100644 --- a/ci_template/cijob/templates/template.py +++ b/ci_template/cijob/templates/template.py @@ -53,6 +53,14 @@ def set_scaling(self, value: str): def set_radius(self, value: str): self.radius = value + @rx.event + def set_accent_color(self, value: str): + self.accent_color = value + + @rx.event + def set_gray_color(self, value: str): + self.gray_color = value + ALL_PAGES = [] diff --git a/ci_template/cijob/views/color_picker.py b/ci_template/cijob/views/color_picker.py index 2c7e629..9b5ddd7 100644 --- a/ci_template/cijob/views/color_picker.py +++ b/ci_template/cijob/views/color_picker.py @@ -41,7 +41,7 @@ def _display_primary_color(color: list) -> rx.Component: style=styles.color_picker_style, ), ), - on_click=ThemeState.setvar("accent_color", color[0].lower()), + on_click=ThemeState.set_accent_color(color[0].lower()), ), content=color[0], ) @@ -67,7 +67,7 @@ def _display_secondary_color(colors: list) -> rx.Component: style=styles.color_picker_style, ), ), - on_click=ThemeState.setvar("gray_color", colors[0].lower()), + on_click=ThemeState.set_gray_color(colors[0].lower()), ), content=colors[0], ) diff --git a/ci_template/cijob/views/table.py b/ci_template/cijob/views/table.py index 5a39526..95dc3c8 100644 --- a/ci_template/cijob/views/table.py +++ b/ci_template/cijob/views/table.py @@ -194,7 +194,7 @@ def main_table() -> rx.Component: rx.icon("x"), justify="end", cursor="pointer", - on_click=TableState.setvar("search_value", ""), + on_click=TableState.set_search_value(""), display=rx.cond(TableState.search_value, "flex", "none"), ), value=TableState.search_value, diff --git a/dashboard/dashboard/templates/template.py b/dashboard/dashboard/templates/template.py index b7f7280..c53f3b8 100644 --- a/dashboard/dashboard/templates/template.py +++ b/dashboard/dashboard/templates/template.py @@ -53,6 +53,14 @@ def set_scaling(self, value: str): def set_radius(self, value: str): self.radius = value + @rx.event + def set_accent_color(self, value: str): + self.accent_color = value + + @rx.event + def set_gray_color(self, value: str): + self.gray_color = value + ALL_PAGES = [] diff --git a/dashboard/dashboard/views/color_picker.py b/dashboard/dashboard/views/color_picker.py index 2c7e629..9b5ddd7 100644 --- a/dashboard/dashboard/views/color_picker.py +++ b/dashboard/dashboard/views/color_picker.py @@ -41,7 +41,7 @@ def _display_primary_color(color: list) -> rx.Component: style=styles.color_picker_style, ), ), - on_click=ThemeState.setvar("accent_color", color[0].lower()), + on_click=ThemeState.set_accent_color(color[0].lower()), ), content=color[0], ) @@ -67,7 +67,7 @@ def _display_secondary_color(colors: list) -> rx.Component: style=styles.color_picker_style, ), ), - on_click=ThemeState.setvar("gray_color", colors[0].lower()), + on_click=ThemeState.set_gray_color(colors[0].lower()), ), content=colors[0], ) diff --git a/dashboard/dashboard/views/table.py b/dashboard/dashboard/views/table.py index b6be1e5..e6b72a8 100644 --- a/dashboard/dashboard/views/table.py +++ b/dashboard/dashboard/views/table.py @@ -139,7 +139,7 @@ def main_table() -> rx.Component: rx.icon("x"), justify="end", cursor="pointer", - on_click=TableState.setvar("search_value", ""), + on_click=TableState.set_search_value(""), display=rx.cond(TableState.search_value, "flex", "none"), ), value=TableState.search_value,