Skip to content

Commit 7cb11b0

Browse files
Jonas Badaliccursoragent
andcommitted
Remove unused optional props that production never provided.
Re-ran unused-signatures --production so test-only call sites no longer keep dead optional APIs alive. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent aa17069 commit 7cb11b0

18 files changed

Lines changed: 60 additions & 185 deletions

src/auth/repositories.server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export class DrizzleUserRepository implements IUserRepository {
5555
oauthImage?: string
5656
displayUsername?: string
5757
capabilities?: Capability[]
58-
signupSources?: SignupSource[]
5958
}): Promise<DbUser> {
6059
const [newUser] = await db
6160
.insert(users)
@@ -66,7 +65,7 @@ export class DrizzleUserRepository implements IUserRepository {
6665
oauthImage: data.oauthImage,
6766
displayUsername: data.displayUsername,
6867
capabilities: data.capabilities || [],
69-
signupSources: data.signupSources ?? [],
68+
signupSources: [],
7069
})
7170
.returning()
7271

src/components/ButtonGroup.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ type SegmentedControlProps<TValue extends string> = {
5959
/** Labels the group for assistive tech (the control has no visible label). */
6060
'aria-label': string
6161
size?: SegmentSize
62-
/** Stretch to fill the container, splitting width evenly across options. */
63-
fullWidth?: boolean
6462
className?: string
6563
}
6664

