Skip to content

Commit 09eff0f

Browse files
ENG-7585: docs patch (+ ENG-7581) (#1611)
* refine ai docs * Reflex Build IDE vid * refine interaction mode docs * patches to navbar, sidebar, and others * add link with url * make set sidebar index event temporal --------- Co-authored-by: carlosabadia <cutillascarlos@gmail.com>
1 parent 8478ff8 commit 09eff0f

File tree

7 files changed

+19
-23
lines changed

7 files changed

+19
-23
lines changed

docs/ai_builder/app_lifecycle/general.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,3 @@ rx.el.div(render_image())
4646

4747
- **Delete App**
4848
Permanently remove an app you no longer need. **Warning:** This action cannot be undone.
49-
50-
## Common Use Cases
51-
52-
- **Keep Apps Organized**
53-
Rename apps to make them easier to find in your workspace.
54-
55-
- **Integration Reference**
56-
Use the App ID when connecting your app to other tools or APIs.
57-
58-
- **Clean Up Workspace**
59-
Delete outdated or test apps to keep your workspace tidy.

docs/ai_builder/features/ide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Reflex Build includes a **powerful, in-browser IDE** built on **Monaco Editor**,
66
<iframe
77
width="100%"
88
height="400"
9-
src="https://www.youtube.com/embed/aW0ZefEC3SU"
9+
src="https://www.youtube.com/embed/UAj9vUweQ5g"
1010
title="Reflex Build - IDE"
1111
frameborder="0"
1212
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"

docs/ai_builder/features/interaction_modes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Use Chat mode when you want to **ask questions** or get **advice without alterin
5555
## When to Use Each
5656

5757
- **Build a new feature or component** → Use **Agent**
58-
- **Set up integrations (DB, API, etc.)** → Use **Agent**
58+
- **Set up integrations (DB, etc.)** → Use **Agent**
5959
- **Understand Reflex concepts** → Use **Chat**
6060
- **Debug an error in your code** → Start with **Chat**, then switch to **Agent**
6161
- **Explore ideas or best practices** → Use **Chat**

pcweb/components/docpage/navbar/navbar.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def link_item(name: str, url: str, active_str: str = ""):
106106
}
107107
},
108108
class_name=common_cn + rx.cond(active, active_cn, unactive_cn),
109+
on_click=SidebarState.set_sidebar_index(0)
109110
)
110111

111112

@@ -455,7 +456,7 @@ def new_component_section() -> rx.Component:
455456
nav_menu.item(
456457
link_item(
457458
"AI Builder",
458-
ai_builder_pages.overview.what_is_reflex_build.path,
459+
ai_builder_pages.overview.best_practices.path,
459460
"builder",
460461
),
461462
),

pcweb/components/docpage/sidebar/sidebar.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def filter_out_non_sidebar_items(items: list[SideBarBase]) -> list[SideBarItem]:
286286

287287
def sidebar_category(name: str, url: str, icon: str, index: int):
288288
return rx.el.li(
289-
rx.link(
289+
rx.el.div(
290290
rx.box(
291291
rx.box(
292292
rx.box(
@@ -314,17 +314,20 @@ def sidebar_category(name: str, url: str, icon: str, index: int):
314314
SidebarState.sidebar_index == index, " visible", " hidden"
315315
),
316316
),
317-
class_name="flex flex-row justify-between items-center hover:bg-slate-3 p-[0.5rem_1rem_0.5rem_0.5rem] rounded-2xl w-full transition-bg self-stretch"
317+
class_name="cursor-pointer flex flex-row justify-between items-center hover:bg-slate-3 p-[0.5rem_1rem_0.5rem_0.5rem] rounded-2xl w-full transition-bg self-stretch"
318318
+ rx.cond(
319319
SidebarState.sidebar_index == index,
320320
" bg-slate-3",
321321
" bg-transparent",
322322
),
323323
),
324-
on_click=SidebarState.set_sidebar_index(index),
325-
class_name="w-full text-slate-9 hover:!text-slate-9",
326-
underline="none",
327-
href=url,
324+
rx.el.a(
325+
to=url,
326+
on_click=rx.prevent_default,
327+
class_name="inset-0 absolute z-[-1]",
328+
),
329+
class_name="w-full text-slate-9 hover:!text-slate-9 relative",
330+
on_click=[SidebarState.set_sidebar_index(index), rx.redirect(url)],
328331
),
329332
class_name="w-full",
330333
)
@@ -417,13 +420,13 @@ def sidebar_comp(
417420
rx.el.ul(
418421
sidebar_category(
419422
"Learn",
420-
"/docs/ai-builder/overview/best-practices",
423+
ai_builder_pages.overview.best_practices.path,
421424
"bot",
422425
0,
423426
),
424427
sidebar_category(
425428
"MCP",
426-
"/docs/ai-builder/integrations/mcp-overview",
429+
ai_builder_pages.integrations.mcp_overview.path,
427430
"plug",
428431
1,
429432
),

pcweb/components/docpage/sidebar/sidebar_items/item.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ def create_item(route: Route, children=None):
1717
.replace("Cli", "CLI")
1818
.replace("Ai", "AI")
1919
.replace("Ide", "IDE")
20+
.replace("Mcp", "MCP")
21+
2022
)
2123
return SideBarItem(
2224
names=name, alt_name_for_next_prev=alt_name_for_next_prev, link=url

pcweb/components/docpage/sidebar/state.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ class SideBarSection(SideBarBase):
3939
class SidebarState(rx.State):
4040
_sidebar_index: int = -1
4141

42+
@rx.event(temporal=True)
4243
def set_sidebar_index(self, num) -> int:
4344
self._sidebar_index = num
4445

45-
@rx.var(cache=True, initial_value=-1)
46+
@rx.var(initial_value=-1)
4647
def sidebar_index(self) -> int:
4748
route = self.router.page.path
4849
if self._sidebar_index < 0:

0 commit comments

Comments
 (0)