Skip to content

Commit 9d07ebd

Browse files
committed
chore(settings): strip non-TSDoc inline comments from touched files
Remove JSX label comments, section/explanatory // comments, separator block comments, and copilot's commented-out MCP scaffold across the migrated files, per the repo's no-non-TSDoc-comments standard. TSDoc and functional directives kept. Comment-only deletions — no code or behavior changed.
1 parent 8c700d4 commit 9d07ebd

14 files changed

Lines changed: 1 addition & 138 deletions

File tree

apps/sim/app/workspace/[workspaceId]/settings/[section]/settings.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ export function SettingsPage({ section }: SettingsPageProps) {
106106
const posthog = usePostHog()
107107

108108
const isAdminRole = session?.user?.role === 'admin'
109-
// The Subscription tab was replaced by Billing; redirect legacy links there.
110109
const normalizedSection: SettingsSection =
111110
(section as string) === 'subscription' ? 'billing' : section
112111
const effectiveSection =

apps/sim/app/workspace/[workspaceId]/settings/components/api-keys/api-keys.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ export function ApiKeys() {
6262
const userPermissions = useUserPermissionsContext()
6363
const canManageWorkspaceKeys = userPermissions.canAdmin
6464

65-
// React Query hooks
6665
const {
6766
data: apiKeysData,
6867
isLoading: isLoadingKeys,
@@ -73,7 +72,6 @@ export function ApiKeys() {
7372
const deleteApiKeyMutation = useDeleteApiKey()
7473
const updateSettingsMutation = useUpdateWorkspaceApiKeySettings()
7574

76-
// Extract data from queries
7775
const workspaceKeys = apiKeysData?.workspaceKeys || []
7876
const personalKeys = apiKeysData?.personalKeys || []
7977
const conflicts = apiKeysData?.conflicts || []
@@ -82,7 +80,6 @@ export function ApiKeys() {
8280
const allowPersonalApiKeys =
8381
workspaceSettingsData?.settings?.workspace?.allowPersonalApiKeys ?? true
8482

85-
// Local UI state
8683
const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false)
8784
const [deleteKey, setDeleteKey] = useState<ApiKey | null>(null)
8885
const [showDeleteDialog, setShowDeleteDialog] = useState(false)
@@ -126,7 +123,6 @@ export function ApiKeys() {
126123
})
127124
} catch (error) {
128125
logger.error('Error deleting API key:', { error })
129-
// Refetch to restore correct state in case of error
130126
refetchApiKeys()
131127
}
132128
}
@@ -158,12 +154,10 @@ export function ApiKeys() {
158154
</Chip>
159155
}
160156
>
161-
{/* Key list */}
162157
{isLoading ? null : personalKeys.length === 0 && workspaceKeys.length === 0 ? (
163158
<SettingsEmptyState>Click "Create API Key" above to get started</SettingsEmptyState>
164159
) : (
165160
<div className='flex flex-col gap-6'>
166-
{/* Workspace section */}
167161
{!searchTerm.trim() ? (
168162
<SettingsSection label='Workspace'>
169163
{workspaceKeys.length === 0 ? (
@@ -230,7 +224,6 @@ export function ApiKeys() {
230224
</SettingsSection>
231225
) : null}
232226

233-
{/* Personal section */}
234227
{(!searchTerm.trim() || filteredPersonalKeys.length > 0) && (
235228
<SettingsSection label='Personal'>
236229
<div className='flex flex-col gap-2'>
@@ -273,7 +266,6 @@ export function ApiKeys() {
273266
</SettingsSection>
274267
)}
275268

276-
{/* Show message when search has no results across both sections */}
277269
{searchTerm.trim() &&
278270
filteredPersonalKeys.length === 0 &&
279271
filteredWorkspaceKeys.length === 0 &&
@@ -285,7 +277,6 @@ export function ApiKeys() {
285277
</div>
286278
)}
287279

288-
{/* Allow Personal API Keys Toggle */}
289280
{!isLoading && canManageWorkspaceKeys && (
290281
<Tooltip.Provider delayDuration={150}>
291282
<SettingsSection label='Permissions'>
@@ -331,7 +322,6 @@ export function ApiKeys() {
331322
)}
332323
</SettingsPanel>
333324

334-
{/* Create API Key Modal */}
335325
<CreateApiKeyModal
336326
open={isCreateDialogOpen}
337327
onOpenChange={setIsCreateDialogOpen}
@@ -342,7 +332,6 @@ export function ApiKeys() {
342332
defaultKeyType={defaultKeyType}
343333
/>
344334

345-
{/* Delete Confirmation Dialog */}
346335
<ChipConfirmModal
347336
open={showDeleteDialog}
348337
onOpenChange={(open) => {

apps/sim/app/workspace/[workspaceId]/settings/components/billing/billing.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,6 @@ export function Billing() {
389389
url: invoice.hostedInvoiceUrl ?? invoice.invoicePdf,
390390
}))
391391

392-
// Org admins (and solo users managing their own billing) can edit; everyone
393-
// else sees the same controls rendered read-only / disabled rather than hidden.
394392
const canManageBilling = permissions.canEditUsageLimit
395393
const showUsageLimit = !subscription.isFree && !subscription.isEnterprise
396394
const showOnDemand = hasUsablePaidAccess && !subscription.isEnterprise

apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok-key-manager.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ export function BYOKKeyManager(props: BYOKKeyManagerProps) {
383383
: `This key will be used for all ${editingMeta?.name} requests in this workspace. Your key is encrypted and stored securely.`}
384384
</p>
385385
<ChipModalField type='custom' title='API Key' required>
386-
{/* Hidden decoy fields to prevent browser autofill */}
387386
<input
388387
type='text'
389388
name='fakeusernameremembered'

apps/sim/app/workspace/[workspaceId]/settings/components/copilot/copilot.tsx

Lines changed: 0 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use client'
22

33
import { useMemo, useState } from 'react'
4-
// import { useParams } from 'next/navigation'
54
import { createLogger } from '@sim/logger'
65
import { formatDate } from '@sim/utils/formatting'
76
import { Plus } from 'lucide-react'
@@ -15,11 +14,9 @@ import {
1514
ChipModalFooter,
1615
ChipModalHeader,
1716
SecretReveal,
18-
// Switch,
1917
} from '@/components/emcn'
2018
import { SettingsEmptyState } from '@/app/workspace/[workspaceId]/settings/components/settings-empty-state'
2119
import { SettingsPanel } from '@/app/workspace/[workspaceId]/settings/components/settings-panel'
22-
// import { useMcpServers, useUpdateMcpServer } from '@/hooks/queries/mcp'
2320
import {
2421
type CopilotKey,
2522
useCopilotKeys,
@@ -33,29 +30,11 @@ const logger = createLogger('CopilotSettings')
3330
* Copilot Keys management component for handling API keys used with the Copilot feature.
3431
* Provides functionality to create, view, and delete copilot API keys.
3532
*/
36-
// function McpServerSkeleton() {
37-
// return (
38-
// <div className='flex items-center justify-between gap-3'>
39-
// <div className='flex min-w-0 flex-col justify-center gap-[1px]'>
40-
// <Skeleton className='h-5 w-[120px]' />
41-
// <Skeleton className='h-5 w-[80px]' />
42-
// </div>
43-
// <Skeleton className='h-5 w-[36px] rounded-full' />
44-
// </div>
45-
// )
46-
// }
47-
4833
export function Copilot() {
49-
// const params = useParams()
50-
// const workspaceId = params.workspaceId as string
51-
5234
const { data: keys = [], isLoading } = useCopilotKeys()
5335
const generateKey = useGenerateCopilotKey()
5436
const deleteKeyMutation = useDeleteCopilotKey()
5537

56-
// const { data: mcpServers = [], isLoading: mcpLoading } = useMcpServers(workspaceId)
57-
// const updateServer = useUpdateMcpServer()
58-
5938
const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false)
6039
const [newKeyName, setNewKeyName] = useState('')
6140
const [newKey, setNewKey] = useState<string | null>(null)
@@ -65,20 +44,6 @@ export function Copilot() {
6544
const [searchTerm, setSearchTerm] = useState('')
6645
const [createError, setCreateError] = useState<string | null>(null)
6746

68-
// const enabledServers = mcpServers.filter((s) => s.enabled)
69-
70-
// const handleToggleCopilot = async (serverId: string, enabled: boolean) => {
71-
// try {
72-
// await updateServer.mutateAsync({
73-
// workspaceId,
74-
// serverId,
75-
// updates: { copilotEnabled: enabled },
76-
// })
77-
// } catch (error) {
78-
// logger.error('Failed to toggle MCP server for Mothership', { error })
79-
// }
80-
// }
81-
8247
const filteredKeys = useMemo(() => {
8348
if (!searchTerm.trim()) return keys
8449
const term = searchTerm.toLowerCase()
@@ -160,42 +125,6 @@ export function Copilot() {
160125
</Chip>
161126
}
162127
>
163-
{/* MCP Tools Section — uncomment when ready to allow users to toggle MCP servers for Mothership
164-
<div className='flex flex-col gap-2'>
165-
<div className='font-medium text-sm text-[var(--text-secondary)]'>
166-
MCP Tools
167-
</div>
168-
{mcpLoading ? (
169-
<div className='flex flex-col gap-2'>
170-
<McpServerSkeleton />
171-
<McpServerSkeleton />
172-
</div>
173-
) : enabledServers.length === 0 ? (
174-
<div className='text-sm text-[var(--text-muted)]'>
175-
No MCP servers configured. Add servers in the MCP Tools tab.
176-
</div>
177-
) : (
178-
<div className='flex flex-col gap-2'>
179-
{enabledServers.map((server) => (
180-
<div key={server.id} className='flex items-center justify-between gap-3'>
181-
<div className='flex min-w-0 flex-col justify-center gap-[1px]'>
182-
<span className='truncate font-medium text-base'>{server.name}</span>
183-
<p className='truncate text-sm text-[var(--text-muted)]'>
184-
{server.toolCount ?? 0} tool{server.toolCount === 1 ? '' : 's'}
185-
</p>
186-
</div>
187-
<Switch
188-
checked={server.copilotEnabled ?? false}
189-
onCheckedChange={(checked) => handleToggleCopilot(server.id, checked)}
190-
/>
191-
</div>
192-
))}
193-
</div>
194-
)}
195-
</div>
196-
*/}
197-
198-
{/* Keys List */}
199128
{isLoading ? null : showEmptyState ? (
200129
<SettingsEmptyState>Click "Create API Key" above to get started</SettingsEmptyState>
201130
) : (
@@ -233,7 +162,6 @@ export function Copilot() {
233162
)}
234163
</SettingsPanel>
235164

236-
{/* Create API Key Dialog */}
237165
<ChipModal
238166
open={isCreateDialogOpen}
239167
onOpenChange={setIsCreateDialogOpen}
@@ -274,7 +202,6 @@ export function Copilot() {
274202
/>
275203
</ChipModal>
276204

277-
{/* New API Key Dialog */}
278205
<ChipModal
279206
open={showNewKeyDialog}
280207
onOpenChange={(open) => {
@@ -313,7 +240,6 @@ export function Copilot() {
313240
/>
314241
</ChipModal>
315242

316-
{/* Delete Confirmation Dialog */}
317243
<ChipConfirmModal
318244
open={showDeleteDialog}
319245
onOpenChange={(open) => {

apps/sim/app/workspace/[workspaceId]/settings/components/general/general.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,6 @@ export function General() {
546546
</SettingsSection>
547547
</SettingsPanel>
548548

549-
{/* Password Reset Confirmation Modal */}
550549
<ChipModal
551550
open={showResetPasswordModal}
552551
onOpenChange={setShowResetPasswordModal}

apps/sim/app/workspace/[workspaceId]/settings/components/mothership/mothership.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ export function Mothership() {
102102
return (
103103
<SettingsPanel>
104104
<div className='flex flex-col gap-6'>
105-
{/* Environment selector */}
106105
<div className='flex items-center gap-2'>
107106
<Label className='text-[var(--text-secondary)] text-sm'>Environment</Label>
108107
<ChipSelect
@@ -115,7 +114,6 @@ export function Mothership() {
115114
/>
116115
</div>
117116

118-
{/* Tab bar */}
119117
<div className='flex gap-1 border-[var(--border-secondary)] border-b pb-px'>
120118
{TABS.map((tab) => (
121119
<button
@@ -137,7 +135,6 @@ export function Mothership() {
137135
))}
138136
</div>
139137

140-
{/* Time range (shared across tabs) */}
141138
<div className='flex items-center gap-3'>
142139
<div className='flex items-center gap-2'>
143140
<Label className='text-[var(--text-secondary)] text-caption'>From</Label>
@@ -165,8 +162,6 @@ export function Mothership() {
165162
)
166163
}
167164

168-
/* ─── BYOK Tab ─── */
169-
170165
function ByokTab() {
171166
const params = useParams()
172167
const workspaceId = (params?.workspaceId as string) || ''
@@ -199,8 +194,6 @@ function ByokTab() {
199194
)
200195
}
201196

202-
/* ─── Overview Tab ─── */
203-
204197
function OverviewTab({
205198
environment,
206199
start,
@@ -223,7 +216,6 @@ function OverviewTab({
223216

224217
return (
225218
<div className='flex flex-col gap-5'>
226-
{/* Summary cards */}
227219
<div className='grid grid-cols-4 gap-3'>
228220
<StatCard
229221
label='Total Requests'
@@ -261,7 +253,6 @@ function OverviewTab({
261253
/>
262254
</div>
263255

264-
{/* User breakdown */}
265256
<SectionLabel>User Breakdown</SectionLabel>
266257
{breakdownLoading && (
267258
<div className='flex flex-col gap-2'>
@@ -307,7 +298,6 @@ function OverviewTab({
307298
</div>
308299
)}
309300

310-
{/* Recent requests */}
311301
<Divider />
312302
<SectionLabel>Recent Requests ({requests?.count ?? '…'})</SectionLabel>
313303
{requestsLoading && (
@@ -383,8 +373,6 @@ function OverviewTab({
383373
)
384374
}
385375

386-
/* ─── Licenses Tab ─── */
387-
388376
function LicensesTab({ environment }: { environment: MothershipEnv }) {
389377
const { data, isLoading, refetch } = useMothershipLicenses(environment)
390378
const generateLicense = useGenerateLicense(environment)
@@ -513,8 +501,6 @@ function LicensesTab({ environment }: { environment: MothershipEnv }) {
513501
)
514502
}
515503

516-
/* ─── Shared components ─── */
517-
518504
function StatCard({
519505
label,
520506
value,

apps/sim/app/workspace/[workspaceId]/settings/components/secrets/components/secrets-manager/secrets-manager.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,6 @@ export function SecretsManager() {
922922

923923
return (
924924
<>
925-
{/* Hidden honeypot inputs to prevent browser autofill */}
926925
<div className='hidden'>
927926
<input
928927
type='text'
@@ -982,7 +981,6 @@ export function SecretsManager() {
982981
</>
983982
}
984983
>
985-
{/* Secrets grid */}
986984
{!isLoading && (
987985
<div className='flex flex-col gap-7'>
988986
{(!searchTerm.trim() ||

apps/sim/app/workspace/[workspaceId]/settings/components/team-management/team-management.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ export function TeamManagement() {
7575

7676
const adminOrOwner = isAdminOrOwner(organization, session?.user?.email)
7777
const totalSeats = organizationBillingData?.data?.totalSeats ?? 0
78-
// Seats are consumed only by accepted members (seat count is reconciled to the
79-
// member count on accept/removal). Pending invites are surfaced separately and
80-
// do not count as used until they are accepted.
8178
const usedSeats = organizationBillingData?.data?.members?.length ?? 0
8279
const reservedSeats = organizationBillingData?.data?.usedSeats ?? 0
8380
const pendingSeats = Math.max(0, reservedSeats - usedSeats)

apps/sim/app/workspace/[workspaceId]/settings/components/workflow-mcp-servers/workflow-mcp-servers.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
6969
const updateToolMutation = useUpdateWorkflowMcpTool()
7070
const updateServerMutation = useUpdateWorkflowMcpServer()
7171

72-
// API Keys - for "Create API key" link
7372
const { data: apiKeysData } = useApiKeys(workspaceId)
7473
const { data: workspaceSettingsData } = useWorkspaceSettings(workspaceId)
7574
const userPermissions = useUserPermissionsContext()
@@ -257,7 +256,6 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
257256
return `claude mcp add "${safeName}" --url "${mcpServerUrl}" --header "X-API-Key:$SIM_API_KEY"`
258257
}
259258

260-
// Cursor supports direct URL configuration (no mcp-remote needed)
261259
if (client === 'cursor') {
262260
const cursorConfig = isPublic
263261
? { url: mcpServerUrl }
@@ -266,7 +264,6 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
266264
return JSON.stringify({ mcpServers: { [safeName]: cursorConfig } }, null, 2)
267265
}
268266

269-
// Claude Desktop and VS Code still use mcp-remote (stdio transport)
270267
const mcpRemoteArgs = isPublic
271268
? ['-y', 'mcp-remote', mcpServerUrl]
272269
: ['-y', 'mcp-remote', mcpServerUrl, '--header', 'X-API-Key:$SIM_API_KEY']

0 commit comments

Comments
 (0)