Repository navigation
feat(frontend): open the portal UI by default #2358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,10 +27,10 @@ export const Route = createFileRoute("/portal")({ | |||||||||||||||||
| }); | ||||||||||||||||||
|
|
||||||||||||||||||
| function PortalRoute() { | ||||||||||||||||||
| // The root shell swaps in PortalLayout for this route while the preview is | ||||||||||||||||||
| // The root shell swaps in PortalLayout for this route while the portal is | ||||||||||||||||||
| // on, so this component only mounts with it OFF — a pasted /portal URL, or a | ||||||||||||||||||
| // viewer who turned the preview off while standing here. Either way the | ||||||||||||||||||
| // portal must not render: send them to the app they do have. | ||||||||||||||||||
| // viewer who opted out while standing here. Either way the portal must not | ||||||||||||||||||
| // render: send them to the app they do have. | ||||||||||||||||||
|
Comment on lines
+30
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Correct the mount-state description. The comment says Proposed comment- // The root shell swaps in PortalLayout for this route while the portal is
- // on, so this component only mounts with it OFF — a pasted /portal URL, or a
- // viewer who opted out while standing here. Either way the portal must not
- // render: send them to the app they do have.
+ // When the portal is disabled, a direct /portal URL or an opt-out while
+ // already here redirects to /. When enabled, render PortalLayout.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| if (!usePortalEnabled()) return <Navigate to="/" replace />; | ||||||||||||||||||
| return <PortalLayout />; | ||||||||||||||||||
| } | ||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: constructorfabric/insight
Length of output: 6380
Correct the reload claim in the route comment.
IndexRoutesubscribes throughusePortalEnabled()viauseSyncExternalStore(subscribe, ...), andsetPortalEnabled()callsemit()before reading the store. If a reader enables the portal while this route is mounted, the hook re-renders and the route returns<Navigate to="/portal" replace />without requiring a reload. Update the comment to describebeforeLoadas the initial-navigation fallback.Proposed comment
📝 Committable suggestion
🤖 Prompt for AI Agents