From dd2aa5fe06fad253b5f889d6c64d08f603705bd2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Jun 2025 04:38:02 +0000 Subject: [PATCH 01/22] Check for enterprise plan --- src/lib/stores/billing.ts | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index e9388c8c9..05dde454f 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -28,12 +28,13 @@ import { Query } from '@appwrite.io/console'; import { derived, get, writable } from 'svelte/store'; import { headerAlert } from './headerAlert'; import { addNotification, notifications } from './notifications'; -import { organization, type Organization, type OrganizationError } from './organization'; +import { currentPlan, organization, type Organization, type OrganizationError } from './organization'; import { canSeeBilling } from './roles'; import { sdk } from './sdk'; import { user } from './user'; import BudgetLimitAlert from '$routes/(console)/organization-[organization]/budgetLimitAlert.svelte'; import TeamReadonlyAlert from '$routes/(console)/organization-[organization]/teamReadonlyAlert.svelte'; +import EnterpriseTrial from '$routes/(console)/organization-[organization]/enterpriseTrial.svelte'; export type Tier = 'tier-0' | 'tier-1' | 'tier-2' | 'auto-1' | 'cont-1' | 'ent-1'; @@ -268,6 +269,35 @@ export function isServiceLimited(serviceId: PlanServices, plan: Tier, total: num return isLimited && total >= limit && !hasUsageFees; } +export function checkForEnterpriseTrial(org: Organization) { + const remaining = calculateEnterpriseTrial(org); + console.log('remaining', remaining); + if(calculateEnterpriseTrial(org) > 0) { + headerAlert.add({ + id: 'temaEnterprieseTrial', + component: EnterpriseTrial, + show: true, + importance: 11 + }); + } +} + +export function calculateEnterpriseTrial(org: Organization) { + const endDate = new Date(org.billingNextInvoiceDate); + const startDate = new Date(org.billingCurrentInvoiceDate); + const today = new Date(); + + let diffCycle = endDate.getTime() - startDate.getTime(); + diffCycle = Math.ceil(diffCycle / (1000 * 60 * 60 * 24)) + 1; + console.log('diffCycle', diffCycle); + if (diffCycle === 15) { + const remaining = endDate.getTime() - today.getTime(); + const days = Math.ceil(remaining / (1000 * 60 * 60 * 24)) + 1; + return days; + } + return 0; +} + export function calculateTrialDay(org: Organization) { if (org?.billingPlan === BillingPlan.FREE) return false; const endDate = new Date(org?.billingStartDate); @@ -323,7 +353,7 @@ export async function checkForUsageLimit(org: Organization) { ]; const members = org.total; - const plan = get(plansInfo)?.get(org.billingPlan); + const plan = get(currentPlan); const membersOverflow = members > plan.addons.seats.limit ? members - (plan.addons.seats.limit || members) : 0; From e8ccbf2f5016a1e11494ddc1482e9c34f7f6c2a3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Jun 2025 04:48:42 +0000 Subject: [PATCH 02/22] trial banner --- src/routes/(console)/+layout.svelte | 2 + .../enterpriseTrial.svelte | 68 +++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 src/routes/(console)/organization-[organization]/enterpriseTrial.svelte diff --git a/src/routes/(console)/+layout.svelte b/src/routes/(console)/+layout.svelte index 9d7a72d6d..3c04881a9 100644 --- a/src/routes/(console)/+layout.svelte +++ b/src/routes/(console)/+layout.svelte @@ -13,6 +13,7 @@ import Create from './createOrganization.svelte'; import { calculateTrialDay, + checkForEnterpriseTrial, checkForMandate, checkForMarkedForDeletion, checkForMissingPaymentMethod, @@ -304,6 +305,7 @@ if (currentOrganizationId === org.$id) return; if (isCloud) { currentOrganizationId = org.$id; + await checkForEnterpriseTrial(org); await checkForUsageLimit(org); checkForMarkedForDeletion(org); await checkForNewDevUpgradePro(org); diff --git a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte new file mode 100644 index 000000000..8b2630249 --- /dev/null +++ b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte @@ -0,0 +1,68 @@ + + + +{#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)} + + + + Your enterprise trial expires in {remainingDays} days. + + + + + + +{/if} From a5160e0c745cdda404c02ab5be26fda418c168cc Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 8 Jun 2025 10:23:19 +0530 Subject: [PATCH 03/22] fix: show correct plan name tag/badge. --- src/lib/components/breadcrumbs.svelte | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index 0951839d8..01f8c72a2 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -12,7 +12,7 @@ import { isCloud } from '$lib/system'; import { goto } from '$app/navigation'; import { base } from '$app/paths'; - import { newOrgModal } from '$lib/stores/organization'; + import { currentPlan, newOrgModal } from '$lib/stores/organization'; import { Click, trackEvent } from '$lib/actions/analytics'; import { page } from '$app/stores'; @@ -182,6 +182,14 @@ projectsBottomSheetOpen = false; } } + + $: correctPlanName = + // the plan names are hardcoded in some cases and are not available locally, + // so we rely on the plan's source of truth - `$currentPlan` + $currentPlan && + $currentPlan?.name.toLocaleLowerCase() !== selectedOrg?.tierName.toLocaleLowerCase() + ? $currentPlan.name + : selectedOrg?.tierName; // fallback @@ -195,9 +203,9 @@ aria-label="Open organizations tab"> {selectedOrg?.name ?? 'Organization'} {#if selectedOrg?.tierName}{#if correctPlanName}{/if} + content={correctPlanName} />{/if} {:else} @@ -211,7 +219,7 @@ {selectedOrg?.name ?? 'Organization'} + > {/if} From e5a29376e6e52ddf3f53de72f4af792bb4d08462 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 8 Jun 2025 10:45:44 +0530 Subject: [PATCH 04/22] add: current plan if not one of the base plans. --- .../components/billing/planSelection.svelte | 27 +++++++++++++++++-- src/lib/constants.ts | 2 ++ src/lib/stores/billing.ts | 15 +++++++---- .../enterpriseTrial.svelte | 7 +---- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/lib/components/billing/planSelection.svelte b/src/lib/components/billing/planSelection.svelte index d2889d66f..7c1666675 100644 --- a/src/lib/components/billing/planSelection.svelte +++ b/src/lib/components/billing/planSelection.svelte @@ -1,8 +1,8 @@ @@ -72,4 +74,25 @@ {formatCurrency(scalePlan?.price ?? 0)} per month + usage + {#if !isBasePlan} + + + {#if $organization?.billingPlan === $currentPlan.$id && !isNewOrg} + + {/if} + + + {$currentPlan.desc} + + + {@const isZeroPrice = ($currentPlan?.price ?? 0) <= 0} + {@const price = formatCurrency($currentPlan?.price ?? 0)} + {isZeroPrice ? price : `${price} per month + usage`} + + + {/if} diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 067b354dd..cd9dc4364 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -530,6 +530,8 @@ export enum BillingPlan { ENTERPRISE = 'ent-1' } +export const BASE_BILLING_PLANS: string[] = [BillingPlan.FREE, BillingPlan.PRO, BillingPlan.SCALE]; + export const feedbackDowngradeOptions = [ { value: 'availableFeatures', diff --git a/src/lib/stores/billing.ts b/src/lib/stores/billing.ts index 05dde454f..38b7be72e 100644 --- a/src/lib/stores/billing.ts +++ b/src/lib/stores/billing.ts @@ -28,7 +28,12 @@ import { Query } from '@appwrite.io/console'; import { derived, get, writable } from 'svelte/store'; import { headerAlert } from './headerAlert'; import { addNotification, notifications } from './notifications'; -import { currentPlan, organization, type Organization, type OrganizationError } from './organization'; +import { + currentPlan, + organization, + type Organization, + type OrganizationError +} from './organization'; import { canSeeBilling } from './roles'; import { sdk } from './sdk'; import { user } from './user'; @@ -270,11 +275,11 @@ export function isServiceLimited(serviceId: PlanServices, plan: Tier, total: num } export function checkForEnterpriseTrial(org: Organization) { - const remaining = calculateEnterpriseTrial(org); + const remaining = calculateEnterpriseTrial(org); console.log('remaining', remaining); - if(calculateEnterpriseTrial(org) > 0) { - headerAlert.add({ - id: 'temaEnterprieseTrial', + if (calculateEnterpriseTrial(org) > 0) { + headerAlert.add({ + id: 'teamEnterpriseTrial', component: EnterpriseTrial, show: true, importance: 11 diff --git a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte index 8b2630249..75e27d112 100644 --- a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte +++ b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte @@ -55,12 +55,7 @@ Your enterprise trial expires in {remainingDays} days. - - From cc954b899bd3d1f7e9136991788b6a50329a8655 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Jun 2025 05:20:18 +0000 Subject: [PATCH 05/22] fix url --- .../organization-[organization]/enterpriseTrial.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte index 75e27d112..e7b1a05e3 100644 --- a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte +++ b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte @@ -39,7 +39,7 @@ setNavigationHeight(); }); - $: upgradeUrl = `${base}/organization-${$organization?.$id}/billing`; + $: upgradeUrl = `${base}/organization-${$organization?.$id}/change-plan`; $: remainingDays = calculateEnterpriseTrial($organization); From f65942b26690813817dae37e1ce80a570b85ab90 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 8 Jun 2025 10:53:06 +0530 Subject: [PATCH 06/22] fix: nav bar hidden under alert. --- .../enterpriseTrial.svelte | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte index e7b1a05e3..2115e72e0 100644 --- a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte +++ b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte @@ -4,46 +4,14 @@ import { organization } from '$lib/stores/organization'; import { calculateEnterpriseTrial, hideBillingHeaderRoutes } from '$lib/stores/billing'; import { base } from '$app/paths'; - - import { onDestroy, onMount } from 'svelte'; import { isTabletViewport } from '$lib/stores/viewport'; import GradientBanner from '$lib/components/billing/gradientBanner.svelte'; import { Layout, Typography } from '@appwrite.io/pink-svelte'; - let container: HTMLElement | null = null; - - function setNavigationHeight() { - const alertHeight = container ? container.getBoundingClientRect().height : 0; - const header: HTMLHeadingElement = document.querySelector('main > header'); - const sidebar: HTMLElement = document.querySelector('main > div > nav'); - const contentSection: HTMLElement = document.querySelector('main > div > section'); - - if (header) { - header.style.top = `${alertHeight}px`; - } - if (sidebar) { - sidebar.style.top = `${alertHeight + ($isTabletViewport ? 0 : header.getBoundingClientRect().height)}px`; - sidebar.style.height = `calc(100vh - (${alertHeight + ($isTabletViewport ? 0 : header.getBoundingClientRect().height)}px))`; - } - if (contentSection) { - contentSection.style.paddingBlockStart = `${alertHeight}px`; - } - } - - onMount(() => { - setNavigationHeight(); - }); - - onDestroy(() => { - container = null; - setNavigationHeight(); - }); - $: upgradeUrl = `${base}/organization-${$organization?.$id}/change-plan`; $: remainingDays = calculateEnterpriseTrial($organization); - {#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)} Date: Sun, 8 Jun 2025 12:11:25 +0530 Subject: [PATCH 07/22] add: enterprise trial banner. --- .../components/billing/gradientBanner.svelte | 66 +++++++++++----- src/lib/images/pink-background.svg | 76 +++++++++++++++++++ src/lib/stores/billing.ts | 8 +- src/routes/(console)/+layout.svelte | 2 +- .../enterpriseTrial.svelte | 53 +++++++++---- 5 files changed, 167 insertions(+), 38 deletions(-) create mode 100644 src/lib/images/pink-background.svg diff --git a/src/lib/components/billing/gradientBanner.svelte b/src/lib/components/billing/gradientBanner.svelte index 27c58ce62..86cf1d9ee 100644 --- a/src/lib/components/billing/gradientBanner.svelte +++ b/src/lib/components/billing/gradientBanner.svelte @@ -1,10 +1,13 @@ {#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)} - - + + {/if} + + From e1d0bcae7cf70c5570fe4f85f122395a4a28512c Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Jun 2025 11:03:30 +0000 Subject: [PATCH 08/22] update height --- src/lib/components/billing/gradientBanner.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/components/billing/gradientBanner.svelte b/src/lib/components/billing/gradientBanner.svelte index 86cf1d9ee..3d3698dd7 100644 --- a/src/lib/components/billing/gradientBanner.svelte +++ b/src/lib/components/billing/gradientBanner.svelte @@ -80,6 +80,7 @@ width: 100%; z-index: 100; position: fixed; + padding: 0.8rem; &.darker { background: var(--bgcolor-neutral-default); From 9454bad856cc9615e8e8082899cb0b742f6a8bf7 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 8 Jun 2025 11:45:16 +0000 Subject: [PATCH 09/22] close handler --- .../enterpriseTrial.svelte | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte index 5cc94bde5..dff0c9f84 100644 --- a/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte +++ b/src/routes/(console)/organization-[organization]/enterpriseTrial.svelte @@ -6,13 +6,22 @@ import { base } from '$app/paths'; import GradientBanner from '$lib/components/billing/gradientBanner.svelte'; import { Badge, Typography } from '@appwrite.io/pink-svelte'; + import { activeHeaderAlert } from '../store'; $: upgradeUrl = `${base}/organization-${$organization?.$id}/change-plan`; $: remainingDays = calculateEnterpriseTrial($organization); + + let show = true; + + function handleClose() { + show = false; + const now = new Date().getTime(); + localStorage.setItem($activeHeaderAlert.id, now.toString()); + } -{#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)} - +{#if $organization?.$id && remainingDays > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname) && show} + Date: Tue, 10 Jun 2025 17:42:40 -0700 Subject: [PATCH 18/22] fix: Fix Flutter web platform creation Use `hostname` instead of `key` for Flutter web platform creation. --- .../overview/platforms/createFlutter.svelte | 50 +++++++++++++------ 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte index 59460df7e..8d0aa74df 100644 --- a/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte +++ b/src/routes/(console)/project-[region]-[project]/overview/platforms/createFlutter.svelte @@ -115,9 +115,11 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg projectId, platform, $createPlatform.name, - $createPlatform.key || undefined, + platform === PlatformType.Flutterweb ? undefined : $createPlatform.key || undefined, undefined, - undefined + platform === PlatformType.Flutterweb + ? $createPlatform.hostname || undefined + : undefined ); isPlatformCreated = true; @@ -189,19 +191,35 @@ static const String APPWRITE_PUBLIC_ENDPOINT = "${sdk.forProject(page.params.reg bind:value={$createPlatform.name} /> - - - - - {placeholder[platform].tooltip} - - - + {#if platform === PlatformType.Flutterweb} + + + + + {placeholder[platform].tooltip} + + + + {:else} + + + + + {placeholder[platform].tooltip} + + + + {/if} - {/if} - - + + {#if $canWriteCollections} + + {/if} + {#if data.collections.total} {#if data.view === 'grid'} diff --git a/src/routes/(console)/project-[region]-[project]/messaging/+page.svelte b/src/routes/(console)/project-[region]-[project]/messaging/+page.svelte index 0ed4c8b4c..12821a0bf 100644 --- a/src/routes/(console)/project-[region]-[project]/messaging/+page.svelte +++ b/src/routes/(console)/project-[region]-[project]/messaging/+page.svelte @@ -1,19 +1,11 @@ - - - - - - - - {#if $canWriteMessages} - - {/if} - - + + {#if $canWriteMessages} + + {/if} + {#if data.messages.total} import { page } from '$app/state'; import { Button } from '$lib/elements/forms'; - import { - Empty, - EmptySearch, - SearchQuery, - PaginationWithLimit, - EmptyFilter, - ViewSelector - } from '$lib/components'; + import { Empty, EmptySearch, PaginationWithLimit, EmptyFilter } from '$lib/components'; import Create from './create.svelte'; import { goto } from '$app/navigation'; - import { Container } from '$lib/layout'; + import { Container, ResponsiveContainerHeader } from '$lib/layout'; import { base } from '$app/paths'; import type { Models } from '@appwrite.io/console'; import type { PageData } from './$types'; import { showCreate } from './store'; - import { Filters, hasPageQueries } from '$lib/components/filters'; + import { hasPageQueries } from '$lib/components/filters'; import Table from './table.svelte'; import type { Column } from '$lib/helpers/types'; import { writable } from 'svelte/store'; import { canWriteTopics } from '$lib/stores/roles'; - import { Icon, Layout } from '@appwrite.io/pink-svelte'; + import { Icon } from '@appwrite.io/pink-svelte'; import { View } from '$lib/helpers/load'; import { IconPlus } from '@appwrite.io/pink-icons-svelte'; import { Click, trackEvent } from '$lib/actions/analytics'; @@ -72,26 +65,26 @@ - - - - - - - - {#if $canWriteTopics} - - {/if} - - + + {#if $canWriteTopics} + + {/if} + {#if data.topics.total} From e25f8d11f371eb3bbf6d14db4c188f8b5c53be6c Mon Sep 17 00:00:00 2001 From: ernstmul Date: Thu, 12 Jun 2025 10:30:18 +0200 Subject: [PATCH 21/22] fix popover overflowing page --- package.json | 2 +- pnpm-lock.yaml | 19 ++++---- src/lib/components/columnSelector.svelte | 56 ++++++++++++++++-------- 3 files changed, 48 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 0fe8f5a25..6bc1eb196 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "@appwrite.io/pink-icons": "0.25.0", "@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1", "@appwrite.io/pink-legacy": "^1.0.3", - "@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@40bae6b", + "@appwrite.io/pink-svelte": "https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778", "@popperjs/core": "^2.11.8", "@sentry/sveltekit": "^8.38.0", "@stripe/stripe-js": "^3.5.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cac4e0adc..5f6146e7c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^1.0.3 version: 1.0.3 '@appwrite.io/pink-svelte': - specifier: https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@40bae6b - version: https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@40bae6b(svelte@5.25.3) + specifier: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778 + version: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778(svelte@5.25.3) '@popperjs/core': specifier: ^2.11.8 version: 2.11.8 @@ -261,8 +261,9 @@ packages: resolution: {tarball: https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@a5e5564} version: 1.8.0 - '@appwrite.io/pink-icons-svelte@2.0.0-RC.1': - resolution: {integrity: sha512-iLFlV55hj8mGuAbmxJGenxN5RaZMmVT4GJb9dv/MP1xBAtYibFq7JvBcxm18qV2KU8c31Rntf+Ub4GL7HwqTYg==} + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870} + version: 2.0.0-RC.1 peerDependencies: svelte: ^4.0.0 @@ -281,8 +282,8 @@ packages: '@appwrite.io/pink-legacy@1.0.3': resolution: {integrity: sha512-GGde5fmPhs+s6/3aFeMPc/kKADG/gTFkYQSy6oBN8pK0y0XNCLrZZgBv+EBbdhwdtqVEWXa0X85Mv9w7jcIlwQ==} - '@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@40bae6b': - resolution: {tarball: https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@40bae6b} + '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778': + resolution: {tarball: https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778} version: 2.0.0-RC.2 peerDependencies: svelte: ^4.0.0 @@ -3637,7 +3638,7 @@ snapshots: '@appwrite.io/console@https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@a5e5564': {} - '@appwrite.io/pink-icons-svelte@2.0.0-RC.1(svelte@5.25.3)': + '@appwrite.io/pink-icons-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870(svelte@5.25.3)': dependencies: svelte: 5.25.3 @@ -3654,9 +3655,9 @@ snapshots: '@appwrite.io/pink-icons': 1.0.0 the-new-css-reset: 1.11.3 - '@appwrite.io/pink-svelte@https://pkg.vc/-/@appwrite/%40appwrite.io%2Fpink-svelte@40bae6b(svelte@5.25.3)': + '@appwrite.io/pink-svelte@https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-svelte@ee1b778(svelte@5.25.3)': dependencies: - '@appwrite.io/pink-icons-svelte': 2.0.0-RC.1(svelte@5.25.3) + '@appwrite.io/pink-icons-svelte': https://pkg.pr.new/appwrite/pink/@appwrite.io/pink-icons-svelte@ee1b7788cd3f877c9aa1b6487976bd63a6196870(svelte@5.25.3) '@floating-ui/dom': 1.6.13 '@melt-ui/pp': 0.3.2(@melt-ui/svelte@0.86.6(svelte@5.25.3))(svelte@5.25.3) '@melt-ui/svelte': 0.86.6(svelte@5.25.3) diff --git a/src/lib/components/columnSelector.svelte b/src/lib/components/columnSelector.svelte index 37c1640ad..c113d5e9c 100644 --- a/src/lib/components/columnSelector.svelte +++ b/src/lib/components/columnSelector.svelte @@ -18,6 +18,19 @@ children: Snippet<[toggle: () => void, selectedColumnsNumber: number]>; } = $props(); + let maxHeight = $state('none'); + let containerRef; + + const calcMaxHeight = () => { + if (containerRef) { + // get parent row element for correct top position + const parent = containerRef.parentElement.parentElement; + const { top } = parent.getBoundingClientRect(); + + maxHeight = `${window.innerHeight - top - 48}px`; + } + }; + onMount(async () => { if (isCustomCollection) { const prefs = preferences.getCustomCollectionColumns(page.params.collection); @@ -50,6 +63,8 @@ preferences.setColumns(columns); } }); + + calcMaxHeight(); }); let selectedColumnsNumber = $derived( @@ -61,29 +76,32 @@ ); + {#if $columns?.length} {@render children(toggle, selectedColumnsNumber)} - - {#each $columns as column} - {#if !column?.exclude} - (column.hide = !column.hide)} - disabled={allowNoColumns - ? false - : selectedColumnsNumber <= 1 && column.hide !== true}> - - (column.hide = !column.hide)} /> - {column.title} - - - {/if} - {/each} - +
+ + {#each $columns as column} + {#if !column?.exclude} + (column.hide = !column.hide)} + disabled={allowNoColumns + ? false + : selectedColumnsNumber <= 1 && column.hide !== true}> + + (column.hide = !column.hide)} /> + {column.title} + + + {/if} + {/each} + +
{/if} From 2bed634c24bbafa0b57b9b9d34db88f14dd1388d Mon Sep 17 00:00:00 2001 From: Darshan Date: Thu, 12 Jun 2025 14:11:35 +0530 Subject: [PATCH 22/22] fix: store null on onboarding. --- src/lib/stores/user.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/stores/user.ts b/src/lib/stores/user.ts index 808dd3877..496da7952 100644 --- a/src/lib/stores/user.ts +++ b/src/lib/stores/user.ts @@ -13,6 +13,10 @@ export type Account = Models.User< >; export const user = derived(page, ($page) => { - if (browser) sessionStorage.setItem('account', JSON.stringify($page.data.account)); - return $page.data.account as Account; + if ($page.data?.account) { + if (browser) { + sessionStorage.setItem('account', JSON.stringify($page.data.account)); + } + return $page.data.account as Account; + } else return null; });