Skip to content

Commit 394ee8b

Browse files
committed
fix(providers): order the attachment failure reason by how general the cause is
The generated-document arm was checked first, so it won over both other causes and told users two things that were not true. On an inline-strategy provider — bedrock, mistral, ollama, fireworks, litellm, vertex, kimi — there is no upload path for any file, generated or not, but the message blamed the document format and implied a plain PDF would go through. On openai or google with cloud storage unconfigured it was simply false: a generated document does take the Files API path there, and that exact file uploads fine once storage exists. The one actionable fix was hidden from the operator. A provider with no upload path cannot be helped by changing the file, and a deployment with no object storage cannot reach any upload path whatever the file is, so both now outrank the format-specific case — which is left saying only what is true of it: a signed URL points at the generation source rather than the rendered file. The formatter is unchanged. It was brute-forced over every real ceiling and three million random pairs with no collision or inversion, but the test's six ceilings all divide to exact integers, so floor, round and ceil are indistinguishable on them and the limit-side rounding was unpinned. A ceiling with a fractional remainder now covers it.
1 parent f1889ad commit 394ee8b

92 files changed

Lines changed: 171 additions & 364 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/sim/app/(auth)/components/auth-header.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react'
22

33
interface AuthHeaderProps {
44
title: string
5-
description: ReactNode
5+
description?: ReactNode
66
}
77

88
/**
@@ -15,7 +15,9 @@ export function AuthHeader({ title, description }: AuthHeaderProps) {
1515
return (
1616
<div className='space-y-1 text-center'>
1717
<h1 className='text-balance text-[32px] text-[var(--text-primary)] leading-[1.2]'>{title}</h1>
18-
<p className='text-[var(--text-muted)] text-base leading-[1.5]'>{description}</p>
18+
{description ? (
19+
<p className='text-[var(--text-muted)] text-base leading-[1.5]'>{description}</p>
20+
) : null}
1921
</div>
2022
)
2123
}

apps/sim/app/(auth)/login/login-form.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ export default function LoginPage({
359359
return (
360360
<>
361361
<div className='space-y-6'>
362-
<AuthHeader title='Sign in' description='Enter your details' />
362+
<AuthHeader title='Sign in' />
363363

364364
{showTopSSO && <SSOLoginButton callbackURL={callbackUrl} variant='primary' />}
365365

@@ -453,8 +453,7 @@ export default function LoginPage({
453453
</ChipModalHeader>
454454
<ChipModalBody>
455455
<p className='px-2 text-[var(--text-secondary)] text-sm'>
456-
Enter your email address and we'll send you a link to reset your password if your
457-
account exists.
456+
If an account exists, we'll email a reset link.
458457
</p>
459458
<ChipModalField
460459
type='email'

apps/sim/app/(auth)/reset-password/reset-password-content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function ResetPasswordContent() {
6363

6464
return (
6565
<div className='space-y-6'>
66-
<AuthHeader title='Reset your password' description='Enter a new password for your account' />
66+
<AuthHeader title='Reset your password' />
6767

6868
<SetNewPasswordForm
6969
token={token}

apps/sim/app/(auth)/signup/signup-form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ function SignupFormContent({
402402

403403
return (
404404
<div className='space-y-6'>
405-
<AuthHeader title='Create an account' description='Create an account or log in' />
405+
<AuthHeader title='Create an account' />
406406

407407
{hasOnlySSO && <SSOLoginButton callbackURL={redirectUrl || '/workspace'} variant='primary' />}
408408

apps/sim/app/(auth)/verify/verify-content.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function VerificationForm({
7070
title={isVerified ? 'Email Verified' : 'Verify your email'}
7171
description={
7272
isVerified
73-
? 'Your email has been verified. Redirecting to dashboard...'
73+
? 'Redirecting'
7474
: !isEmailVerificationEnabled
7575
? 'Email verification is disabled. Redirecting to dashboard...'
7676
: hasEmailService
@@ -84,10 +84,11 @@ function VerificationForm({
8484
{!isVerified && isEmailVerificationEnabled && (
8585
<div className='space-y-6'>
8686
<div className='space-y-5'>
87-
<p className='text-center text-[var(--text-muted)] text-sm'>
88-
Enter the 6-digit code to verify your account.
89-
{hasEmailService ? " If you don't see it in your inbox, check your spam folder." : ''}
90-
</p>
87+
{hasEmailService && (
88+
<p className='text-center text-[var(--text-muted)] text-sm'>
89+
If you don't see it, check your spam folder.
90+
</p>
91+
)}
9192

9293
<div className='flex justify-center'>
9394
<InputOTP maxLength={6} value={otp} onChange={handleOtpChange} disabled={isLoading}>

apps/sim/app/desktop/components/desktop-handoff-shell/desktop-handoff-shell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { LogoShell } from '@/app/(landing)/components'
33

44
interface DesktopHandoffShellProps {
55
title: string
6-
description: ReactNode
6+
description?: ReactNode
77
/** Optional action row (a Chip CTA). Omitted on terminal, no-action screens. */
88
children?: ReactNode
99
}
@@ -24,7 +24,7 @@ export function DesktopHandoffShell({ title, description, children }: DesktopHan
2424
<h1 className='text-balance text-[40px] text-[var(--text-primary)] leading-[110%] tracking-[-0.02em]'>
2525
{title}
2626
</h1>
27-
<p className='text-[var(--text-muted)] text-lg'>{description}</p>
27+
{description ? <p className='text-[var(--text-muted)] text-lg'>{description}</p> : null}
2828
{children ? <div className='mt-3 flex items-center gap-2'>{children}</div> : null}
2929
</div>
3030
</LogoShell>

apps/sim/app/desktop/connect/connect-launcher.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,5 @@ export function ConnectLauncher({ providerId, completePath }: ConnectLauncherPro
5757
)
5858
}
5959

60-
return (
61-
<DesktopHandoffShell
62-
title='Connecting your account'
63-
description='Taking you to the provider to authorize Sim…'
64-
/>
65-
)
60+
return <DesktopHandoffShell title='Connecting your account' />
6661
}

apps/sim/app/invite/[id]/invite.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,6 @@ export default function Invite() {
324324
<InviteStatusCard
325325
type='login'
326326
title="You've been invited!"
327-
description={
328-
isNewUser
329-
? 'Create an account to join this workspace on Sim'
330-
: 'Sign in to your account to accept this invitation'
331-
}
332327
icon='userPlus'
333328
actions={[
334329
...(isNewUser
@@ -369,7 +364,7 @@ export default function Invite() {
369364
if (isLoading || isPending) {
370365
return (
371366
<InviteLayout>
372-
<InviteStatusCard type='loading' title='' description='Loading invitation...' />
367+
<InviteStatusCard type='loading' title='' />
373368
</InviteLayout>
374369
)
375370
}

apps/sim/app/invite/components/status-card.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { AUTH_BUTTON_CLASS } from '@/app/(auth)/components/constants'
77
interface InviteStatusCardProps {
88
type: 'login' | 'loading' | 'error' | 'success' | 'invitation' | 'warning'
99
title: string
10-
description: string | React.ReactNode
10+
description?: string | React.ReactNode
1111
icon?: 'userPlus' | 'mail' | 'users' | 'error' | 'success' | 'warning'
1212
actions?: Array<{
1313
label: string
@@ -37,7 +37,9 @@ export function InviteStatusCard({
3737
<h1 className='font-[500] text-[32px] text-[var(--text-primary)] tracking-tight'>
3838
Loading
3939
</h1>
40-
<p className='font-[380] text-[var(--text-muted)]'>{description}</p>
40+
{description ? (
41+
<p className='font-[380] text-[var(--text-muted)]'>{description}</p>
42+
) : null}
4143
</div>
4244
<div className='mt-8 flex w-full items-center justify-center py-8'>
4345
<Loader className='size-8 text-[var(--text-muted)]' animate />
@@ -52,7 +54,7 @@ export function InviteStatusCard({
5254
<h1 className='font-[500] text-[32px] text-[var(--text-primary)] tracking-tight'>
5355
{title}
5456
</h1>
55-
<p className='font-[380] text-[var(--text-muted)]'>{description}</p>
57+
{description ? <p className='font-[380] text-[var(--text-muted)]'>{description}</p> : null}
5658
</div>
5759

5860
<div className='mt-8 w-full max-w-[410px] space-y-3'>

apps/sim/app/organization/[organizationId]/settings/[section]/page.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ export default async function OrganizationSettingsSectionPage({
4848
if (!parsed) notFound()
4949

5050
const canOpen = await canOpenOrganizationSettingsSection(organizationId, session.user.id, parsed)
51-
if (!canOpen) return <SettingsUnavailable embedded />
51+
if (!canOpen)
52+
return (
53+
<SettingsUnavailable
54+
embedded
55+
description='You do not have access to manage this organization. Contact an organization owner or admin for help.'
56+
/>
57+
)
5258
const hasEnterprisePlan =
5359
parsed !== 'members' &&
5460
parsed !== 'billing' &&
@@ -59,13 +65,7 @@ export default async function OrganizationSettingsSectionPage({
5965
getOrganizationSettingsFeatures(hasEnterprisePlan)
6066
)
6167
) {
62-
return (
63-
<SettingsUnavailable
64-
embedded
65-
title='Setting unavailable'
66-
description='This setting is not enabled for this organization.'
67-
/>
68-
)
68+
return <SettingsUnavailable embedded title='Setting unavailable' />
6969
}
7070

7171
return <OrganizationSettingsRenderer organizationId={organizationId} section={parsed} />

0 commit comments

Comments
 (0)