Skip to content

Commit 32df519

Browse files
committed
fix: mobile feedback issues
1 parent d5c68dd commit 32df519

4 files changed

Lines changed: 77 additions & 24 deletions

File tree

src/lib/components/drop.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@
141141
bind:this={tooltip}
142142
class:u-width-full-line={fullWidth}
143143
style:--arrow-size={`${arrowSize}px`}
144-
style:z-index="21">
144+
style:z-index="21"
145+
style:pointer-events={show ? 'auto' : 'none'}>
145146
<div
146147
class="drop-arrow"
147148
class:is-popover={isPopover}

src/lib/components/support.svelte

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
</div>
8989

9090
{#if option.showSupport}
91-
<div class="u-flex u-gap-12 u-cross-center">
91+
<div class="support-premium-row">
9292
{#if !hasPremiumSupport}
9393
<Button
9494
href={upgradeURL}
@@ -113,14 +113,13 @@
113113
</Button>
114114
{/if}
115115

116-
<div class="u-flex u-gap-6 u-cross-center">
116+
<div class="support-hours">
117117
<span
118118
aria-hidden="true"
119119
class="{isSupportOnline()
120120
? 'icon-check-circle u-color-text-success'
121121
: 'icon-x-circle'} u-padding-block-end-1"></span>
122-
123-
{supportTimings}
122+
<span class="support-hours-text">{supportTimings}</span>
124123
</div>
125124
</div>
126125
{:else}
@@ -194,4 +193,39 @@
194193
/* override required due to the card's background color */
195194
background: var(--bgcolor-neutral-default, #fafafb) !important;
196195
}
196+
197+
.support-premium-row {
198+
display: flex;
199+
flex-wrap: wrap;
200+
align-items: center;
201+
gap: 0.75rem 1rem;
202+
}
203+
204+
.support-hours {
205+
display: flex;
206+
align-items: center;
207+
gap: 0.375rem;
208+
min-width: 0;
209+
}
210+
211+
.support-hours-text {
212+
font-size: var(--font-size-xs, 0.75rem);
213+
line-height: 1.35;
214+
color: var(--fgcolor-neutral-secondary, #56565c);
215+
}
216+
217+
:global(.theme-dark) .support-hours-text {
218+
color: var(--fgcolor-neutral-secondary, #a0a0a8);
219+
}
220+
221+
@media (max-width: 520px) {
222+
.support-premium-row {
223+
flex-direction: column;
224+
align-items: stretch;
225+
}
226+
227+
.support-hours {
228+
padding-inline-start: 0.125rem;
229+
}
230+
}
197231
</style>

src/lib/layout/shell.svelte

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
export let showSideNavigation = false;
2626
export let selectedProject: Models.Project = null;
2727
28+
/** Only treat `page.data.project` as active outside project routes (e.g. account, org) it can linger. */
29+
$: activeProject =
30+
selectedProject &&
31+
($page.route.id?.includes('project-[region]-[project]') ||
32+
$page.url.pathname.includes('/project-'))
33+
? selectedProject
34+
: null;
35+
2836
// variables
2937
let yOnMenuOpen: number;
3038
let showAccountMenu = false;
@@ -52,23 +60,21 @@
5260
}
5361
5462
function getProgressCard() {
55-
if (selectedProject && !hasOnboardingDismissed(selectedProject.$id, $user)) {
56-
const { platforms, pingCount } = selectedProject;
57-
let percentage = 33;
58-
59-
if (platforms.length > 0 && pingCount === 0) {
60-
percentage = 66;
61-
} else if (pingCount > 0) {
62-
percentage = 100;
63-
}
63+
if (!activeProject || hasOnboardingDismissed(activeProject.$id, $user)) return undefined;
6464
65-
return {
66-
title: 'Get started',
67-
percentage
68-
};
65+
const { platforms, pingCount } = activeProject;
66+
let percentage = 33;
67+
68+
if (platforms.length > 0 && pingCount === 0) {
69+
percentage = 66;
70+
} else if (pingCount > 0) {
71+
percentage = 100;
6972
}
7073
71-
return undefined;
74+
return {
75+
title: 'Get started',
76+
percentage
77+
};
7278
}
7379
7480
function handleResize() {
@@ -185,7 +191,7 @@
185191
};
186192
}),
187193
188-
currentProject: selectedProject
194+
currentProject: activeProject
189195
};
190196
191197
$: state = $isSidebarOpen ? 'open' : 'closed';
@@ -194,8 +200,8 @@
194200
195201
$: shouldRenderSidebar =
196202
!$isNewWizardStatusOpen && showSideNavigation && !$showOnboardingAnimation;
197-
$: hasSidebarSpace = shouldRenderSidebar && !$isTabletViewport && !!selectedProject;
198-
$: isProjectBlocked = getIsProjectBlocked(selectedProject);
203+
$: hasSidebarSpace = shouldRenderSidebar && !$isTabletViewport && !!activeProject;
204+
$: isProjectBlocked = getIsProjectBlocked(activeProject);
199205
$: {
200206
if ($isSidebarOpen) {
201207
closeOpenDialogs();
@@ -219,6 +225,7 @@
219225
<main
220226
class:has-alert={$activeHeaderAlert?.show}
221227
class:is-open={$showSubNavigation}
228+
class:is-sidebar-open={$isSidebarOpen}
222229
class:u-hide={$wizard.show || $wizard.cover}
223230
class:is-fixed-layout={$activeHeaderAlert?.show}
224231
class:no-header={!showHeader || $showOnboardingAnimation}
@@ -230,7 +237,7 @@
230237
<div class="shell-sidebar-area" inert={isProjectBlocked || undefined}>
231238
{#if shouldRenderSidebar}
232239
<Sidebar
233-
project={selectedProject}
240+
project={activeProject}
234241
progressCard={getProgressCard()}
235242
avatar={navbarProps.avatar}
236243
bind:subNavigation
@@ -247,7 +254,7 @@
247254
<div
248255
class="content"
249256
class:has-transition={showContentTransition}
250-
class:icons-content={state === 'icons' && selectedProject}
257+
class:icons-content={state === 'icons' && activeProject}
251258
class:no-sidebar={!hasSidebarSpace}>
252259
<section class="main-content" data-test={showSideNavigation}>
253260
{#if $page.data?.header}
@@ -278,6 +285,12 @@
278285
z-index: 20;
279286
}
280287
288+
@media (max-width: 1023px) {
289+
main.is-sidebar-open .content {
290+
pointer-events: none;
291+
}
292+
}
293+
281294
.content {
282295
width: 100%;
283296

src/routes/(console)/+layout.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import { feedback } from '$lib/stores/feedback';
3535
import { hasStripePublicKey, isCloud, VARS } from '$lib/system';
3636
import { stripe } from '$lib/stores/stripe';
37+
import MobileFeedbackModal from './wizard/feedback/mobileFeedbackModal.svelte';
3738
import MobileSupportModal from './wizard/support/mobileSupportModal.svelte';
3839
import { showSupportModal } from './wizard/support/store';
3940
import { activeHeaderAlert, consoleVariables } from './store';
@@ -341,6 +342,10 @@
341342

342343
<Create bind:show={$newOrgModal} />
343344

345+
{#if $feedback.show}
346+
<MobileFeedbackModal />
347+
{/if}
348+
344349
{#if $showSupportModal}
345350
<MobileSupportModal bind:show={$showSupportModal}></MobileSupportModal>
346351
{/if}

0 commit comments

Comments
 (0)