Skip to content

Commit dc77e3d

Browse files
committed
Improve route list layout for mobile usability
Fixes #228 Optimize the route list view for small screens in `ViewAllRoutesModal.svelte`. * Implement CSS Flexbox/Grid for better responsiveness. * Introduce a collapsible list option for routes with many entries. * Add media queries to optimize touch-friendly interactions. * Ensure proper padding/margins to improve readability.
1 parent fa5511e commit dc77e3d

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

src/app.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,30 @@
7373
left: auto;
7474
right: 1.25rem;
7575
}
76+
77+
.collapsible-list {
78+
@apply flex flex-col;
79+
}
80+
81+
.collapsible-list__item {
82+
@apply mb-2 p-2 border border-gray-300 rounded-md;
83+
}
84+
85+
@media (max-width: 768px) {
86+
.collapsible-list__item {
87+
@apply mb-1 p-1;
88+
}
89+
}
90+
91+
@media (hover: hover) {
92+
.collapsible-list__item:hover {
93+
@apply bg-gray-100;
94+
}
95+
}
96+
97+
@media (pointer: coarse) {
98+
.collapsible-list__item {
99+
@apply p-3;
100+
}
101+
}
76102
}

src/components/routes/ViewAllRoutesModal.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
{/if}
6767
6868
{#if routes.length > 0}
69-
<div>
70-
<div class="sticky top-0">
69+
<div class="flex flex-col h-full">
70+
<div class="sticky top-0 p-2 bg-white dark:bg-black">
7171
<input
7272
type="text"
7373
placeholder={$t('search.search_for_routes')}
@@ -92,7 +92,7 @@
9292
</svg>
9393
</div>
9494
95-
<div>
95+
<div class="flex-1 overflow-y-auto p-2">
9696
{#if filteredRoutes.length > 0}
9797
{#each filteredRoutes as route}
9898
<RouteItem {route} {handleModalRouteClick} />

0 commit comments

Comments
 (0)