Skip to content

Comments

Move enterprise docs from reflex-enterprise to reflex-web with proper dictionary escaping#1447

Closed
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
devin/1750906099-move-enterprise-docs
Closed

Move enterprise docs from reflex-enterprise to reflex-web with proper dictionary escaping#1447
devin-ai-integration[bot] wants to merge 9 commits intomainfrom
devin/1750906099-move-enterprise-docs

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jun 26, 2025

Move enterprise docs from reflex-enterprise to reflex-web with proper dictionary escaping

Summary

This PR migrates all enterprise documentation from the reflex-dev/reflex-enterprise repository to reflex-dev/reflex-web/docs/enterprise/. The migration includes 28 documentation files covering AG Grid, AG Charts, Maps, Mantine components, drag-and-drop, and enterprise configuration features.

Key technical changes:

  • Dictionary syntax escaping: Systematically escaped dictionary literals in code blocks (e.g., {"key": "value"}\{"key": "value"}) to prevent the flexdown parser from evaluating them as template expressions
  • Import statement updates: Changed imports from from flexd.flexd import docs to from pcweb.pages import docs to match reflex-web structure
  • Code block type changes: Converted some executable (python demo exec) blocks to display-only (python) blocks where enterprise components can't run in reflex-web environment
  • Sidebar navigation: Added enterprise documentation sections to the sidebar (with some sections commented out to prevent import errors)

Review & Testing Checklist for Human

🔴 Critical - Must Test:

  • Browser testing: Navigate to http://localhost:3000/docs/enterprise/ and verify all enterprise documentation pages load and render correctly
  • Dictionary syntax verification: Check that escaped dictionaries display properly in code blocks (should show {"key": "value"} not error messages)
  • Import validation: Verify that from pcweb.pages import docs imports work without runtime errors
  • Navigation testing: Test sidebar navigation to enterprise docs and verify all internal links work
  • Interactive examples: Test that code examples and interactive components render and function correctly

Recommended test plan:

  1. Start reflex server (reflex run) and navigate to enterprise docs
  2. Click through all major sections: AG Grid, AG Charts, Maps, Mantine components
  3. Verify code examples display correctly without syntax errors
  4. Test a few interactive components to ensure they work

Diagram

graph TB
    subgraph "reflex-enterprise (source)"
        RE[docs/] --> REFiles[28 enterprise docs]
    end
    
    subgraph "reflex-web (destination)"
        RW[docs/enterprise/] --> RWFiles[28 migrated docs]:::major-edit
        Sidebar[pcweb/components/docpage/sidebar/sidebar.py]:::major-edit
    end
    
    subgraph "Key Changes"
        Dict[Dictionary escaping<br/>{"key":"value"} → \{"key":"value"}]:::major-edit
        Import[Import updates<br/>flexd.flexd → pcweb.pages]:::major-edit
        CodeBlock[Code block type changes<br/>exec → display-only]:::minor-edit
    end
    
    REFiles -.->|migrate| RWFiles
    RWFiles --> Dict
    RWFiles --> Import  
    RWFiles --> CodeBlock
    
    subgraph Legend
        L1[Major Edit]:::major-edit
        L2[Minor Edit]:::minor-edit
        L3[Context/No Edit]:::context
    end
    
    classDef major-edit fill:#90EE90
    classDef minor-edit fill:#87CEEB
    classDef context fill:#FFFFFF
Loading

Notes

⚠️ Testing Limitation: Due to server runtime issues (OSError with flexdown module cleanup), I was unable to fully test the enterprise documentation pages in the browser. While compilation succeeded (100% - 774/774 pages), the actual page rendering needs to be verified by the reviewer.

Technical Context: The main challenge was that reflex-web's flexdown parser treats dictionary literals like {"key": "value"} as template expressions and tries to evaluate them, causing SyntaxError. The solution was to escape the braces with backslashes: \{"key": "value"} which prevents parser evaluation while preserving the visual appearance in rendered docs.

Files Changed: 29 files total - 28 new enterprise documentation files + 1 sidebar navigation update. All changes maintain the original documentation content while adapting it for the reflex-web environment.


Link to Devin run: https://app.devin.ai/sessions/37382e16e29044f896be52de63fb5e2b
Requested by: @Alek99

