Conversation
…s the active route
Jamiefaber
left a comment
There was a problem hiding this comment.
Once logging in the setupflow prints and when i log in a gain the setupflow doesnt print anymore, works correctly
| self.password = st.text_input("Password", type="password") | ||
| if st.button("Login", use_container_width=True): | ||
| self.login_flow.dispatch() | ||
| self.login_flow.dispatch() # via on click, doe hij dan wel een rerun/ |
|
|
||
| self.app = StSteroids() | ||
|
|
||
| # self.app.on_app_run_once(self.setup_flow) |
| """ | ||
| self._routes[route.name] = route | ||
|
|
||
| def on_app_run_once(self, callback: Flow): |
| ) | ||
|
|
||
| if st.button("logout"): | ||
| del st.session_state["store"]["access_token"] |
There was a problem hiding this comment.
After pressing the log out button no login screen appears until I click somewhere else. An st.rerun would fix this for example.
| Registers a layout or page as a route in your app. | ||
| - name is the route identifier | ||
| - layout is the layout class or callable to render when this route is selected | ||
| Registers a route that maps a route name to a layout class . |
There was a problem hiding this comment.
Registers a route that maps the route name to a layout class. space between point are class and the route name instead of a route name, reads nicer and name is an identifier right
Jamiefaber
left a comment
There was a problem hiding this comment.
Mainly spell check and documentation formatting. One comment about the app_setup flow which needs to be made sure that that is working as intended. Lastly, I also have comments on code which isn't new code, I think you didn't see them because of that. I also wasn't able to resolve my comments, so consider the comments you have replied to as resolved
| Component concepts: | ||
|
|
||
| - components never decide on domain logic, so no domain error handeling for example | ||
| - a component contains interaction elements, unless |
There was a problem hiding this comment.
components contain interaction elements, unless:
|
|
||
| - components never decide on domain logic, so no domain error handeling for example | ||
| - a component contains interaction elements, unless | ||
| - the component is still meaningful and usable without a the interaction element → split the element out |
There was a problem hiding this comment.
the component is still meaningful and usable without the interaction element → split the element out
| - components never decide on domain logic, so no domain error handeling for example | ||
| - a component contains interaction elements, unless | ||
| - the component is still meaningful and usable without a the interaction element → split the element out | ||
| - a component doesn't navigate pages |
There was a problem hiding this comment.
components don't navigate pages
| - a component contains interaction elements, unless | ||
| - the component is still meaningful and usable without a the interaction element → split the element out | ||
| - a component doesn't navigate pages | ||
| - should have methods for updating it's attributes (explicit state changes) (so that the flow doesn't need to all the attributes) |
There was a problem hiding this comment.
should have methods for updating its attributes (this makes explicit state changes possible, so that the flow doesn't need to have all the attributes)
| - Flows coordinate multiple components and stores as part of a single interaction | ||
| - Flows determine navigation and control flow between layouts or pages | ||
| - Flows own error handling and recovery logic for the interactions they manage | ||
| - Flows may contain light business rules, but core domain logic should live in services |
There was a problem hiding this comment.
The bullet points here all start with Flow with a capital F, above and below the component and layout start with lowercase letter. Make sure it is uniform, suggest starting with capitals and ending with dots
| class Router: | ||
| """ | ||
| A routing system for Streamlit applications, allowing navigation between different pages. | ||
| A routing system for the framework, allowing navigation between different layouts. |
| @@ -13,14 +13,13 @@ class Store: | |||
| """ | |||
There was a problem hiding this comment.
Store doc string has param, whereas it should be formatted as attributes
| """ | ||
|
|
||
| def __init__(self, store_name: str): | ||
| """ |
There was a problem hiding this comment.
Why is this docstring removed?
| class ComponentStore(Store): | ||
| """ | ||
| Class that creates a component session store. This can be passed to component instances. | ||
| Class that creates a component session store. |
| @@ -15,7 +15,7 @@ def __init__(self, style_file: str): | |||
| """ | |||
| self.style_file = style_file | |||
There was a problem hiding this comment.
Name style file as attribute in the class doc string
|
A smaller, SMOOTHER, cleaner, clearer framework |
| ): | ||
| ) -> None: | ||
| """ | ||
| Executes the render method implemented in the subclasses, additionaly providing extra configuration based on the `render_as` parameter |
| from .flow import Flow | ||
|
|
||
|
|
||
| class RouteBuilder: |
There was a problem hiding this comment.
Missing example where Routebuilder usage is shown, specifically the on_enter functionallity
|
Partially rewritten the framework to reduce its footprint and make object creation more intuitive. Editor and debugger support has been improved, making development smoother and more productive. The router system has also been greatly enhanced, now supporting conditional routes directly within the framework, giving you more control over navigation and layout rendering.
Todo: