From a93e64a8dba83697ee1c7593a6ff9d16f5a005b2 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Mon, 7 Sep 2026 17:00:33 -0300 Subject: [PATCH] Clear the vue-tsc baseline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Six type errors had been sitting in the baseline. Four were mechanical: PostPlatformMetrics bound stroke as a number, and @tabler/icons-vue types that prop as a string. Every other icon in the app passes stroke-width as a plain attribute, so these two now match. useWebhookLogs passed preserveScroll to router.reload. Inertia declares ReloadOptions as VisitOptions minus preserveScroll and preserveState precisely because a reload always keeps both, so the option never did anything. Connect.vue read form.errors.connect from a useForm({}). The connect error comes from StoreWelcomeConnectRequest's withValidator, not from a field, so it reads from usePageErrors — where the platform settings panels already read the errors that have no matching form field. The last two needed a type, not a cast. FormDataConvertible accepts records and arrays recursively; the only thing it cannot take is unknown. What source_meta actually holds is strings, numbers and lists of strings, so it says that now, and the gallery's private copy of the field imports the type instead of redeclaring it. Moving where Connect.vue reads its error had nothing covering it — the backend asserts the error three times, the page not once. The button is disabled until an account connects, so the error only surfaces when the account disappears between load and submit, which is what the new browser test does. Closes #337 --- .../js/components/assets/GalleryBrowser.vue | 3 ++- .../components/posts/PostPlatformMetrics.vue | 4 +-- resources/js/composables/useWebhookLogs.ts | 2 +- resources/js/pages/welcome/Connect.vue | 6 ++++- resources/js/types/media.ts | 4 ++- tests/Browser/WelcomeConnectTest.php | 27 +++++++++++++++++++ 6 files changed, 40 insertions(+), 6 deletions(-) diff --git a/resources/js/components/assets/GalleryBrowser.vue b/resources/js/components/assets/GalleryBrowser.vue index 150afdd45..1e79e4706 100644 --- a/resources/js/components/assets/GalleryBrowser.vue +++ b/resources/js/components/assets/GalleryBrowser.vue @@ -19,6 +19,7 @@ import { destroy as assetsDestroy, search as assetsSearch, storeChunked as asset import { search as giphySearch, trending as giphyTrending } from '@/routes/app/assets/giphy'; import { search as unsplashSearch, trending as unsplashTrending } from '@/routes/app/assets/unsplash'; import { store as storePost } from '@/routes/app/posts'; +import type { SourceMetaValue } from '@/types/media'; import { uploadChunked } from '@/utils/chunkedUpload'; interface AssetMedia { @@ -74,7 +75,7 @@ interface PickedMedia { size?: number; meta?: { width?: number; height?: number; duration?: number }; source?: 'ai' | 'unsplash' | 'giphy'; - source_meta?: Record; + source_meta?: Record; } const props = defineProps<{ diff --git a/resources/js/components/posts/PostPlatformMetrics.vue b/resources/js/components/posts/PostPlatformMetrics.vue index 385105d78..eb778529b 100644 --- a/resources/js/components/posts/PostPlatformMetrics.vue +++ b/resources/js/components/posts/PostPlatformMetrics.vue @@ -110,7 +110,7 @@ onMounted(async () => { - + {{ formatNumberCompact(subscribers.value) }} @@ -126,7 +126,7 @@ onMounted(async () => { - + {{ formatNumberCompact(comments.value) }} diff --git a/resources/js/composables/useWebhookLogs.ts b/resources/js/composables/useWebhookLogs.ts index 38fe39d7c..b01f00ac5 100644 --- a/resources/js/composables/useWebhookLogs.ts +++ b/resources/js/composables/useWebhookLogs.ts @@ -82,7 +82,7 @@ export const useWebhookLogs = ( selectedLog.value = next; } - router.reload({ only: ['logs'], preserveScroll: true }); + router.reload({ only: ['logs'] }); }; useWebhookEcho(toValue(webhookId), '.webhook.log.updated', applyLogUpdate); diff --git a/resources/js/pages/welcome/Connect.vue b/resources/js/pages/welcome/Connect.vue index 30b0ac050..fd8797859 100644 --- a/resources/js/pages/welcome/Connect.vue +++ b/resources/js/pages/welcome/Connect.vue @@ -8,6 +8,7 @@ import NetworkConnectGrid, { } from '@/components/accounts/NetworkConnectGrid.vue'; import InputError from '@/components/InputError.vue'; import { Button } from '@/components/ui/button'; +import { usePageErrors } from '@/composables/usePageErrors'; import WelcomeLayout from '@/layouts/WelcomeLayout.vue'; import { store } from '@/routes/app/welcome/connect'; import { SocialAccountStatus } from '@/types/social-account-status'; @@ -19,6 +20,8 @@ const props = defineProps<{ const form = useForm({}); +const errors = usePageErrors(); + const hasConnectedAccount = computed((): boolean => props.accounts.some( (account) => account.status === SocialAccountStatus.Connected, @@ -53,7 +56,8 @@ const submit = (): void => {