devin-ai-integration bot and others added 6 commits June 26, 2025 02:48
- Moved all docs from reflex-dev/reflex-enterprise/docs to docs/enterprise/
- Includes ag_chart, ag_grid, mantine, map, drag-and-drop, and other enterprise features
- Replaced existing overview.md with comprehensive enterprise documentation
- Preserves all file structure and content from source repository

Co-Authored-By: Alek <alek@pynecone.io>
- Replace 'from flexd.flexd import docs' with 'from pcweb.pages import docs'
- Fixes ModuleNotFoundError when building reflex-web with enterprise docs
- Updated 12 files across enterprise documentation

Co-Authored-By: Alek <alek@pynecone.io>
- Convert plain 'python' code blocks to 'python demo box' format
- Prevents flexdown parser from evaluating dictionary literals as templates
- Resolves SyntaxError: invalid syntax for {'field': 'direction'} expressions

Co-Authored-By: Alek <alek@pynecone.io>
- Replace {'field': i} with dict(field=i) to avoid template evaluation
- Prevents SyntaxError: invalid syntax in flexdown parser

Co-Authored-By: Alek <alek@pynecone.io>
- Move all enterprise documentation from reflex-dev/reflex-enterprise to reflex-web/docs/enterprise
- Fix import statements from 'from flexd.flexd import docs' to 'from pcweb.pages import docs'
- Properly escape dictionary literals in display-only code blocks to prevent flexdown parser evaluation
- Update sidebar navigation to include enterprise documentation sections
- All 28 enterprise documentation files successfully migrated and compilation reaches 100%

