Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
9d7cca4
refactor: replace PrimeVue toast with design-system toast
ampagent Sep 25, 2026
5f3bf77
refactor: replace PrimeVue forms with zod validation
ampagent Sep 25, 2026
7c54620
fix: reconcile toast callers with current upstream
ampagent Oct 5, 2026
63c5706
test: migrate new upstream toast assertions
ampagent Oct 5, 2026
875cf0c
feat: keep legacy extension toast calls working through an adapter
DrJKL Oct 5, 2026
d02276c
fix: pass the reroute migration handler to its toast
DrJKL Oct 5, 2026
4915716
fix: show pending billing operations as loading toasts
DrJKL Oct 5, 2026
b95da05
test: assert agent toasts against the new toast fields
DrJKL Oct 5, 2026
fb726ac
refactor: render progress panels through the Toaster dock
DrJKL Oct 5, 2026
360279d
fix: spin the SDK billing progress toast like the legacy rail
DrJKL Oct 5, 2026
53fd457
test: assert toasts through one contract
DrJKL Oct 5, 2026
3538b78
test: locate toasts through ToastHelper in every spec
DrJKL Oct 5, 2026
b8201cc
refactor: import toast modules directly instead of through a barrel
DrJKL Oct 5, 2026
75aaf93
refactor: drop anchor names only the PrimeVue toast read
DrJKL Oct 5, 2026
358165a
fix: keep docked progress panels visible during node selection
DrJKL Oct 5, 2026
d56625d
refactor: brand toast ids at the store's allocation boundary
DrJKL Oct 5, 2026
7baff3e
fix: announce toasts from Toaster-owned live regions
DrJKL Oct 5, 2026
43c31fa
test: check the agent panel seam through computed style in app mode
DrJKL Oct 5, 2026
755c149
test: locate settled-subscription and manager toasts through ToastHelper
DrJKL Oct 5, 2026
d95a46f
test: locate toast text through ToastHelper now that toasts are annou…
DrJKL Oct 5, 2026
a67fc8d
docs: never locate a toast by its copy in browser tests
DrJKL Oct 5, 2026
8885b76
test: locate the remaining toast copy through ToastHelper
DrJKL Oct 5, 2026
06a9c95
fix: move toast calls main added onto the design-system toast
DrJKL Oct 6, 2026
4d4c5a6
refactor: sort keys in touched interfaces and page objects
DrJKL Oct 7, 2026
b28fd39
fix: move SSO, skill-pack and invite toasts onto the design-system toast
DrJKL Oct 7, 2026
d6553fb
refactor: replace custom toast bodies with a design-system toast action
DrJKL Oct 7, 2026
767b0b3
refactor: drop PrimeVue alert shape from warning toasts
DrJKL Oct 7, 2026
e32d49a
refactor: trim the legacy extension toast adapter to its real callers
DrJKL Oct 7, 2026
f386245
fix: wrap long words in toast titles and descriptions
DrJKL Oct 7, 2026
426306f
[automated] Update test expectations
invalid-email-address Oct 7, 2026
4ab0ef5
refactor: simplify the toast core and fix its timer and dock defects
DrJKL Oct 7, 2026
61fa51a
fix: localize toast copy and assert on real toast state
DrJKL Oct 7, 2026
c03def0
test: locate docked progress panels by test id
DrJKL Oct 7, 2026
ad45ff1
refactor: share one temp-file upload for audio, webcam and 3D captures
DrJKL Oct 7, 2026
595d270
test: align sign-in and account-switch specs with current behavior
DrJKL Oct 7, 2026
cda1a16
fix: hold toasts while picking nodes
DrJKL Oct 7, 2026
27a209e
[automated] Update test expectations
invalid-email-address Oct 7, 2026
3d08b12
refactor: build the website auth toast on Reka instead of mirroring P…
DrJKL Oct 7, 2026
1e305e3
test: route every browser-test toast query through one ToastHelper
DrJKL Oct 7, 2026
68518af
fix: move the Desktop sign-in toasts to the design-system toast
DrJKL Oct 7, 2026
9793730
refactor: drop dismiss guards for PrimeVue overlays the app no longer…
DrJKL Oct 7, 2026
7091f44
fix: keep toasts clear of the open right side panel
DrJKL Oct 7, 2026
eac0a68
fix: theme and place toasts correctly on the cloud login pages
DrJKL Oct 7, 2026
e0e5fdd
fix: keep stacked progress panels reachable on short viewports
DrJKL Oct 8, 2026
ba81ec8
refactor: let callers own a toast id instead of tracking it in mutabl…
DrJKL Oct 8, 2026
6c0a5c3
refactor: hold toasts from the node-picking actions instead of a watcher
DrJKL Oct 8, 2026
0f878bf
refactor: build the extension toast API in the workspace store
DrJKL Oct 8, 2026
17e634c
refactor: name the progress toast entry and lead the upload result wi…
DrJKL Oct 8, 2026
c9c93a7
test: render the real Toaster and assert on toast mocks directly
DrJKL Oct 8, 2026
17c64fb
fix: trim the space around the toast stack
DrJKL Oct 8, 2026
4d75fb8
refactor: move retention-offer toasts to the design-system toast
DrJKL Oct 8, 2026
8f209a9
fix: align the toast header and put actions under the message
DrJKL Oct 8, 2026
90fcd91
[automated] Update test expectations
invalid-email-address Oct 8, 2026
a44004f
[automated] Update test expectations
invalid-email-address Oct 8, 2026
cca21cb
fix: log an unsupported legacy toast severity instead of throwing
DrJKL Oct 8, 2026
e02a3c7
fix: drop a layout's toasts with it and keep description line breaks
DrJKL Oct 8, 2026
efd9751
fix(website): keep auth toasts through Escape, selectable, and timing…
DrJKL Oct 8, 2026
a0a64b7
test: pin the template progress toast and widen a checkout negative
DrJKL Oct 8, 2026
2c5f9ae
test: read the global console spy in toast tests
DrJKL Oct 8, 2026
139db35
refactor: move the light-info and duplicate-attachment toasts to the …
DrJKL Oct 8, 2026
e7a20f1
style: format the camera toast tests
DrJKL Oct 8, 2026
1371787
feat: announce progress panel start and outcome to screen readers
DrJKL Oct 8, 2026
2412070
fix: type the temp upload response from the generated contract
ampagent Oct 8, 2026
f5d2299
fix: keep line breaks in toast titles
ampagent Oct 8, 2026
75c9edd
fix: show legacy toast warning severity and report it for deprecation
ampagent Oct 8, 2026
6d4d4de
refactor: move the nothing-to-paste toast to the design-system toast
DrJKL Oct 8, 2026
634f5a2
refactor: move the agent brief and silent-copy toasts to the design-s…
DrJKL Oct 8, 2026
49ab312
test: configure the shared fetch mock in the temp-image upload test
DrJKL Oct 8, 2026
489c885
fix: restart a toast's timer when its id is reused
DrJKL Oct 8, 2026
1bd77ad
refactor: keep the cloud layouts' Toaster where main renders its toast
DrJKL Oct 9, 2026
2b4a18b
test: assert the SSO refusal shows no toast through the real store
DrJKL Oct 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .agents/checks/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ Rules:

