feat: add mobile bottom sheet search with trigger bar (#985)

Replace the desktop-only Cmd+K search modal with a native-feeling
bottom sheet on mobile (<768px). Adds a fixed pill-shaped trigger
bar at the bottom of the screen, suggestion chips for quick access
to countries/commands, 48px touch targets, and slide-up animation.

Also removes the deprecated MobileWarningModal, adds a community
discussion link in settings, and improves mobile header layout.
This commit is contained in:
Elie Habib
2026-03-04 15:12:44 +04:00
committed by GitHub
parent c7942b800a
commit ea8d64a042
9 changed files with 348 additions and 43 deletions

View File

@@ -372,6 +372,14 @@ canvas,
color: var(--accent);
}
.logo-mobile {
display: none;
font-weight: bold;
font-size: 14px;
letter-spacing: 2px;
color: var(--accent);
}
.version {
font-size: 9px;
color: var(--muted);
@@ -8207,6 +8215,153 @@ a.prediction-link:hover {
margin-right: 4px;
}
/* Mobile search trigger bar — hidden on desktop */
.search-mobile-trigger {
display: none;
}
/* Mobile bottom sheet search */
.search-overlay.search-mobile {
align-items: flex-end;
padding-top: 0;
background: rgba(0, 0, 0, 0.5);
}
.search-overlay.search-mobile .search-sheet {
width: 100%;
max-height: 75vh;
background: var(--surface);
border-radius: 16px 16px 0 0;
display: flex;
flex-direction: column;
transform: translateY(100%);
transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.search-overlay.search-mobile.open .search-sheet {
transform: translateY(0);
}
.search-sheet-handle {
width: 36px;
height: 4px;
background: var(--text-dim);
opacity: 0.4;
border-radius: 2px;
margin: 8px auto;
}
.search-sheet-header {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 16px 12px;
}
.search-sheet-icon {
font-size: 16px;
}
.search-sheet-header .search-input {
flex: 1;
font-size: 15px;
background: transparent;
border: none;
color: var(--text);
font-family: inherit;
outline: none;
}
.search-sheet-cancel {
background: none;
border: none;
color: var(--accent, #4488ff);
font-size: 14px;
font-family: inherit;
cursor: pointer;
padding: 4px 8px;
white-space: nowrap;
}
.search-sheet-chips {
display: flex;
gap: 6px;
padding: 0 16px 10px;
overflow-x: auto;
scrollbar-width: none;
-ms-overflow-style: none;
}
.search-sheet-chips::-webkit-scrollbar {
display: none;
}
.search-chip {
flex-shrink: 0;
padding: 6px 14px;
border-radius: 16px;
border: 1px solid var(--border);
background: var(--bg);
color: var(--text);
font-size: 12px;
font-family: inherit;
cursor: pointer;
white-space: nowrap;
}
.search-chip:active {
background: var(--border);
}
@media (max-width: 768px) {
.search-mobile-trigger {
display: flex;
align-items: center;
gap: 10px;
position: fixed;
bottom: calc(16px + env(safe-area-inset-bottom, 0px));
left: 16px;
right: 16px;
padding: 12px 18px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 28px;
box-shadow: 0 4px 20px var(--shadow-color);
color: var(--text-dim);
font-size: 14px;
cursor: pointer;
z-index: 500;
}
.search-mobile-trigger:active {
background: var(--bg);
}
.search-btn {
display: none !important;
}
.search-overlay.search-mobile .search-results {
max-height: calc(75vh - 120px);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.search-overlay.search-mobile .search-result-item {
min-height: 48px;
padding: 12px 16px;
}
.search-overlay.search-mobile .search-result-title {
font-size: 14px;
}
.search-overlay.search-mobile .search-section-header {
font-size: 11px;
padding: 10px 16px;
}
}
/* Flight Delay Markers */
.flight-delay-marker {
position: absolute;
@@ -9838,6 +9993,7 @@ a.prediction-link:hover {
flex-direction: column;
gap: 8px;
padding: 8px;
padding-bottom: 72px;
}
body {
@@ -9989,6 +10145,30 @@ a.prediction-link:hover {
display: none !important;
}
/* Mobile: show "World Monitor" instead of "MONITOR" */
.logo {
display: none;
}
.logo-mobile {
display: inline;
}
/* Mobile: hide "Global Situation" panel title */
.map-section .panel-title {
display: none;
}
/* Mobile: hide the UTC clock */
.header-clock {
display: none !important;
}
/* Mobile: hide community discussion widget (accessible via settings) */
.community-widget {
display: none !important;
}
.focus-label {
display: none;
}
@@ -14218,6 +14398,35 @@ a.prediction-link:hover {
text-decoration: underline;
}
/* Discussion link in settings */
.us-discussion-link {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 6px;
background: var(--overlay-subtle);
border: 1px solid var(--border);
color: var(--text);
text-decoration: none;
font-size: 12px;
font-weight: 500;
transition: border-color 0.2s, background 0.2s;
}
.us-discussion-link:hover {
border-color: hsl(229, 48%, 55%);
background: rgba(99, 120, 198, 0.1);
}
.us-discussion-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: hsl(229, 48%, 55%);
flex-shrink: 0;
}
/* Footer status */
.ai-flow-popup-footer {
display: flex;