Skip to content

Commit d7dd204

Browse files
authored
Merge pull request #3 from rahulapjs/patch
responsive design issues fixes
2 parents 9cf4c77 + 5c224be commit d7dd204

File tree

8 files changed

+227
-35
lines changed

8 files changed

+227
-35
lines changed

frontend/src/App.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
.app {
22
min-height: 100vh;
33
padding: 0;
4+
display: flex;
5+
flex-direction: column;
46
}
57

68
.main-content {
79
max-width: 1200px;
810
margin: 0 auto;
9-
padding: 0 var(--spacing-md);
11+
padding: 0 1rem;
12+
width: 100%;
1013
}
1114

1215
@media (max-width: 768px) {
1316
.main-content {
14-
padding: 0 var(--spacing-sm);
17+
padding: 0 0.75rem;
1518
}
1619
}

frontend/src/components/Header.css

Lines changed: 68 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,61 @@
11
.header {
22
position: sticky;
3-
top: 1.5rem;
4-
margin: 1.5rem auto;
3+
top: 1rem;
4+
margin: 1rem auto;
55
max-width: 1200px;
6-
padding: 1rem 2rem;
6+
padding: 0.75rem 1.5rem;
77
z-index: 1000;
88
border-radius: var(--radius-full) !important;
99
background: rgba(255, 255, 255, 0.03) !important;
1010
border: 1px solid rgba(255, 255, 255, 0.05) !important;
11+
width: calc(100% - 2rem);
1112
}
1213

1314
.header-content {
1415
display: flex;
1516
justify-content: space-between;
1617
align-items: center;
18+
gap: 1rem;
1719
}
1820

1921
.logo-section {
2022
display: flex;
2123
align-items: center;
22-
gap: 1rem;
24+
gap: 0.75rem;
25+
min-width: 0;
26+
/* Allow shrinking */
2327
}
2428

2529
.logo-icon {
26-
width: 42px;
27-
height: 42px;
30+
width: 38px;
31+
height: 38px;
2832
background: linear-gradient(135deg, var(--royal-blue), var(--accent-glow));
29-
border-radius: 12px;
33+
border-radius: 10px;
3034
display: flex;
3135
align-items: center;
3236
justify-content: center;
3337
color: white;
3438
box-shadow: 0 0 20px rgba(37, 99, 235, 0.4);
39+
flex-shrink: 0;
40+
}
41+
42+
.logo-icon svg {
43+
width: 24px;
44+
height: 24px;
45+
}
46+
47+
.logo-text {
48+
min-width: 0;
3549
}
3650

3751
.logo-text h1 {
38-
font-size: 1.5rem;
52+
font-size: 1.25rem;
3953
font-weight: 800;
4054
letter-spacing: -0.02em;
4155
margin: 0;
56+
white-space: nowrap;
57+
overflow: hidden;
58+
text-overflow: ellipsis;
4259
}
4360

4461
.ai-badge {
@@ -49,7 +66,7 @@
4966
}
5067