- User-facing error messages must be actionable and friendly (per AGENTS.md)
- Use the shared `useErrorHandling` composable (`src/composables/useErrorHandling.ts`) for centralized error handling:
- `wrapWithErrorHandling` / `wrapWithErrorHandlingAsync` automatically catch errors and surface them as toast notifications via `useToastStore`
- `wrapWithErrorHandling` / `wrapWithErrorHandlingAsync` automatically catch errors and surface them as toast notifications via `useToast`
- `toastErrorHandler` can be used directly for custom error handling flows
- Supports `ErrorRecoveryStrategy` for retry/fallback patterns (e.g., reauthentication, network reconnect)
- API errors from `api.get()`/`api.post()` should be caught and surfaced to the user via `useToastStore` (`src/platform/updates/common/toastStore.ts`)
- API errors from `api.get()`/`api.post()` should be caught and surfaced to the user via `useToast` (`src/components/ui/toast/toastStore.ts`)
- Electron/desktop code paths: IPC errors should be caught and not crash the renderer process
- Workflow execution errors should be displayed in the UI status bar, not silently swallowed
1 change: 1 addition & 0 deletions .agents/checks/playwright-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Reference docs (read if you need full context):
- `comfyPage.canvasOps.resetView()` for view reset
- `test.use({ initialSettings })` for starting settings; `comfyPage.settings.setSetting()` for runtime changes under test
- Component page objects in `browser_tests/fixtures/components/`
- `comfyPage.toast` (`ToastHelper`) for toasts. Flag any `getByText` or `getByRole('alert' | 'status').filter({ hasText })` on a toast's copy: `Toaster` repeats it in a live region, so strict mode resolves two elements. Use `comfyPage.toast.withText()` or a kind locator such as `toastErrors`. Also flag raw `getByTestId('toast')` or `[data-toast-kind]` locators in specs. Tests without `comfyPage` destructure the `toast` fixture

