mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-14 20:55:15 +02:00
fix(extension): resolve UI layout issues in sidepanel
- Add sidepanel folder to Tailwind content paths (root cause of broken CSS) - Fix ChatInterface layout: group ChatInput and QuickCapture properly - Remove sticky positioning from QuickCapture (now in flex container) - Make TokenInfoCard buttons more compact for narrow screens - Improve TokenAnalysisWidget button layout with flex-wrap
This commit is contained in:
parent
4be8c1b996
commit
cb9af89318
5 changed files with 45 additions and 39 deletions
|
|
@ -511,24 +511,27 @@ What would you like to know?`;
|
|||
)}
|
||||
</div>
|
||||
|
||||
{/* Chat input (only in chat mode) */}
|
||||
{/* Chat input and quick capture (only in chat mode) */}
|
||||
{viewMode === "chat" && (
|
||||
<ChatInput
|
||||
onSend={handleSendMessage}
|
||||
disabled={isStreaming}
|
||||
placeholder={
|
||||
context?.pageType === "dexscreener"
|
||||
? `Ask about ${context.tokenData?.tokenSymbol || "this token"}...`
|
||||
: "Ask me anything..."
|
||||
}
|
||||
suggestions={messages.length === 0 ? [] : quickSuggestions}
|
||||
onSuggestionClick={handleSuggestionClick}
|
||||
/>
|
||||
<div className="flex-shrink-0">
|
||||
<ChatInput
|
||||
onSend={handleSendMessage}
|
||||
disabled={isStreaming}
|
||||
placeholder={
|
||||
context?.pageType === "dexscreener"
|
||||
? `Ask about ${context.tokenData?.tokenSymbol || "this token"}...`
|
||||
: "Ask me anything..."
|
||||
}
|
||||
suggestions={messages.length === 0 ? [] : quickSuggestions}
|
||||
onSuggestionClick={handleSuggestionClick}
|
||||
/>
|
||||
<QuickCapture />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Back to chat button for other views */}
|
||||
{viewMode !== "chat" && (
|
||||
<div className="border-t p-3">
|
||||
<div className="flex-shrink-0 border-t p-3">
|
||||
<button
|
||||
className="w-full py-2 text-sm text-center text-primary hover:bg-primary/5 rounded-md transition-colors"
|
||||
onClick={() => setViewMode("chat")}
|
||||
|
|
@ -538,9 +541,6 @@ What would you like to know?`;
|
|||
</div>
|
||||
)}
|
||||
|
||||
{/* Quick capture button */}
|
||||
<QuickCapture />
|
||||
|
||||
{/* Alert configuration modal */}
|
||||
<AlertConfigModal
|
||||
open={showAlertModal}
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ export function QuickCapture() {
|
|||
};
|
||||
|
||||
return (
|
||||
<div className="sticky bottom-0 border-t p-3 bg-background">
|
||||
<Button className="w-full" onClick={handleCapture}>
|
||||
<div className="border-t p-3 bg-background">
|
||||
<Button className="w-full" variant="outline" onClick={handleCapture}>
|
||||
<Camera className="mr-2 h-4 w-4" />
|
||||
Save Current Page
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -179,43 +179,43 @@ export function TokenInfoCard({
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{/* Quick actions - now with 4 buttons */}
|
||||
<div className="grid grid-cols-4 gap-1.5 mt-3">
|
||||
{/* Quick actions - 4 buttons in grid, responsive */}
|
||||
<div className="grid grid-cols-4 gap-1 mt-3">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 px-2 text-xs"
|
||||
className="h-8 px-1.5 text-xs flex items-center justify-center"
|
||||
onClick={() => handleQuickAction("safety")}
|
||||
>
|
||||
<Shield className="mr-1 h-3 w-3" />
|
||||
Safety
|
||||
<Shield className="h-3 w-3 mr-0.5 flex-shrink-0" />
|
||||
<span className="truncate">Safety</span>
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 px-2 text-xs"
|
||||
className="h-8 px-1.5 text-xs flex items-center justify-center"
|
||||
onClick={() => handleQuickAction("holders")}
|
||||
>
|
||||
<Users className="mr-1 h-3 w-3" />
|
||||
Holders
|
||||
<Users className="h-3 w-3 mr-0.5 flex-shrink-0" />
|
||||
<span className="truncate">Holders</span>
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 px-2 text-xs"
|
||||
className="h-8 px-1.5 text-xs flex items-center justify-center"
|
||||
onClick={() => handleQuickAction("predict")}
|
||||
>
|
||||
<TrendingUp className="mr-1 h-3 w-3" />
|
||||
Predict
|
||||
<TrendingUp className="h-3 w-3 mr-0.5 flex-shrink-0" />
|
||||
<span className="truncate">Predict</span>
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
className="h-8 px-2 text-xs text-orange-600 hover:text-orange-700 hover:bg-orange-50 dark:text-orange-400 dark:hover:bg-orange-950"
|
||||
className="h-8 px-1.5 text-xs flex items-center justify-center text-orange-600 hover:text-orange-700 hover:bg-orange-50 dark:text-orange-400 dark:hover:bg-orange-950"
|
||||
onClick={() => handleQuickAction("rug")}
|
||||
>
|
||||
<AlertTriangle className="mr-1 h-3 w-3" />
|
||||
Rug
|
||||
<AlertTriangle className="h-3 w-3 mr-0.5 flex-shrink-0" />
|
||||
<span className="truncate">Rug</span>
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -178,15 +178,15 @@ export function TokenAnalysisWidget({
|
|||
)}
|
||||
|
||||
{/* Action buttons */}
|
||||
<div className="flex gap-2">
|
||||
<Button size="sm" variant="outline" onClick={onAddToWatchlist} className="flex-1">
|
||||
<Star className="h-3 w-3 mr-1" />
|
||||
{isInWatchlist ? "In Watchlist" : "Add to Watchlist"}
|
||||
<div className="flex gap-1.5 flex-wrap">
|
||||
<Button size="sm" variant="outline" onClick={onAddToWatchlist} className="flex-1 min-w-0 text-xs h-8">
|
||||
<Star className="h-3 w-3 mr-1 flex-shrink-0" />
|
||||
<span className="truncate">{isInWatchlist ? "In Watchlist" : "Add to Watchlist"}</span>
|
||||
</Button>
|
||||
<Button size="sm" variant="outline" onClick={onSetAlert}>
|
||||
<Button size="sm" variant="outline" onClick={onSetAlert} className="h-8 w-8 p-0 flex-shrink-0">
|
||||
<Bell className="h-3 w-3" />
|
||||
</Button>
|
||||
<Button size="sm" variant="default" onClick={onAnalyzeFurther}>
|
||||
<Button size="sm" variant="default" onClick={onAnalyzeFurther} className="text-xs h-8">
|
||||
Analyze More
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,13 @@ const { fontFamily } = require("tailwindcss/defaultTheme");
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
module.exports = {
|
||||
darkMode: ["class"],
|
||||
content: ["./*.{js,jsx,ts,tsx}", "./routes/*.tsx", "./routes/**/*.tsx"],
|
||||
content: [
|
||||
"./*.{js,jsx,ts,tsx}",
|
||||
"./routes/**/*.{js,jsx,ts,tsx}",
|
||||
"./sidepanel/**/*.{js,jsx,ts,tsx}",
|
||||
"./lib/**/*.{js,jsx,ts,tsx}",
|
||||
"./background/**/*.{js,jsx,ts,tsx}",
|
||||
],
|
||||
theme: {
|
||||
container: {
|
||||
center: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue