-
-
Notifications
You must be signed in to change notification settings - Fork 6
fix(mobile): Move chat input into horizontally scrolling container #293
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 |
|---|---|---|
|
|
@@ -88,14 +88,14 @@ export function ChatPanel({ messages, input, setInput }: ChatPanelProps) { | |
| className={cn( | ||
| 'flex flex-col items-start', | ||
| isMobile | ||
| ? 'w-full h-full' | ||
| ? 'w-auto' | ||
| : 'sticky bottom-0 bg-background z-10 w-full border-t border-border px-2 py-3 md:px-4' | ||
| )} | ||
|
Comment on lines
89
to
93
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. On mobile, the SuggestionAdjust the mobile container sizing to prevent shrinking and set a predictable width: <div
className={cn(
'flex flex-col items-start',
isMobile
? 'flex-none shrink-0 w-[min(560px,85vw)]' // was: w-auto
: 'sticky bottom-0 bg-background z-10 w-full border-t border-border px-2 py-3 md:px-4'
)}
>Optionally, keep the form as |
||
| > | ||
| <form | ||
| ref={formRef} | ||
| onSubmit={handleSubmit} | ||
| className={cn('max-w-full w-full', isMobile ? 'px-2 pb-2 pt-1 h-full flex flex-col justify-center' : '')} | ||
| className={cn('max-w-full w-full', isMobile ? 'px-2 pb-2 pt-1 flex flex-col justify-center' : '')} | ||
| > | ||
| <div | ||
| className={cn( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,10 +80,9 @@ export function Chat({ id }: ChatProps) { | |
| {activeView ? <SettingsView /> : <Mapbox />} | ||
| </div> | ||
| <div className="mobile-icons-bar"> | ||
| <MobileIconsBar /> | ||
| </div> | ||
| <div className="mobile-chat-input-area"> | ||
| <ChatPanel messages={messages} input={input} setInput={setInput} /> | ||
| <MobileIconsBar> | ||
| <ChatPanel messages={messages} input={input} setInput={setInput} /> | ||
| </MobileIconsBar> | ||
|
Comment on lines
+83
to
+85
Contributor
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. 🛠️ Refactor suggestion 🧩 Analysis chainVerify that MobileIconsBar handles scrollable overflow correctly. Since ChatPanel is now a child of MobileIconsBar, ensure that the icon bar's container properly handles horizontal scrolling when the combined width of icons + chat panel exceeds the viewport width. 🏁 Script executed: #!/bin/bash
# Description: Check the CSS for mobile-icons-bar-content to verify scrolling behavior
# Search for the mobile-icons-bar-content class styling
rg -n "mobile-icons-bar-content" --type=css --type=scss -A10 -B5
# Also check for any overflow or scroll-related styling in mobile contexts
rg -n "overflow.*scroll|scroll.*overflow|mobile.*overflow" --type=css --type=scss -A3 -B3Length of output: 57 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Searching for MobileIconsBar and related class names..."
rg -n --hidden -S "MobileIconsBar|mobile-icons-bar-content|mobile-icons-bar" -C3 || true
echo "Searching for CSS overflow properties anywhere in repo..."
rg -n --hidden -S "overflow\s*:" -C3 || true
echo "Printing components/chat.tsx (up to 300 lines) for context if present..."
if [ -f components/chat.tsx ]; then
sed -n '1,300p' components/chat.tsx
else
echo "components/chat.tsx not found"
fi
echo "Searching for styled-components / css-in-js patterns that might define styles..."
rg -n --hidden -S "styled\..*|css`|className=.*mobile|mobileIcons" -C3 || trueLength of output: 13336 Enable horizontal scrolling for the mobile icons bar 🤖 Prompt for AI Agents |
||
| </div> | ||
| <div className="mobile-chat-messages-area"> | ||
| {showEmptyScreen ? ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,9 @@ import { History } from '@/components/history' | |
| import { MapToggle } from './map-toggle' | ||
| import { ModeToggle } from './mode-toggle' | ||
|
|
||
| export const MobileIconsBar: React.FC = () => { | ||
| export const MobileIconsBar: React.FC<{ children?: React.ReactNode }> = ({ | ||
| children | ||
| }) => { | ||
| const [, setMessages] = useUIState<typeof AI>() | ||
| const { clearChat } = useActions() | ||
|
|
||
|
|
@@ -53,6 +55,7 @@ export const MobileIconsBar: React.FC = () => { | |
| </Button> | ||
| <History location="header" /> | ||
| <ModeToggle /> | ||
| {children} | ||
| </div> | ||
|
Comment on lines
+58
to
59
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. Appending raw SuggestionWrap {children ? <div className="flex-none shrink-0 ml-2">{children}</div> : null}Reply with "@CharlieHelps yes please" if you want me to add this change. |
||
| ) | ||
| } | ||
|
|
||
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.
You removed the
.mobile-chat-input*styles, butChatPanelstill conditionally applies themobile-chat-inputclass with the comment “Apply mobile chat input styling.” This creates dead/ghost styling and confusion. Given the new layout, this class no longer has any effect and should be removed, or replaced with utility classes where needed.Suggestion
Remove the
mobile-chat-inputclass usage fromChatPaneland rely on utilities. For example:components/chat-panel.tsx, removeisMobile && 'mobile-chat-input'from the wrapper around<Textarea>.If you want me to add a commit that removes the class usage and updates the comment, reply with "@CharlieHelps yes please".