9. **Building workflows programmatically when a JSON asset would work** — Complex `page.evaluate` chains to construct a graph should use a premade JSON workflow in `browser_tests/assets/` loaded via `comfyPage.workflow.loadWorkflow()`.

Expand Down
1 change: 1 addition & 0 deletions .agents/checks/vue-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Available shadcn-vue replacements in `src/components/ui/`:
- `stepper/` — Stepper
- `tags-input/` — TagsInput
- `search-input/` — SearchInput
- `toast/` — `useToast()` store (`success/error/info/warning/loading`), Toaster, ToastDock, ToastPanel
- `Popover.vue` — Popover

For Reka UI primitives not yet wrapped, create a new component in `src/components/ui/` following the pattern in existing components (see `src/components/ui/AGENTS.md`): use `useForwardProps`, `cn()`, design tokens.
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/reviewing-unit-tests/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ If the wrapper only renames or relays a mocked value, fail it. Inline the lookup
### Third-Party Seams

- Distinguish trivial hooks from behavior-rich APIs.
- Mocking single-method third-party hooks like `primevue/usetoast` is usually acceptable.
- Mocking single-method third-party hooks like `@vueuse/core`'s `useClipboard` is usually acceptable.
- That exception does not justify mocking behavior-rich third-party modules.

### `vue-i18n`
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/verify/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ await new Promise((resolve) => {
})
```

At 0 frames, Vue transitions never finish. A removed PrimeVue toast keeps its DOM node with `p-toast-message-leave-active` at opacity 0, and a new one sticks at `p-toast-message-enter-from`, so DOM queries report toasts a real user never sees. In that case assert on component state instead. Walk `el.__vueParentComponent` up to the component whose `type.name` is `Toast` and read `proxy.messages`. A 2026-09-21 run filed a false "verify toast stays after the top-up settles" finding this way.
At 0 frames, Vue transitions never finish, so DOM queries can report elements a real user never sees, such as a dialog stuck mid-leave. For toasts, assert on the store instead: `document.querySelector('#vue-app').__vue_app__.config.globalProperties.$pinia._s.get('toast').toasts` is the list the Toaster renders. A 2026-09-21 run filed a false "verify toast stays after the top-up settles" finding from DOM queries in a hidden tab.

## Drive

Expand Down
6 changes: 6 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,12 @@
"name": "@playwright/test",
"importNames": ["test"],
"message": "Use `comfyPageFixture as test` from the ComfyPage fixture module instead of raw `test` from '@playwright/test'."
},
{
"name": "@e2e/fixtures/helpers/ToastHelper",
"importNames": ["ToastHelper"],
"allowTypeImports": true,
"message": "Use `comfyPage.toast`, or the `toast` fixture in tests without `comfyPage`, instead of constructing a ToastHelper."
}
],
"patterns": [
Expand Down
2 changes: 0 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import type { Preview, StoryContext, StoryFn } from '@storybook/vue3-vite'
import { createPinia } from 'pinia'
import 'primeicons/primeicons.css'
import PrimeVue from 'primevue/config'
import ToastService from 'primevue/toastservice'
import Tooltip from 'primevue/tooltip'

import { i18n } from '@/i18n'
Expand Down Expand Up @@ -43,7 +42,6 @@ setup((app) => {
}
}
})
app.use(ToastService)
})

// Theme and dialog decorator
Expand Down
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,49 @@ https://github.com/user-attachments/assets/5696a89d-4a47-4fcc-9e8c-71e1264943f2

### Developer APIs

<details id='extension-api-toast-kinds'>
<summary>v1.58: Kind-based toast API</summary>

`app.extensionManager.toast` has `success`, `error`, `info`, `warning`, and
`loading`. Each takes `(title, { description, duration, closable, action })`
and returns an id for `dismiss(id)`. `dismissAll()` removes every toast.

```js
const toast = app.extensionManager.toast