5168
.app-subtitle {
52-
font-size: 0.75rem;
69+
font-size: 0.65rem;
5370
color: var(--text-muted);
5471
font-weight: 500;
5572
text-transform: uppercase;
@@ -59,18 +76,56 @@
5976

6077
.header-nav {
6178
display: flex;
62-
gap: 0.8rem;
79+
gap: 0.5rem;
80+
}
81+
82+
.header-nav .btn {
83+
padding: 0.5rem 1rem;
84+
font-size: 0.85rem;
85+
white-space: nowrap;
86+
}
87+
88+
.header-nav .btn svg {
89+
width: 16px;
90+
height: 16px;
6391
}
6492

6593
@media (max-width: 768px) {
6694
.header {
67-
top: 1rem;
68-
padding: 0.8rem 1.2rem;
69-
margin: 1rem;
95+
top: 0.5rem;
96+
padding: 0.6rem 1rem;
97+
margin: 0.5rem auto;
7098
border-radius: var(--radius-md) !important;
99+
width: calc(100% - 1rem);
71100
}
72101

73102
.app-subtitle {
74103
display: none;
75104
}
105+
106+
.header-nav .btn span {
107+
display: none;
108+
/* Hide text, keep icons on very small screens if button text is long */
109+
}
110+
}
111+
112+
@media (max-width: 480px) {
113+
.logo-text h1 {
114+
font-size: 1.1rem;
115+
}
116+
117+
.header-nav {
118+
gap: 0.4rem;
119+
}
120+
121+
.header-nav .btn {
122+
padding: 0.5rem;
123+
min-width: 36px;
124+
height: 36px;
125+
}
126+
127+
/* Just show icons in buttons on mobile to save space */
128+
.btn-text {
129+
display: none;
130+
}
76131
}

frontend/src/components/Header.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const Header: React.FC<HeaderProps> = ({ onSchemaView, onSchemaCreate }) => {
3030
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
3131
<path d="M12 5v14M5 12h14" />
3232
</svg>
33-
Create Table
33+
<span className="btn-text">Create Table</span>
3434
</button>
3535
<button className="btn btn-secondary" onClick={onSchemaView}>
3636
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
@@ -39,7 +39,7 @@ const Header: React.FC<HeaderProps> = ({ onSchemaView, onSchemaCreate }) => {
3939
<rect x="14" y="14" width="7" height="7" rx="1" />
4040
<rect x="3" y="14" width="7" height="7" rx="1" />
4141
</svg>
42-
View Schema
42+
<span className="btn-text">View Schema</span>
4343
</button>
4444
</nav>
4545
</div>

frontend/src/components/QueryInput.css

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.query-input-container {
22
max-width: 1200px;
3-
margin: 0 auto 3rem;
3+
margin: 0 auto var(--spacing-lg);
44
padding: 3rem;
55
position: relative;
66
overflow: hidden;
@@ -82,6 +82,7 @@
8282
font-size: 0.95rem;
8383
cursor: pointer;
8484
transition: all 0.3s var(--transition);
85+
text-align: left;
8586
}
8687

8788
.example-chip:hover:not(:disabled) {
@@ -100,7 +101,35 @@
100101
font-size: 1.8rem;
101102
}
102103

104+
.section-subtitle {
105+
font-size: 1rem;
106+
margin-bottom: 1.5rem;
107+
}
108+
103109
.submit-btn {
104110
width: 100%;
111+
align-self: stretch;
112+
}
113+
114+
.example-questions {
115+
margin-top: 2rem;
116+
padding-top: 1.5rem;
117+
}
118+
119+
.example-chip {
120+
font-size: 0.85rem;
121+
width: 100%;
122+
/* Stack examples on mobile */
123+
}
124+
}
125+
126+
@media (max-width: 480px) {
127+
.section-title {
128+
font-size: 1.5rem;
129+
}
130+
131+
.textarea-field {
132+
min-height: 120px;
133+
font-size: 1rem;
105134
}
106135
}

frontend/src/components/ResultDisplay.css

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
overflow-x: auto;
3838
line-height: 1.6;
3939
position: relative;
40+
white-space: pre-wrap;
41+
/* Wrap long SQL code */
42+
word-break: break-all;
4043
}
4144

4245
.sql-code::before {
@@ -50,6 +53,11 @@
5053
letter-spacing: 0.1em;
5154
}
5255

56+
.copy-btn {
57+
padding: 0.4rem 0.8rem;
58+
font-size: 0.8rem;
59+
}
60+
5361
.explanation-text {
5462
color: var(--text-dim);
5563
font-size: 1.1rem;
@@ -70,14 +78,18 @@
7078
margin-top: 1rem;
7179
border-radius: var(--radius-sm);
7280
border: 1px solid var(--glass-border);
73-
overflow: hidden;
81+
overflow-x: auto;
82+
/* Enable horizontal scroll for table */
83+
-webkit-overflow-scrolling: touch;
7484
}
7585

7686
.results-table {
7787
width: 100%;
7888
border-collapse: collapse;
7989
font-size: 0.95rem;
8090
text-align: left;
91+
min-width: 600px;
92+
/* Force minimum width to allow scrolling on mobile */
8193
}
8294

8395
.results-table th {
@@ -86,10 +98,11 @@
8698
color: var(--text-dim);
8799
font-weight: 600;
88100
border-bottom: 1px solid var(--glass-border);
101+
white-space: nowrap;
89102
}
90103

91104
.results-table td {
92-
padding: 1.2rem 1.5rem;
105+
padding: 1rem 1.5rem;
93106
border-bottom: 1px solid rgba(255, 255, 255, 0.03);
94107
color: white;
95108
}
@@ -108,4 +121,29 @@
108121
.result-section {
109122
padding: 1.5rem;
110123
}
124+
125+
.explanation-text {
126+
font-size: 1rem;
127+
}
128+
129+
.sql-code {
130+
font-size: 0.9rem;
131+
padding: 1rem;
132+
}
133+
134+
.results-table {
135+
font-size: 0.85rem;
136+
}
137+
}
138+
139+
@media (max-width: 480px) {
140+
.section-header {
141+
flex-direction: column;
142+
align-items: flex-start;
143+
gap: 1rem;
144+
}
145+
146+
.copy-btn {
147+
width: 100%;
148+
}
111149
}

frontend/src/components/SchemaCreator.css

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
background: var(--bg-dark) !important;
44
border: 1px solid var(--primary-glow) !important;
55
box-shadow: 0 0 50px rgba(59, 130, 246, 0.2) !important;
6+
display: flex !important;
7+
flex-direction: column !important;
68
}
79

810
.creator-error {
@@ -34,12 +36,16 @@
3436
flex-direction: column;
3537
gap: 1rem;
3638
margin-bottom: 1.5rem;
39+
max-height: 40vh;
40+
overflow-y: auto;
41+
padding-right: 0.5rem;
3742
}
3843

3944
.column-row {
4045
display: flex;
4146
gap: 0.8rem;
4247
animation: slideIn 0.3s var(--transition);
48+
align-items: center;
4349
}
4450

4551
@keyframes slideIn {
@@ -70,6 +76,7 @@
7076
justify-content: center;
7177
cursor: pointer;
7278
transition: all 0.3s;
79+
flex-shrink: 0;
7380
}
7481

7582
.btn-remove:hover {
@@ -78,7 +85,35 @@
7885
}
7986

8087
.modal-footer {
81-
padding-top: 2rem;
88+
padding-top: 1.5rem;
8289
margin-top: 1rem;
8390
border-top: 1px solid var(--glass-border);
91+
}
92+
93+
@media (max-width: 600px) {
94+
.column-row {
95+
flex-wrap: wrap;
96+
/* Stack column inputs on very small screens */
97+
background: rgba(255, 255, 255, 0.03);
98+
padding: 1rem;
99+
border-radius: var(--radius-sm);
100+
position: relative;
101+
}
102+
103+
.column-row .input-field {
104+
width: 100%;
105+
}
106+
107+
.column-row .select-field {
108+
width: 100% !important;
109+
}
110+
111+
.btn-remove {
112+
position: absolute;
113+
top: -0.5rem;
114+
right: -0.5rem;
115+
width: 30px;
116+
height: 30px;
117+
border-radius: 50%;
118+
}
84119
}

0 commit comments

Comments
 (0)