From de30de7b2f205eb78f336671b1dda6ffd2f226a3 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 2 Dec 2024 12:31:15 +0530 Subject: [PATCH 1/7] fix: autofocus on conditional inputs. --- .../components/billing/selectPaymentMethod.svelte | 1 + src/lib/elements/forms/inputNumber.svelte | 10 ++++++++-- .../billing/addCreditModal.svelte | 7 ++++++- .../billing/budgetCap.svelte | 1 + .../auth/security/updatePasswordHistory.svelte | 10 ++++++++++ .../auth/security/updateUsersLimit.svelte | 12 +++++++++++- 6 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/lib/components/billing/selectPaymentMethod.svelte b/src/lib/components/billing/selectPaymentMethod.svelte index 937d6bc67..8e82a806e 100644 --- a/src/lib/components/billing/selectPaymentMethod.svelte +++ b/src/lib/components/billing/selectPaymentMethod.svelte @@ -140,6 +140,7 @@ diff --git a/src/lib/elements/forms/inputNumber.svelte b/src/lib/elements/forms/inputNumber.svelte index 97835384e..dc3613644 100644 --- a/src/lib/elements/forms/inputNumber.svelte +++ b/src/lib/elements/forms/inputNumber.svelte @@ -24,11 +24,17 @@ let error: string; onMount(() => { - if (element && autofocus) { - element.focus(); + if (autofocus) { + addInputFocus(); } }); + export function addInputFocus() { + if (element) { + element.focus(); + } + } + const handleInvalid = (event: Event) => { event.preventDefault(); diff --git a/src/routes/(console)/organization-[organization]/billing/addCreditModal.svelte b/src/routes/(console)/organization-[organization]/billing/addCreditModal.svelte index f0bb10ba9..4a66d6797 100644 --- a/src/routes/(console)/organization-[organization]/billing/addCreditModal.svelte +++ b/src/routes/(console)/organization-[organization]/billing/addCreditModal.svelte @@ -40,7 +40,12 @@ Apply Appwrite credits to your organization. - + diff --git a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte index e76bcd2ed..c6b0d00fe 100644 --- a/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte +++ b/src/routes/(console)/organization-[organization]/billing/budgetCap.svelte @@ -84,6 +84,7 @@ {/if} diff --git a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte index a308e9962..82209e2bb 100644 --- a/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updatePasswordHistory.svelte @@ -8,6 +8,7 @@ import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; + import { tick } from 'svelte'; let passwordHistory = $project?.authPasswordHistory < 1 ? 5 : $project?.authPasswordHistory; let passwordHistoryEnabled = ($project?.authPasswordHistory ?? 0) !== 0; @@ -34,6 +35,14 @@ trackError(error, Submit.AuthPasswordHistoryUpdate); } } + + let maxSessionInputField: InputNumber | null = null; + + $: if (passwordHistoryEnabled && maxSessionInputField) { + tick().then(() => { + maxSessionInputField.addInputFocus(); + }); + }
@@ -59,6 +68,7 @@ min={1} id="max-session" label="Limit" + bind:this={maxSessionInputField} disabled={!passwordHistoryEnabled} bind:value={passwordHistory} /> diff --git a/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte b/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte index 6f67ceae0..367216783 100644 --- a/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte +++ b/src/routes/(console)/project-[project]/auth/security/updateUsersLimit.svelte @@ -9,6 +9,7 @@ import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; import { project } from '../../store'; + import { tick } from 'svelte'; let isLimited = $project?.authLimit !== 0; let newLimit = isLimited ? $project?.authLimit : 100; @@ -41,6 +42,14 @@ trackError(error, Submit.AuthLimitUpdate); } } + + let maxUsersInputField: HTMLInputElement | null = null; + + $: if (isLimited && maxUsersInputField) { + tick().then(() => { + maxUsersInputField.focus(); + }); + } @@ -96,7 +105,8 @@ class="input-text" max="10000" disabled={!isLimited} - bind:value={newLimit} /> + bind:value={newLimit} + bind:this={maxUsersInputField} /> From b5f737646fd11b88b845ff25b51a02a95aac0cf3 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 2 Dec 2024 12:31:32 +0530 Subject: [PATCH 2/7] fix: equality checks. --- .../messaging/message-[message]/emailMessage.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte b/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte index 6fcaad6d4..fc897c398 100644 --- a/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte +++ b/src/routes/(console)/project-[project]/messaging/message-[message]/emailMessage.svelte @@ -63,7 +63,7 @@ - +
Message
@@ -72,12 +72,12 @@ From c7d7f08a8515198b64d014bc21a3f6d91ba6db54 Mon Sep 17 00:00:00 2001 From: Darshan Date: Mon, 2 Dec 2024 12:31:54 +0530 Subject: [PATCH 3/7] fix: missing custom id. --- .../messaging/wizard/emailFormList.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte b/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte index 693d209fb..fd6bd9a02 100644 --- a/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte +++ b/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte @@ -10,7 +10,7 @@ InputTextarea } from '$lib/elements/forms'; import { Pill } from '$lib/elements'; - import { Modal } from '$lib/components'; + import { CustomId, Modal } from '$lib/components'; import { user } from '$lib/stores/user'; import { clickOnEnter } from '$lib/helpers/a11y'; import { ID, MessagingProviderType } from '@appwrite.io/console'; @@ -113,5 +113,11 @@ Message ID + {:else} + {/if} From 61e27bd947f5ecc78927a1fcc73674dd0b8b5ff8 Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 10 Dec 2024 11:01:23 +0530 Subject: [PATCH 4/7] add: autofocus to custom ids. --- .../wizards/functions/steps/functionConfiguration.svelte | 1 + src/lib/wizards/functions/steps/manualDetails.svelte | 1 + .../wizards/functions/steps/templateConfiguration.svelte | 1 + src/routes/(console)/createOrganization.svelte | 2 +- src/routes/(console)/onboarding/+page.svelte | 7 ++++++- .../organization-[organization]/createProject.svelte | 2 +- .../organization-[organization]/wizard/step1.svelte | 1 + .../(console)/project-[project]/auth/createTeam.svelte | 2 +- .../(console)/project-[project]/auth/createUser.svelte | 2 +- .../document-[document]/attributeForm.svelte | 2 +- .../databases/database-[database]/createCollection.svelte | 2 +- .../project-[project]/functions/wizard/step1.svelte | 1 + .../project-[project]/messaging/topics/create.svelte | 2 +- .../messaging/wizard/emailFormList.svelte | 1 + .../storage/bucket-[bucket]/create-file/step1.svelte | 2 +- .../(console)/project-[project]/storage/create.svelte | 2 +- 16 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/lib/wizards/functions/steps/functionConfiguration.svelte b/src/lib/wizards/functions/steps/functionConfiguration.svelte index 02ae93868..cafa196af 100644 --- a/src/lib/wizards/functions/steps/functionConfiguration.svelte +++ b/src/lib/wizards/functions/steps/functionConfiguration.svelte @@ -71,6 +71,7 @@ {:else} {:else} {:else} {:else} - + {/if} diff --git a/src/routes/(console)/onboarding/+page.svelte b/src/routes/(console)/onboarding/+page.svelte index e714c1a5a..40515ff1f 100644 --- a/src/routes/(console)/onboarding/+page.svelte +++ b/src/routes/(console)/onboarding/+page.svelte @@ -125,7 +125,12 @@ {:else} - + {/if} {#if isCloud}
diff --git a/src/routes/(console)/organization-[organization]/createProject.svelte b/src/routes/(console)/organization-[organization]/createProject.svelte index 85bccc0f0..8638642ac 100644 --- a/src/routes/(console)/organization-[organization]/createProject.svelte +++ b/src/routes/(console)/organization-[organization]/createProject.svelte @@ -61,7 +61,7 @@
{:else} - + {/if} diff --git a/src/routes/(console)/organization-[organization]/wizard/step1.svelte b/src/routes/(console)/organization-[organization]/wizard/step1.svelte index acbf98651..331a27fc3 100644 --- a/src/routes/(console)/organization-[organization]/wizard/step1.svelte +++ b/src/routes/(console)/organization-[organization]/wizard/step1.svelte @@ -31,6 +31,7 @@ {:else} {:else} - + {/if} diff --git a/src/routes/(console)/project-[project]/auth/createUser.svelte b/src/routes/(console)/project-[project]/auth/createUser.svelte index cd8e57a7f..e123e3f03 100644 --- a/src/routes/(console)/project-[project]/auth/createUser.svelte +++ b/src/routes/(console)/project-[project]/auth/createUser.svelte @@ -84,7 +84,7 @@ {:else} - + {/if} diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeForm.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeForm.svelte index 53b239306..d8b6f4354 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeForm.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/collection-[collection]/document-[document]/attributeForm.svelte @@ -29,7 +29,7 @@ {:else} - + {/if} {/if} diff --git a/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte b/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte index 88d7e040d..26e5991d8 100644 --- a/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte +++ b/src/routes/(console)/project-[project]/databases/database-[database]/createCollection.svelte @@ -71,10 +71,10 @@ {:else} {/if} diff --git a/src/routes/(console)/project-[project]/functions/wizard/step1.svelte b/src/routes/(console)/project-[project]/functions/wizard/step1.svelte index 26b97c118..d8c08dd1e 100644 --- a/src/routes/(console)/project-[project]/functions/wizard/step1.svelte +++ b/src/routes/(console)/project-[project]/functions/wizard/step1.svelte @@ -52,6 +52,7 @@ {:else} {:else} - + {/if} diff --git a/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte b/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte index fd6bd9a02..b4568b02d 100644 --- a/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte +++ b/src/routes/(console)/project-[project]/messaging/wizard/emailFormList.svelte @@ -115,6 +115,7 @@ {:else} {:else}
- +
{/if} diff --git a/src/routes/(console)/project-[project]/storage/create.svelte b/src/routes/(console)/project-[project]/storage/create.svelte index a8b4643d4..c2b128226 100644 --- a/src/routes/(console)/project-[project]/storage/create.svelte +++ b/src/routes/(console)/project-[project]/storage/create.svelte @@ -63,7 +63,7 @@ {:else} - + {/if} From b5d6620e406c3c5375de05a9c2db559fa07784ce Mon Sep 17 00:00:00 2001 From: Darshan Date: Thu, 12 Dec 2024 12:08:54 +0530 Subject: [PATCH 5/7] ci: empty commit From 411847f439e5867097aad918dd49bd27e562d63d Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 15 Dec 2024 18:44:05 +0530 Subject: [PATCH 6/7] fix: markdown and styles in ai assistant. --- package.json | 2 + pnpm-lock.yaml | 28 ++++++++++++ src/lib/commandCenter/panels/ai.svelte | 59 +++++++++++++++++++++++--- 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ca116f366..f189113b9 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "plausible-tracker": "^0.3.9", "pretty-bytes": "^6.1.1", "prismjs": "^1.29.0", + "remarkable": "^2.0.1", "svelte-confetti": "^1.4.0", "tippy.js": "^6.3.7" }, @@ -52,6 +53,7 @@ "@testing-library/user-event": "^14.5.2", "@types/deep-equal": "^1.0.4", "@types/prismjs": "^1.26.5", + "@types/remarkable": "^2.0.8", "@typescript-eslint/eslint-plugin": "^7.18.0", "@typescript-eslint/parser": "^7.18.0", "@vitest/ui": "^1.6.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e107684f4..627a97cc9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -59,6 +59,9 @@ importers: prismjs: specifier: ^1.29.0 version: 1.29.0 + remarkable: + specifier: ^2.0.1 + version: 2.0.1 svelte-confetti: specifier: ^1.4.0 version: 1.4.0(svelte@4.2.19) @@ -102,6 +105,9 @@ importers: '@types/prismjs': specifier: ^1.26.5 version: 1.26.5 + '@types/remarkable': + specifier: ^2.0.8 + version: 2.0.8 '@typescript-eslint/eslint-plugin': specifier: ^7.18.0 version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3) @@ -1327,6 +1333,9 @@ packages: '@types/pug@2.0.10': resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==} + '@types/remarkable@2.0.8': + resolution: {integrity: sha512-eKXqPZfpQl1kOADjdKchHrp2gwn9qMnGXhH/AtZe0UrklzhGJkawJo/Y/D0AlWcdWoWamFNIum8+/nkAISQVGg==} + '@types/shimmer@1.2.0': resolution: {integrity: sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==} @@ -1559,6 +1568,9 @@ packages: asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + autolinker@3.16.2: + resolution: {integrity: sha512-JiYl7j2Z19F9NdTmirENSUUIIL/9MytEWtmzhfmsKPCp9E+G35Y0UNCMoM9tFigxT59qSc8Ml2dlZXOCVTYwuA==} + available-typed-arrays@1.0.7: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} @@ -3062,6 +3074,11 @@ packages: resolution: {integrity: sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==} engines: {node: '>= 0.4'} + remarkable@2.0.1: + resolution: {integrity: sha512-YJyMcOH5lrR+kZdmB0aJJ4+93bEojRZ1HGDn9Eagu6ibg7aVZhc3OWbbShRid+Q5eAfsEqWxpe+g5W5nYNfNiA==} + engines: {node: '>= 6.0.0'} + hasBin: true + require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -5143,6 +5160,8 @@ snapshots: '@types/pug@2.0.10': {} + '@types/remarkable@2.0.8': {} + '@types/shimmer@1.2.0': {} '@types/stack-utils@2.0.3': {} @@ -5435,6 +5454,10 @@ snapshots: asynckit@0.4.0: {} + autolinker@3.16.2: + dependencies: + tslib: 2.8.1 + available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.0.0 @@ -7144,6 +7167,11 @@ snapshots: es-errors: 1.3.0 set-function-name: 2.0.2 + remarkable@2.0.1: + dependencies: + argparse: 1.0.10 + autolinker: 3.16.2 + require-directory@2.1.1: {} require-in-the-middle@7.4.0: diff --git a/src/lib/commandCenter/panels/ai.svelte b/src/lib/commandCenter/panels/ai.svelte index d64c93e51..da09311f7 100644 --- a/src/lib/commandCenter/panels/ai.svelte +++ b/src/lib/commandCenter/panels/ai.svelte @@ -1,6 +1,9 @@