Skip to content

Commit 1296560

Browse files
authored
feat: MCP servers open in a drawer on mobile now (#119)
Now MCP servers are loaded in a drawer component on smaller screens. Closes #84 ![CleanShot 2025-07-08 at 09 04 29](https://github.com/user-attachments/assets/55115fd8-3e2b-4c71-b606-e3902223e0a8) This pull request introduces several updates to the codebase, including adding a new dependency for popovers, implementing a reusable popover component, and enhancing the `Chat` component with a new server selector UI. The changes improve functionality and maintainability by centralizing popover logic and refining the user interface. ### Dependency Updates: * Added `@radix-ui/react-popover` to the `package.json` dependencies to enable popover functionality. ### Component Enhancements: * Implemented a reusable popover component in `src/components/ui/popover.tsx`, including `Popover`, `PopoverTrigger`, `PopoverContent`, and `PopoverAnchor` components. These components use Radix UI primitives and provide consistent styling and behavior for popovers. ### UI Improvements: * Updated the `Chat` component in `src/components/Chat.tsx` to include a server selector wrapped in a styled container, enhancing the user interface for server management. ### Optional Dependency Adjustments: * Reorganized the `optionalDependencies` section in `package.json` to ensure consistent formatting and inclusion of the latest versions of `lightningcss` for various platforms.
1 parent ae690da commit 1296560

File tree

5 files changed

+427
-138
lines changed

5 files changed

+427
-138
lines changed

package-lock.json

Lines changed: 38 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@radix-ui/react-dialog": "^1.0.5",
2020
"@radix-ui/react-dropdown-menu": "^2.0.6",
2121
"@radix-ui/react-label": "^2.0.2",
22+
"@radix-ui/react-popover": "^1.1.14",
2223
"@radix-ui/react-slot": "^1.2.3",
2324
"@radix-ui/react-switch": "^1.2.5",
2425
"@radix-ui/react-toast": "^1.1.5",
@@ -71,9 +72,9 @@
7172
},
7273
"optionalDependencies": {
7374
"@rollup/rollup-linux-arm64-gnu": "^4.41.1",
74-
"lightningcss-linux-x64-gnu": "^1.30.1",
75-
"lightningcss-linux-arm64-gnu": "^1.30.1",
7675
"lightningcss-darwin-arm64": "^1.30.1",
77-
"lightningcss-darwin-x64": "^1.30.1"
76+
"lightningcss-darwin-x64": "^1.30.1",
77+
"lightningcss-linux-arm64-gnu": "^1.30.1",
78+
"lightningcss-linux-x64-gnu": "^1.30.1"
7879
}
7980
}

src/components/Chat.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -724,13 +724,15 @@ export function Chat() {
724724
</Button>
725725
</div>
726726
)}
727-
<ServerSelector
728-
servers={servers}
729-
onServersChange={setServers}
730-
selectedServers={selectedServers}
731-
onServerToggle={handleServerToggle}
732-
disabled={hasStartedChat}
733-
/>
727+
<div className="md:border-t border-gray-200 dark:border-gray-800 bg-background p-2 md:p-4">
728+
<ServerSelector
729+
servers={servers}
730+
onServersChange={setServers}
731+
selectedServers={selectedServers}
732+
onServerToggle={handleServerToggle}
733+
disabled={hasStartedChat}
734+
/>
735+
</div>
734736
<ChatInput
735737
onSendMessage={handleSendMessage}
736738
disabled={isLoading || streaming}

0 commit comments

Comments
 (0)