Skip to content

Commit 7df9254

Browse files
authored
Merge pull request #2936 from appwrite/fix-mobile-feedback-and-support
fix: mobile feedback issues
2 parents d5c68dd + d8f43d5 commit 7df9254

5 files changed

Lines changed: 77 additions & 32 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/sidebar.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
</div>
125125
</div>
126126
<div slot="middle" class="middle-container" class:icons={state === 'icons'}>
127-
{#if progressCard}
127+
{#if progressCard && project}
128128
<Tooltip placement="right" disabled={state !== 'icons'}>
129129
<a
130130
class="progress-card"

src/lib/components/support.svelte

Lines changed: 34 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,35 @@
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+
@media (max-width: 520px) {
218+
.support-premium-row {
219+
flex-direction: column;
220+
align-items: stretch;
221+
}
222+
223+
.support-hours {
224+
padding-inline-start: 0.125rem;
225+
}
226+
}
197227
</style>

src/lib/layout/shell.svelte

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import SideNavigation from '$lib/layout/navigation.svelte';
1515
import { hasOnboardingDismissed } from '$lib/helpers/onboarding';
1616
import { isSidebarOpen, noWidthTransition } from '$lib/stores/sidebar';
17-
import { page } from '$app/stores';
17+
import { page } from '$app/state';
1818
import { BillingPlanGroup, type Models } from '@appwrite.io/console';
1919
import { getSidebarState, isInDatabasesRoute, updateSidebarState } from '$lib/helpers/sidebar';
2020
import { isTabletViewport } from '$lib/stores/viewport';
@@ -25,6 +25,8 @@
2525
export let showSideNavigation = false;
2626
export let selectedProject: Models.Project = null;
2727
28+
$: activeProject = selectedProject && page.params.project ? selectedProject : null;
29+
2830
// variables
2931
let yOnMenuOpen: number;
3032
let showAccountMenu = false;
@@ -52,23 +54,21 @@
5254
}
5355
5456
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-
}
57+
if (!activeProject || hasOnboardingDismissed(activeProject.$id, $user)) return undefined;
6458
65-
return {
66-
title: 'Get started',
67-
percentage
68-
};
59+
const { platforms, pingCount } = activeProject;
60+
let percentage = 33;
61+
62+
if (platforms.length > 0 && pingCount === 0) {
63+
percentage = 66;
64+
} else if (pingCount > 0) {
65+
percentage = 100;
6966
}
7067
71-
return undefined;
68+
return {
69+
title: 'Get started',
70+
percentage
71+
};
7272
}
7373
7474
function handleResize() {
@@ -139,8 +139,9 @@
139139
// subscriptions
140140
isNewWizardStatusOpen.subscribe((value) => (showHeader = !value));
141141
142-
page.subscribe(({ url }) => {
143-
$showSubNavigation = url.searchParams.get('openNavbar') === 'true';
142+
$: {
143+
const url = page.url;
144+
showSubNavigation.set(url.searchParams.get('openNavbar') === 'true');
144145
clearTimeout(timeoutId);
145146
146147
if (url.pathname.includes('project-')) {
@@ -150,7 +151,7 @@
150151
} else {
151152
showContentTransition = false;
152153
}
153-
});
154+
}
154155
155156
// reactive blocks
156157
$: sideSize = $hasSubNavigation ? ($isNarrow ? '17rem' : '25rem') : '12.5rem';
@@ -185,17 +186,17 @@
185186
};
186187
}),
187188
188-
currentProject: selectedProject
189+
currentProject: activeProject
189190
};
190191
191192
$: state = $isSidebarOpen ? 'open' : 'closed';
192193
193-
$: subNavigation = $page.data.subNavigation;
194+
$: subNavigation = page.data.subNavigation;
194195
195196
$: shouldRenderSidebar =
196197
!$isNewWizardStatusOpen && showSideNavigation && !$showOnboardingAnimation;
197-
$: hasSidebarSpace = shouldRenderSidebar && !$isTabletViewport && !!selectedProject;
198-
$: isProjectBlocked = getIsProjectBlocked(selectedProject);
198+
$: hasSidebarSpace = shouldRenderSidebar && !$isTabletViewport && !!activeProject;
199+
$: isProjectBlocked = getIsProjectBlocked(activeProject);
199200
$: {
200201
if ($isSidebarOpen) {
201202
closeOpenDialogs();
@@ -219,6 +220,7 @@
219220
<main
220221
class:has-alert={$activeHeaderAlert?.show}
221222
class:is-open={$showSubNavigation}
223+
class:is-sidebar-open={$isSidebarOpen}
222224
class:u-hide={$wizard.show || $wizard.cover}
223225
class:is-fixed-layout={$activeHeaderAlert?.show}
224226
class:no-header={!showHeader || $showOnboardingAnimation}
@@ -230,7 +232,7 @@
230232
<div class="shell-sidebar-area" inert={isProjectBlocked || undefined}>
231233
{#if shouldRenderSidebar}
232234
<Sidebar
233-
project={selectedProject}
235+
project={activeProject}
234236
progressCard={getProgressCard()}
235237
avatar={navbarProps.avatar}
236238
bind:subNavigation
@@ -247,12 +249,12 @@
247249
<div
248250
class="content"
249251
class:has-transition={showContentTransition}
250-
class:icons-content={state === 'icons' && selectedProject}
252+
class:icons-content={state === 'icons' && activeProject}
251253
class:no-sidebar={!hasSidebarSpace}>
252254
<section class="main-content" data-test={showSideNavigation}>
253-
{#if $page.data?.header}
255+
{#if page.data?.header}
254256
<div class="layout-header">
255-
<svelte:component this={$page.data.header} />
257+
<svelte:component this={page.data.header} />
256258
</div>
257259
{/if}
258260
<slot />
@@ -278,6 +280,12 @@
278280
z-index: 20;
279281
}
280282
283+
@media (max-width: 1023px) {
284+
main.is-sidebar-open .content {
285+
pointer-events: none;
286+
}
287+
}
288+
281289
.content {
282290
width: 100%;
283291

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

Lines changed: 6 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';
@@ -43,6 +44,7 @@
4344
import { UsageRates } from '$lib/components/billing';
4445
import { canSeeProjects } from '$lib/stores/roles';
4546
import { BottomModalAlert } from '$lib/components';
47+
import { isSmallViewport } from '$lib/stores/viewport';
4648
import {
4749
IconAnnotation,
4850
IconBookOpen,
@@ -341,6 +343,10 @@
341343

342344
<Create bind:show={$newOrgModal} />
343345

346+
{#if $feedback.show && $isSmallViewport}
347+
<MobileFeedbackModal />
348+
{/if}
349+
344350
{#if $showSupportModal}
345351
<MobileSupportModal bind:show={$showSupportModal}></MobileSupportModal>
346352
{/if}

0 commit comments

Comments
 (0)