Co-Authored-By: Alek <alek@pynecone.io>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Major migration of enterprise documentation from reflex-enterprise to reflex-web, including comprehensive docs for AG Grid, Mantine components, maps, and enterprise features.

  • Added complete AG Grid documentation suite in docs/enterprise/ag_grid/ covering advanced features like model wrappers, pivot mode, and aligned grids
  • Added 14 new Mantine component docs in docs/enterprise/mantine/ including MultiSelect, JsonInput, and RingProgress
  • Added enterprise map documentation in docs/enterprise/map/index.md with interactive features and location tracking
  • Modified pcweb/components/docpage/sidebar/sidebar.py to accommodate new enterprise documentation structure
  • Fixed dictionary escaping in markdown code blocks using backslashes ({) for Python dictionaries

31 files reviewed, 28 comments
Edit PR Review Bot Settings | Greptile

rxe.mantine.ring_progress(
size=100,
sections=[
\{"value": RingProgressState.value, "color": "blue"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Escape character \ before the dictionary brace is unnecessary and could cause syntax errors

Suggested change
\{"value": RingProgressState.value, "color": "blue"},
{"value": RingProgressState.value, "color": "blue"},


> Available starting from Team tier.

By using the config option `use_single_port` you can configure your backend to proxy any request it received and cannot handle to the frontend. This results in a single port deployment, where the frontend and backend are both served on the same port.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Grammar issue: 'request it received' should be 'requests it receives'

Suggested change
By using the config option `use_single_port` you can configure your backend to proxy any request it received and cannot handle to the frontend. This results in a single port deployment, where the frontend and backend are both served on the same port.
By using the config option `use_single_port` you can configure your backend to proxy any requests it receives and cannot handle to the frontend. This results in a single port deployment, where the frontend and backend are both served on the same port.


## Provider

For drag and drop to work, your app need to be wrapped with the `rxe.dnd.provider` component. By default, `draggable` and `drop_target` will add the `rxe.dnd.provider` automatically to the app wrapping components tree.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: needs 's' in 'your app needs to be wrapped'

Suggested change
For drag and drop to work, your app need to be wrapped with the `rxe.dnd.provider` component. By default, `draggable` and `drop_target` will add the `rxe.dnd.provider` automatically to the app wrapping components tree.
For drag and drop to work, your app needs to be wrapped with the `rxe.dnd.provider` component. By default, `draggable` and `drop_target` will add the `rxe.dnd.provider` automatically to the app wrapping components tree.

),
rx.button(
"Toggle Collapse",
on_click=lambda: CollapseState.toggle_collapse,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Event handler reference incorrect. The lambda function makes a reference to the function instead of calling it. Remove the lambda.

Suggested change
on_click=lambda: CollapseState.toggle_collapse,
on_click=CollapseState.toggle_collapse,

from pcweb.pages import docs
```

# Build with Reflex Badge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Title should be 'Built with Reflex Badge' instead of 'Build with Reflex Badge'

Suggested change
# Build with Reflex Badge
# Built with Reflex Badge


# Value Transformers

AgGrid allow you to apply transformers based on the column of your grid. This allow you to perform operations on the data before displaying it on the grid, without having to pre-process the data on the backend, reducing the load on your application.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Grammar issues in introduction. Should be 'allows' instead of 'allow' (twice).

Suggested change
AgGrid allow you to apply transformers based on the column of your grid. This allow you to perform operations on the data before displaying it on the grid, without having to pre-process the data on the backend, reducing the load on your application.
AgGrid allows you to apply transformers based on the column of your grid. This allows you to perform operations on the data before displaying it on the grid, without having to pre-process the data on the backend, reducing the load on your application.

Comment on lines 394 to 396
# Handle sidebar categories for docs/cloud first
# If the path doesn't start with /docs/cloud, check for general docs
rx.cond( # pyright: ignore [reportCallIssue]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Comment mentions 'docs/cloud' but condition checks for '/docs/' - update comment for accuracy

Suggested change
# Handle sidebar categories for docs/cloud first
# If the path doesn't start with /docs/cloud, check for general docs
rx.cond( # pyright: ignore [reportCallIssue]
# Handle sidebar categories for docs first
# If the path doesn't start with /docs/, check for general docs
rx.cond( # pyright: ignore [reportCallIssue]

column_defs = [
\{"field": "product_name", "header_name": "Product Name"},
\{"field": "price", "header_name": "Price ($)", "value_formatter": "'$' + params.value"},
rxe.ag_grid.column_def(col_id="price_eur", header_name="Price (€)", value_formatter="params.data.price + ' €'"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: col_id used instead of field property, making code inconsistent with earlier examples and potentially confusing readers.


def dynamic_markers():
return rxe.map(
rxe.map.tile_layer(url="..."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Incomplete URL in example. Add full OpenStreetMap URL like other examples for consistency

Suggested change
rxe.map.tile_layer(url="..."),
rxe.map.tile_layer(
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
attribution='&copy; OpenStreetMap contributors'
),

Comment on lines +23 to +35
chart_options: dict = \{
"data": [
\{"month": "Jan", "avgTemp": 2.3, "iceCreamSales": 162000},
\{"month": "Feb", "avgTemp": 3.1, "iceCreamSales": 200000},
\{"month": "Mar", "avgTemp": 6.3, "iceCreamSales": 302000},
\{"month": "May", "avgTemp": 16.2, "iceCreamSales": 800000},
\{"month": "Jul", "avgTemp": 22.8, "iceCreamSales": 1254000},
\{"month": "Aug", "avgTemp": 24.1, "iceCreamSales": 1500000},
\{"month": "Sep", "avgTemp": 14.5, "iceCreamSales": 950000},
\{"month": "Oct", "avgTemp": 12.4, "iceCreamSales": 500000},
\{"month": "Nov", "avgTemp": 7.2, "iceCreamSales": 300000},
\{"month": "Dec", "avgTemp": 3.5, "iceCreamSales": 200000},
],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: missing April and June months in the sample data which could confuse users

devin-ai-integration bot and others added 3 commits June 26, 2025 04:25
…lers

- Remove unnecessary backslash escaping from executable code blocks in ring-progress.md and pill.md
- Fix grammar issues in single-port-proxy.md and drag-and-drop.md
- Correct event handler reference in collapse.md (remove lambda wrapper)
- Update title from 'Build' to 'Built' in built-with-reflex.md
- All changes address specific feedback from greptile-apps bot comments

Co-Authored-By: Alek <alek@pynecone.io>
- Re-add backslash escaping to dictionary literal in display-only code block
- Prevents flexdown parser from evaluating {value: RingProgressState.value, color: blue} as template expression
- Fixes ValueError: Failed to evaluate expression error

Co-Authored-By: Alek <alek@pynecone.io>
- Create enterprise sidebar items following existing patterns
- Enable enterprise section in sidebar navigation
- Replace external enterprise link with internal navigation
- Organize enterprise docs into logical sections: Overview, Configuration, AG Grid, AG Chart, Interactive Components, Mantine

Co-Authored-By: Alek <alek@pynecone.io>
@Alek99 Alek99 closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant