Skip to content

Commit 06d6c2a

Browse files
committed
Add privacy policy link and improve SQL display wrapping
- Add privacy policy link to database connection modal - Fix SQL query text wrapping to prevent horizontal scrolling - Improve table cell wrapping with max-width constraints
1 parent 0da7498 commit 06d6c2a

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

app/src/components/chat/ChatMessage.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ const ChatMessage = ({ type, content, steps, queryData, analysisInfo, confirmati
6464
This operation will perform a <span className={`font-semibold ${isHighRisk ? 'text-red-400' : 'text-yellow-400'}`}>{operationType}</span> query:
6565
</p>
6666
{confirmationData?.sqlQuery && (
67-
<div className="bg-gray-900 border border-gray-700 rounded p-3 overflow-x-auto">
68-
<pre className="text-sm font-mono text-gray-200">
67+
<div className="bg-gray-900 border border-gray-700 rounded p-3">
68+
<pre className="text-sm font-mono text-gray-200 whitespace-pre-wrap break-words overflow-wrap-anywhere">
6969
<code className="language-sql">{confirmationData.sqlQuery}</code>
7070
</pre>
7171
</div>
@@ -156,8 +156,8 @@ const ChatMessage = ({ type, content, steps, queryData, analysisInfo, confirmati
156156
</div>
157157

158158
{hasSQL && (
159-
<div className="overflow-x-auto -mx-2 px-2">
160-
<pre className="bg-gray-900 text-gray-200 p-3 rounded text-sm mb-3 w-fit min-w-full font-mono">
159+
<div className="-mx-2 px-2">
160+
<pre className="bg-gray-900 text-gray-200 p-3 rounded text-sm mb-3 font-mono whitespace-pre-wrap break-words overflow-wrap-anywhere">
161161
<code className="language-sql">{content}</code>
162162
</pre>
163163
</div>
@@ -219,7 +219,7 @@ const ChatMessage = ({ type, content, steps, queryData, analysisInfo, confirmati
219219
<thead className="sticky top-0 bg-gray-800 z-10">
220220
<tr className="border-b border-gray-700">
221221
{Object.keys(queryData[0]).map((column) => (
222-
<th key={column} className="text-left px-3 py-2 text-gray-300 font-semibold bg-gray-800 whitespace-nowrap">
222+
<th key={column} className="text-left px-3 py-2 text-gray-300 font-semibold bg-gray-800 break-words" style={{ maxWidth: '300px', minWidth: '100px' }}>
223223
{column}
224224
</th>
225225
))}
@@ -229,7 +229,7 @@ const ChatMessage = ({ type, content, steps, queryData, analysisInfo, confirmati
229229
{queryData.map((row, index) => (
230230
<tr key={index} className="border-b border-gray-700/50 hover:bg-gray-700/30">
231231
{Object.values(row).map((value: any, cellIndex) => (
232-
<td key={cellIndex} className="px-3 py-2 text-gray-200 whitespace-nowrap">
232+
<td key={cellIndex} className="px-3 py-2 text-gray-200 break-words" style={{ maxWidth: '300px', minWidth: '100px' }}>
233233
{String(value)}
234234
</td>
235235
))}

app/src/components/modals/DatabaseModal.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,15 @@ const DatabaseModal = ({ open, onOpenChange }: DatabaseModalProps) => {
217217
Connect to Database
218218
</DialogTitle>
219219
<DialogDescription className="text-sm text-muted-foreground">
220-
Connect to PostgreSQL or MySQL database using a connection URL or manual entry
220+
Connect to PostgreSQL or MySQL database using a connection URL or manual entry.{" "}
221+
<a
222+
href="https://www.falkordb.com/privacy-policy/"
223+
target="_blank"
224+
rel="noopener noreferrer"
225+
className="text-primary hover:underline"
226+
>
227+
Privacy Policy
228+
</a>
221229
</DialogDescription>
222230
</DialogHeader>
223231

0 commit comments

Comments
 (0)