toast.info('Loaded!', { description: 'Extension loaded!', duration: 3000 })

const toastId = toast.warning('Model missing', {
action: {
label: 'Download',
onClick: () => {
startDownload()
toast.dismiss(toastId)
}
}
})
```

A toast stays open until dismissed unless `duration` (ms) is set. Clicking an
`action` button does not dismiss the toast.

`add()` and `addAlert()` still work but are deprecated. `addAlert(message)` now
shows `message` as the warning title, like `warning(message)`. `remove()` and
`removeAll()` were removed; use `dismiss(id)` or `dismissAll()`.

`add()` maps the PrimeVue message fields onto the new API and ignores every
other field:

| `add()` field | New API |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `severity` | kind: `warn` → `warning` (`warning` also works but is deprecated); `success`, `error` unchanged; `info`, `secondary`, `contrast` → `info`; any other value logs an error and shows nothing |
| `summary` | `title` (`detail` becomes the title when `summary` is missing) |
| `detail` | `description` |
| `life` | `duration` in ms; `0` or unset keeps the toast open |
| `closable` | `closable` |

</details>

<details>
<summary>v1.6.13: prompt/confirm/alert replacements for ComfyUI desktop</summary>

Expand Down Expand Up @@ -472,7 +515,9 @@ app.extensionManager.toast.add({
})
```