@@ -79,18 +77,13 @@ export function SegmentedControl<TValue extends string>({
7977
onValueChange,
8078
'aria-label': ariaLabel,
8179
size = 'md',
82-
fullWidth = false,
8380
className,
8481
}: SegmentedControlProps<TValue>) {
8582
return (
8683
<div
8784
role="group"
8885
aria-label={ariaLabel}
89-
className={twMerge(
90-
segmentTrackClasses(size),
91-
fullWidth && 'flex w-full',
92-
className,
93-
)}
86+
className={twMerge(segmentTrackClasses(size), className)}
9487
>
9588
{options.map((option) => {
9689
const selected = value === option.value
@@ -102,11 +95,7 @@ export function SegmentedControl<TValue extends string>({
10295
aria-label={option['aria-label']}
10396
disabled={option.disabled}
10497
onClick={() => onValueChange(option.value)}
105-
className={segmentClasses(
106-
size,
107-
selected,
108-
fullWidth ? 'flex-1' : undefined,
109-
)}
98+
className={segmentClasses(size, selected)}
11099
>
111100
{option.label}
112101
</button>

src/components/Panel.tsx

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ import { twMerge } from 'tailwind-merge'
33

44
type PanelRenderProps = {
55
open: boolean
6-
orientation: 'horizontal' | 'vertical'
76
toggle: () => void
87
}
98

109
type PanelProps = {
1110
open?: boolean
1211
defaultOpen?: boolean
13-
orientation?: 'horizontal' | 'vertical'
1412
onOpenChange?: (open: boolean) => void
1513
children: React.ReactNode | ((props: PanelRenderProps) => React.ReactNode)
1614
className?: string
@@ -37,7 +35,6 @@ function usePanel() {
3735
export function Panel({
3836
open: controlledOpen,
3937
defaultOpen = false,
40-
orientation = 'vertical',
4138
onOpenChange,
4239
children,
4340
className,
@@ -59,14 +56,11 @@ export function Panel({
5956
}
6057
}, [isControlled, open, onOpenChange])
6158

62-
const value = React.useMemo(
63-
() => ({ open, orientation, toggle }),
64-
[open, orientation, toggle],
65-
)
59+
const value = React.useMemo(() => ({ open, toggle }), [open, toggle])
6660

6761
return (
6862
<PanelContext.Provider value={value}>
69-
<div className={className} data-panel data-orientation={orientation}>
63+
<div className={className} data-panel>
7064
{typeof children === 'function' ? children(value) : children}
7165
</div>
7266
</PanelContext.Provider>
@@ -107,8 +101,7 @@ export function PanelTrigger({
107101

108102
export const PanelContent = React.forwardRef<HTMLDivElement, PanelContentProps>(
109103
function PanelContent({ children, className, ...props }, ref) {
110-
const { open, orientation } = usePanel()
111-
const horizontal = orientation === 'horizontal'
104+
const { open } = usePanel()
112105

113106
return (
114107
<div
@@ -118,27 +111,12 @@ export const PanelContent = React.forwardRef<HTMLDivElement, PanelContentProps>(
118111
inert={open ? undefined : true}
119112
className={twMerge(
120113
'grid overflow-hidden duration-200 [transition-timing-function:cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none',
121-
horizontal
122-
? 'transition-[grid-template-columns]'
123-
: 'transition-[grid-template-rows]',
124-
horizontal
125-
? open
126-
? 'grid-cols-[1fr]'
127-
: 'grid-cols-[0fr]'
128-
: open
129-
? 'grid-rows-[1fr]'
130-
: 'grid-rows-[0fr]',
114+
'transition-[grid-template-rows]',
115+
open ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',
131116
className,
132117
)}
133118
>
134-
<div
135-
className={twMerge(
136-
'overflow-hidden',
137-
horizontal ? 'min-w-0' : 'min-h-0',
138-
)}
139-
>
140-
{children}
141-
</div>
119+
<div className="min-h-0 overflow-hidden">{children}</div>
142120
</div>
143121
)
144122
},

src/components/Squircle.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ function supportsNativeSquircle(): boolean {
2525
)
2626
}
2727

28-
export function useSquircleFallback(
29-
ref: React.RefObject<HTMLElement | null>,
30-
smoothing = 0.6,
31-
) {
28+
export function useSquircleFallback(ref: React.RefObject<HTMLElement | null>) {
3229
React.useEffect(() => {
3330
const el = ref.current
3431
if (!el || supportsNativeSquircle()) return
@@ -54,7 +51,7 @@ export function useSquircleFallback(
5451
el.style.clipPath = `path('${getSvgPath({
5552
width,
5653
height,
57-
cornerSmoothing: smoothing,
54+
cornerSmoothing: 0.6,
5855
...corners,
5956
})}')`
6057
}
@@ -71,20 +68,17 @@ export function useSquircleFallback(
7168
window.removeEventListener('resize', apply)
7269
el.style.clipPath = ''
7370
}
74-
}, [ref, smoothing])
71+
}, [ref])
7572
}
7673

77-
type SquircleProps = React.HTMLAttributes<HTMLDivElement> & {
78-
/** 0–1; 0.6 approximates the native `squircle` (superellipse(2)) curve. */
79-
smoothing?: number
80-
}
74+
type SquircleProps = React.HTMLAttributes<HTMLDivElement>
8175

8276
/** A `<div>` that carries a squircle shape cross-browser (see useSquircleFallback). */
8377
export const Squircle = React.forwardRef<HTMLDivElement, SquircleProps>(
84-
function Squircle({ smoothing, children, ...rest }, forwardedRef) {
78+
function Squircle({ children, ...rest }, forwardedRef) {
8579
const localRef = React.useRef<HTMLDivElement>(null)
8680
React.useImperativeHandle(forwardedRef, () => localRef.current!, [])
87-
useSquircleFallback(localRef, smoothing)
81+
useSquircleFallback(localRef)
8882
return (
8983
<div ref={localRef} {...rest}>
9084
{children}

src/components/application-builder/useApplicationBuilder.tsx

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ interface UseApplicationBuilderOptions {
5151
revealOptionsImmediately?: boolean
5252
}
5353

54-
type CopyTrigger = 'automatic' | 'user'
55-
5654
function openPendingDeployWindow(providerName: string) {
5755
const deployWindow = window.open('', '_blank')
5856

@@ -282,19 +280,15 @@ export function useApplicationBuilder({
282280
)
283281

284282
const buildDebouncedSubmittedInput = React.useCallback(
285-
(
286-
nextSelectedPartners: Array<string> = explicitlySelectedPartners,
287-
nextInferredPartners: Array<string> = [],
288-
nextSelectedLibraries: Array<LibraryId> = selectedLibraries,
289-
) =>
283+
() =>
290284
composeStarterInput({
291285
forceRouterOnly,
292-
inferredPartners: nextInferredPartners,
286+
inferredPartners: [],
293287
input: debouncedInput,
294288
migrationRepositoryUrl: debouncedMigrationRepositoryUrl,
295289
packageManager: selectedPackageManager,
296-
selectedLibraries: nextSelectedLibraries,
297-
selectedPartners: nextSelectedPartners,
290+
selectedLibraries,
291+
selectedPartners: explicitlySelectedPartners,
298292
toolchain: selectedToolchain,
299293
}),
300294
[
@@ -385,10 +379,7 @@ export function useApplicationBuilder({
385379
}, [])
386380

387381
const markCopied = React.useCallback(
388-
(
389-
kind: string,
390-
options?: { showPromptNotice?: boolean; trigger?: CopyTrigger },
391-
) => {
382+
(kind: string, options?: { showPromptNotice?: boolean }) => {
392383
setCopiedKind(kind)
393384
setTimeout(
394385
() => setCopiedKind((current) => (current === kind ? null : current)),
@@ -399,10 +390,7 @@ export function useApplicationBuilder({
399390
revealPromptCopyNotice()
400391
}
401392

402-
// Only treat user-driven copies as activation. Automatic copies that
403-
// fire as a side-effect of generation are not activation signals.
404-
const trigger = options?.trigger ?? 'user'
405-
if (trigger === 'user' && kind === 'prompt') {
393+
if (kind === 'prompt') {
406394
trackEvent('builder_activated', {
407395
...sessionContextRef.current,
408396
action: 'copy_prompt',
@@ -421,13 +409,11 @@ export function useApplicationBuilder({
421409
options?: {
422410
notify?: boolean
423411
showPromptNotice?: boolean
424-
trigger?: CopyTrigger
425412
},
426413
) => {
427414
await navigator.clipboard.writeText(value)
428415
markCopied(kind, {
429416
showPromptNotice: options?.showPromptNotice,
430-
trigger: options?.trigger,
431417
})
432418

433419
if (options?.notify === false) {

src/components/builder/BuilderWorkspace.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,16 @@ export function BuilderWorkspace() {
7676
: null
7777

7878
const applyStarterResult = useCallback(
79-
async (
80-
result: ApplicationStarterResult,
81-
options?: { silent?: boolean },
82-
) => {
79+
async (result: ApplicationStarterResult) => {
8380
if (result.recipe.target === 'router') {
84-
if (!options?.silent) {
85-
notify(
86-
<div>
87-
<div className="font-medium">Router-only stays prompt-first</div>
88-
<div className="text-xs text-gray-500 dark:text-gray-400">
89-
`/builder` remains a TanStack Start advanced surface.
90-
</div>
91-
</div>,
92-
)
93-
}
81+
notify(
82+
<div>
83+
<div className="font-medium">Router-only stays prompt-first</div>
84+
<div className="text-xs text-gray-500 dark:text-gray-400">
85+
`/builder` remains a TanStack Start advanced surface.
86+
</div>
87+
</div>,
88+
)
9489

9590
return false
9691
}

src/components/ds/ui/PartnerRail.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,13 @@ function TierHeader({ tier }: { tier: PartnerTier }) {
6363
export function PartnerRail({
6464
analyticsPlacement,
6565
partners,
66-
title = 'Partners',
67-
titleTo = '/partners',
6866
sizing,
6967
scaleOverrides,
7068
rowGaps,
7169
mode,
7270
}: {
7371
analyticsPlacement: PartnerPlacement
7472
partners: Array<RailPartner>
75-
title?: string
76-
titleTo?: '/partners'
7773
sizing?: PartnerLogoSizing
7874
scaleOverrides?: Record<string, number>
7975
/** Vertical gap (px) between logo rows, per tier — workshop hook. */
@@ -98,9 +94,9 @@ export function PartnerRail({
9894
<div className="flex w-full items-center justify-between gap-2">
9995
<Link
10096
className="text-xs font-medium opacity-60 hover:opacity-100"
101-
to={titleTo}
97+
to="/partners"
10298
>
103-
{title}
99+
Partners
104100
</Link>
105101
<a
106102
href={PARTNER_INQUIRY_HREF}

src/components/ds/ui/Tabs.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -131,33 +131,19 @@ function useTabsContext(component: string) {
131131
}
132132

133133
export function Tabs({
134-
value: controlledValue,
135134
defaultValue,
136-
onValueChange,
137135
variant = 'secondary',
138136
className,
139137
children,
140138
}: {
141-
value?: string
142139
defaultValue?: string
143-
onValueChange?: (value: string) => void
144140
/** `primary` = underline; `secondary` = segmented (default). */
145141
variant?: TabsVariant
146142
className?: string
147143
children: React.ReactNode
148144
}) {
149-
const isControlled = controlledValue !== undefined
150145
const idBase = React.useId()
151-
const [internalValue, setInternalValue] = React.useState(defaultValue ?? '')
152-
const value = controlledValue ?? internalValue
153-
154-
const setValue = React.useCallback(
155-
(next: string) => {
156-
if (!isControlled) setInternalValue(next)
157-
onValueChange?.(next)
158-
},
159-
[isControlled, onValueChange],
160-
)
146+
const [value, setValue] = React.useState(defaultValue ?? '')
161147

162148
const ctx = React.useMemo<TabsContextValue>(
163149
() => ({ value, setValue, idBase, variant }),
@@ -234,14 +220,12 @@ export function TabsList({
234220
export function TabsTrigger({
235221
value,
236222
icon,
237-
disabled,
238223
className,
239224
children,
240225
}: {
241226
value: string
242227
/** Optional leading icon node (sized by the segment). */
243228
icon?: React.ReactNode
244-
disabled?: boolean
245229
className?: string
246230
children: React.ReactNode
247231
}) {
@@ -262,7 +246,6 @@ export function TabsTrigger({
262246
aria-selected={selected}
263247
aria-controls={`${idBase}-panel-${value}`}
264248
tabIndex={selected ? 0 : -1}
265-
disabled={disabled}
266249
onClick={() => setValue(value)}
267250
className={
268251
variant === 'primary'

0 commit comments

Comments
 (0)