-
Notifications
You must be signed in to change notification settings - Fork 30
Refactor home to chat input #2161
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
Conversation
🧪 BenchmarkShould we run the MCP Gateway benchmark for this PR? React with 👍 to run the benchmark.
Benchmark will run on the next push after you react. |
Release OptionsShould a new version be published when this PR is merged? React with an emoji to vote on the release type:
Current version: Deployment
|
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.
No issues found across 4 files
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.
1 issue found across 4 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="apps/mesh/src/web/components/decopilot-chat/decopilot-chat.tsx">
<violation number="1" location="apps/mesh/src/web/components/decopilot-chat/decopilot-chat.tsx:270">
P2: Calling `setHasStartedChat` during render is a React anti-pattern that causes unnecessary re-renders. This side effect should be moved to a `useEffect` hook.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| const [hasStartedChat, setHasStartedChat] = useState(!isEmpty); | ||
|
|
||
| // Reset to centered view when thread changes (new thread created) | ||
| if (prevThreadIdRef.current !== activeThreadId) { |
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.
P2: Calling setHasStartedChat during render is a React anti-pattern that causes unnecessary re-renders. This side effect should be moved to a useEffect hook.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/mesh/src/web/components/decopilot-chat/decopilot-chat.tsx, line 270:
<comment>Calling `setHasStartedChat` during render is a React anti-pattern that causes unnecessary re-renders. This side effect should be moved to a `useEffect` hook.</comment>
<file context>
@@ -234,12 +263,23 @@ function ChatPanelContent() {
+ const [hasStartedChat, setHasStartedChat] = useState(!isEmpty);
+
+ // Reset to centered view when thread changes (new thread created)
+ if (prevThreadIdRef.current !== activeThreadId) {
+ prevThreadIdRef.current = activeThreadId;
+ if (isEmpty) {
</file context>
a81ca42 to
228694f
Compare
…eamlining imports, and enhancing code clarity.
Summary by cubic
Refactored the org home into a focused chat with a centered greeting and input that switches to normal chat after the first message. Added gateway ice breakers and a “Top Hubs” grid; the side chat panel is disabled on home and the topbar chat button respects it.
New Features
Refactors
Written for commit ad699b4. Summary will update on new commits.