Skip to content

Commit 47d914c

Browse files
committed
Improve mobile layout and panel responsiveness
Allow content to expand and enable page scrolling on mobile by overriding fixed height and overflow constraints. Stack panels vertically, reset child panel sizing, and uncap inner CLI areas for improved visibility. Hide explicit select buttons under 768px to simplify interactions and save space.
1 parent 5f7395e commit 47d914c

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

src/lib/components/Layout.svelte

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,49 @@
156156
}
157157
158158
@media (max-width: 768px) {
159+
/* Panels should expand with content on mobile */
160+
.frosted-panel {
161+
overflow: visible;
162+
}
163+
/* Allow the page to scroll on mobile; don't lock to viewport height */
164+
.desktop-container {
165+
height: auto;
166+
min-height: 100vh;
167+
overflow: auto;
168+
}
169+
159170
.main-layout {
160171
flex-direction: column;
161172
gap: 8px;
173+
height: auto !important; /* override inline height */
174+
min-height: 0;
162175
}
163176
.left-column {
164177
width: 100%;
165-
flex-direction: row;
166-
height: 40%;
178+
flex-direction: column; /* stack panels vertically on mobile */
179+
height: auto;
167180
gap: 8px;
168181
}
182+
/* Reset child panel sizing constraints for mobile */
183+
.left-column .guardian-panel,
184+
.left-column .pet-panel {
185+
min-height: unset;
186+
max-height: unset;
187+
height: auto;
188+
}
189+
/* Let the viewport take remaining vertical space */
169190
.viewport-column {
170-
height: 60%;
191+
flex: 1 1 auto;
192+
min-height: 0;
193+
/* ensure it's visible even if content is short */
194+
/* height will expand with content; page scrolls */
195+
}
196+
197+
/* Uncap inner CLI areas so content is visible on mobile */
198+
:global(.guardian-panel .cli-content),
199+
:global(.pet-panel .cli-content) {
200+
max-height: none !important;
201+
overflow: visible;
171202
}
172203
}
173204
</style>

src/lib/components/panels/PetPanel.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@
504504
: 'y'}
505505
</span>
506506
<div class="ml-2 flex items-center gap-2">
507-
<button class="arrow-btn" onclick={() => selectPet(pet.id)}>select</button>
507+
<button class="arrow-btn btn-select" onclick={() => selectPet(pet.id)}>select</button>
508508
<button class="arrow-btn" onclick={() => archivePet(pet.id)}>archive</button>
509509
</div>
510510
</div>
@@ -610,4 +610,11 @@
610610
border-color: var(--petalytics-accent);
611611
box-shadow: 0 0 0 2px color-mix(in oklab, var(--petalytics-accent) 35%, transparent);
612612
}
613+
614+
/* Mobile: hide explicit select button to save space; row click selects */
615+
@media (max-width: 768px) {
616+
.btn-select {
617+
display: none;
618+
}
619+
}
613620
</style>

0 commit comments

Comments
 (0)