Documentation of all supported options can be found here: <https://primevue.org/toast/#api.toast.interfaces.ToastMessageOptions>
Only `severity`, `summary`, `detail`, `life` and `closable` are honoured; see the field mapping under the [kind-based toast API](#extension-api-toast-kinds).

Deprecated in v1.58 by the [kind-based toast API](#extension-api-toast-kinds).

![image](https://github.com/user-attachments/assets/de02cd7e-cd81-43d1-a0b0-bccef92ff487)

Expand Down
4 changes: 4 additions & 0 deletions apps/website/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Use `test` from `./fixtures/blockExternalMedia`, not `@playwright/test`.
Use its `page` and `context`. Set user-agent variants with scoped `test.use`
options instead of creating browser contexts.

Find an auth toast with `new AuthToasts(page).withText(...)` from
`./fixtures/authToasts`, never `page.getByText` on its copy: a screen-reader
live region repeats that copy.

## No external requests

Register test-specific `context.route` responses before navigation. They override
Expand Down
17 changes: 10 additions & 7 deletions apps/website/e2e/auth-live-errors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { expect } from '@playwright/test'
import type { Page, Route } from '@playwright/test'

import { t } from '@/i18n/translations'
import { AuthToasts } from './fixtures/authToasts'
import { test } from './fixtures/blockExternalMedia'
import {
WORKSHOP_EMAIL,
Expand Down Expand Up @@ -61,7 +62,7 @@ test.describe('Live sign-in error codes', () => {
await page.getByRole('button', { name: 'Sign in', exact: true }).click()

await expect(
page.getByText('Invalid login credentials'),
new AuthToasts(page).withText('Invalid login credentials'),
'the same copy as a wrong password keeps sign-in from revealing whether an email has an account'
).toBeVisible()
})
Expand All @@ -78,7 +79,9 @@ test.describe('Live sign-in error codes', () => {
await page.getByRole('button', { name: 'Sign in', exact: true }).click()

await expect(
page.getByText('This account has been disabled. Please contact support.')
new AuthToasts(page).withText(
'This account has been disabled. Please contact support.'
)
).toBeVisible()
})

Expand All @@ -94,7 +97,7 @@ test.describe('Live sign-in error codes', () => {
await page.getByRole('button', { name: 'Sign in', exact: true }).click()

await expect(
page.getByText(
new AuthToasts(page).withText(
'Too many login attempts. Please wait a moment and try again.'
)
).toBeVisible()
Expand Down Expand Up @@ -123,7 +126,7 @@ test.describe('Live sign-in error codes', () => {
await page.getByRole('button', { name: 'Sign in', exact: true }).click()

await expect(
page.getByText(
new AuthToasts(page).withText(
'Network error. Please check your connection and try again.'
)
).toBeVisible()
Expand All @@ -148,7 +151,7 @@ test.describe('Live sign-up error codes and password checklist', () => {
await page.getByRole('button', { name: 'Sign up', exact: true }).click()

await expect(
page.getByText(
new AuthToasts(page).withText(
t('auth.errors.auth/email-already-in-use', {}, { locale: 'en' })
)
).toBeVisible()
Expand Down Expand Up @@ -234,12 +237,12 @@ test.describe('Live forgot-password transport failure', () => {
await page.getByRole('button', { name: 'Send reset link' }).click()

await expect(
page.getByText(
new AuthToasts(page).withText(
'Too many login attempts. Please wait a moment and try again.'
)
).toBeVisible()
await expect(
page.getByText('Password reset email sent'),
new AuthToasts(page).withText('Password reset email sent'),
'a rejected send is a real failure, not the neutral unregistered-email success'
).toBeHidden()
await expect(
Expand Down
11 changes: 8 additions & 3 deletions apps/website/e2e/auth-live.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { expect } from '@playwright/test'
import type { Page, Route } from '@playwright/test'

import { AuthToasts } from './fixtures/authToasts'
import { test } from './fixtures/blockExternalMedia'
import {
WORKSHOP_EMAIL,
Expand Down Expand Up @@ -76,7 +77,9 @@ test.describe('Live email sign-in', () => {
await page.getByLabel('Password', { exact: true }).fill('wrong-password')
await page.getByRole('button', { name: 'Sign in', exact: true }).click()

await expect(page.getByText('Invalid login credentials')).toBeVisible()
await expect(
new AuthToasts(page).withText('Invalid login credentials')
).toBeVisible()
await expect(page).toHaveURL(/\/login\/(?:[?#].*)?$/)
})

Expand Down Expand Up @@ -155,7 +158,9 @@ test.describe('Live forgot-password', () => {
await page.getByLabel('Email').fill(WORKSHOP_EMAIL)
await page.getByRole('button', { name: 'Send reset link' }).click()

await expect(page.getByText('Password reset email sent')).toBeVisible()
await expect(
new AuthToasts(page).withText('Password reset email sent')
).toBeVisible()
await expect(page).toHaveURL('/login/', { timeout: 10_000 })
})

Expand Down Expand Up @@ -187,7 +192,7 @@ test.describe('Live forgot-password', () => {
await page.getByRole('button', { name: 'Send reset link' }).click()

await expect(
page.getByText('Password reset email sent'),
new AuthToasts(page).withText('Password reset email sent'),
'the cloud app shows success even on this failure to avoid confirming account existence'
).toBeVisible()
})
Expand Down
13 changes: 13 additions & 0 deletions apps/website/e2e/fixtures/authToasts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Locator, Page } from '@playwright/test'

export class AuthToasts {
public readonly list: Locator

constructor(page: Page) {
this.list = page.getByRole('region', { name: /^Notifications/ })
}

withText(text: string): Locator {
return this.list.getByRole('alert').filter({ hasText: text })
}
}
24 changes: 12 additions & 12 deletions apps/website/src/components/auth/AuthForgotPassword.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, screen, waitFor } from '@testing-library/vue'
import { beforeEach, describe, expect, it, vi } from 'vitest'
import { nextTick, readonly, ref } from 'vue'

import { removeAllToasts, useAuthToasts } from '@/config/auth-toast-state'
import { dismissAllAuthToasts, useAuthToasts } from '@/config/auth-toast-state'
import { sendWorkshopPasswordReset } from '@/config/workshop-firebase'
import { captureAuthFailed, useWorkshopAuthFlag } from '@/scripts/posthog'
import AuthForgotPassword from './AuthForgotPassword.vue'
Expand All @@ -12,7 +12,7 @@ vi.mock(import('@/scripts/posthog'))
vi.mock(import('@/config/workshop-firebase'))

const flag = ref(true)
const { messages: toasts } = useAuthToasts()
const { toasts } = useAuthToasts()
const assign = vi.fn<(url: string | URL) => void>()

async function typeEmail(value: string) {
Expand All @@ -35,7 +35,7 @@ const flushMicrotasks = async () => {
beforeEach(() => {
flag.value = true
vi.mocked(useWorkshopAuthFlag).mockReturnValue(readonly(flag))
removeAllToasts()
dismissAllAuthToasts()
window.history.replaceState({}, '', '/')
vi.spyOn(window.location, 'assign').mockImplementation(assign)
})
Expand Down Expand Up @@ -71,9 +71,9 @@ describe('AuthForgotPassword', () => {
)
expect(toasts.value).toEqual([
expect.objectContaining({
severity: 'success',
summary: 'Password reset email sent',
life: 5000
kind: 'success',
title: 'Password reset email sent',
duration: 5000
})
])

Expand Down Expand Up @@ -107,7 +107,7 @@ describe('AuthForgotPassword', () => {
['auth/network-request-failed', 'Network error']
] as const)(
'keeps %s an error: no confirmation, no redirect, and the send can be retried',
async ([code, detail]) => {
async ([code, description]) => {
vi.mocked(sendWorkshopPasswordReset).mockRejectedValue({
code,
message: 'x'
Expand All @@ -118,9 +118,9 @@ describe('AuthForgotPassword', () => {

await waitFor(() =>
expect(toasts.value[0]).toMatchObject({
severity: 'error',
summary: 'Error',
detail: expect.stringContaining(detail)
kind: 'error',
title: 'Error',
description: expect.stringContaining(description)
})
)
expect(
Expand Down Expand Up @@ -150,8 +150,8 @@ describe('AuthForgotPassword', () => {

await waitFor(() =>
expect(toasts.value[0]).toMatchObject({
severity: 'warn',
summary: 'Warning'
kind: 'warning',
title: 'Warning'
})
)
})
Expand Down
18 changes: 7 additions & 11 deletions apps/website/src/components/auth/AuthForgotPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { onBeforeUnmount, onMounted, ref, watch } from 'vue'

import { authSchemasFor } from '@/config/auth-schemas'
import { signInErrorMessage } from '@/config/auth-sign-in-state'
import { addToast } from '@/config/auth-toast-state'
import { authToast } from '@/config/auth-toast-state'
import { requestedReturnPath } from '@/config/workshop-return'
import type { Locale } from '@/i18n/translations'
import { translationsFor } from '@/i18n/translations'
Expand Down Expand Up @@ -154,21 +154,17 @@ function reportSendFailure(error: unknown) {
auth_action: 'password_reset'
})
const classification = classifyAuthError(error)
const severity = severityForAuthError(classification)
addToast({
severity,
summary: t(severity === 'warn' ? 'g.warning' : 'g.error'),
detail: signInErrorMessage(classification, locale, hostname)
const kind = severityForAuthError(classification)
authToast[kind](t(`g.${kind}`), {
description: signInErrorMessage(classification, locale, hostname)
})
}

function reportSent() {
state.value = 'sent'
addToast({
severity: 'success',
summary: t('auth.forgot.toastSummary'),
detail: t('auth.forgot.toastDetail'),
life: TOAST_LIFE_MS
authToast.success(t('auth.forgot.toastSummary'), {
description: t('auth.forgot.toastDetail'),
duration: TOAST_LIFE_MS
})
returnTimer = setTimeout(() => {
window.location.assign(signInDestination())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ vi.mock(import('@/config/workshop-firebase'), () => {
})

it('leaves the buttons usable when the Firebase chunk fails to load on a click', async () => {
const { messages } = useAuthToasts()
const { toasts } = useAuthToasts()
render(AuthSignIn)
const button = screen.getByRole('button', { name: /^sign in with google$/i })
await userEvent.setup().click(button)

await waitFor(() => expect(messages.value).toHaveLength(1))
expect(messages.value[0].detail).toBe(
await waitFor(() => expect(toasts.value).toHaveLength(1))
expect(toasts.value[0].description).toBe(
t('auth.errors.generic', {}, { locale: 'en' })
)
expect(
Expand Down
Loading
Loading