Skip to content

Commit e796dfe

Browse files
waleedlatif1claude
andauthored
chore(templates): disable templates page and related UI (#3690)
* chore(templates): disable templates page and related UI * chore(templates): remove unused imports from disabled template code * fix(config): restore noNestedComponentDefinitions rule in biome config * chore(templates): comment out remaining dead template code Comment out handleTemplateFormSubmit, handleTemplateDelete, TemplateStatusBadge component, and TemplateProfile dynamic import that were left over after disabling the templates feature. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore(templates): clean up dead code from review feedback - Remove unused usePathname/pathnameRef in use-workspace-management.ts - Comment out stale 'template' from TabView union type - Remove unused params from TemplateLayoutProps interface Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1eb85dd commit e796dfe

File tree

17 files changed

+395
-615
lines changed

17 files changed

+395
-615
lines changed

apps/sim/app/(home)/components/footer/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const PRODUCT_LINKS: FooterItem[] = [
2323

2424
const RESOURCES_LINKS: FooterItem[] = [
2525
{ label: 'Blog', href: '/blog' },
26-
{ label: 'Templates', href: '/templates' },
26+
// { label: 'Templates', href: '/templates' },
2727
{ label: 'Docs', href: 'https://docs.sim.ai', external: true },
2828
{ label: 'Careers', href: 'https://jobs.ashbyhq.com/sim', external: true },
2929
{ label: 'Changelog', href: '/changelog' },

apps/sim/app/llms.txt/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Sim lets teams create agents, workflows, knowledge bases, tables, and docs. Over
1212
## Core Pages
1313
1414
- [Homepage](${baseUrl}): Product overview, features, and pricing
15-
- [Templates](${baseUrl}/templates): Pre-built workflow templates to get started quickly
1615
- [Changelog](${baseUrl}/changelog): Product updates and release notes
1716
- [Sim Blog](${baseUrl}/blog): Announcements, insights, and guides
1817

apps/sim/app/sitemap.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
2020
url: `${baseUrl}/blog/tags`,
2121
lastModified: now,
2222
},
23-
{
24-
url: `${baseUrl}/templates`,
25-
lastModified: now,
26-
},
23+
// {
24+
// url: `${baseUrl}/templates`,
25+
// lastModified: now,
26+
// },
2727
{
2828
url: `${baseUrl}/changelog`,
2929
lastModified: now,
Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,20 @@
1-
import { db } from '@sim/db'
2-
import { permissions, workspace } from '@sim/db/schema'
3-
import { and, desc, eq } from 'drizzle-orm'
4-
import { redirect } from 'next/navigation'
5-
import { getSession } from '@/lib/auth'
1+
// import { db } from '@sim/db'
2+
// import { permissions, workspace } from '@sim/db/schema'
3+
// import { and, desc, eq } from 'drizzle-orm'
4+
// import { redirect } from 'next/navigation'
5+
// import { getSession } from '@/lib/auth'
66

7-
export const dynamic = 'force-dynamic'
8-
export const revalidate = 0
7+
// export const dynamic = 'force-dynamic'
8+
// export const revalidate = 0
99

1010
interface TemplateLayoutProps {
1111
children: React.ReactNode
12-
params: Promise<{
13-
id: string
14-
}>
1512
}
1613

1714
/**
18-
* Template detail layout (public scope).
19-
* - If user is authenticated, redirect to workspace-scoped template detail.
20-
* - Otherwise render the public template detail children.
15+
* Template detail layout (public scope) — currently disabled.
16+
* Previously redirected authenticated users to the workspace-scoped template detail.
2117
*/
22-
export default async function TemplateDetailLayout({ children, params }: TemplateLayoutProps) {
23-
const { id } = await params
24-
const session = await getSession()
25-
26-
if (session?.user?.id) {
27-
const userWorkspaces = await db
28-
.select({
29-
workspace: workspace,
30-
})
31-
.from(permissions)
32-
.innerJoin(workspace, eq(permissions.entityId, workspace.id))
33-
.where(and(eq(permissions.userId, session.user.id), eq(permissions.entityType, 'workspace')))
34-
.orderBy(desc(workspace.createdAt))
35-
.limit(1)
36-
37-
if (userWorkspaces.length > 0) {
38-
const firstWorkspace = userWorkspaces[0].workspace
39-
redirect(`/workspace/${firstWorkspace.id}/templates/${id}`)
40-
}
41-
}
42-
18+
export default function TemplateDetailLayout({ children }: TemplateLayoutProps) {
4319
return children
4420
}
Lines changed: 85 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,93 @@
1-
import { db } from '@sim/db'
2-
import { templateCreators, templates } from '@sim/db/schema'
3-
import { createLogger } from '@sim/logger'
4-
import { eq } from 'drizzle-orm'
5-
import type { Metadata } from 'next'
6-
import { getBaseUrl } from '@/lib/core/utils/urls'
7-
import TemplateDetails from '@/app/templates/[id]/template'
1+
import { notFound } from 'next/navigation'
82

9-
const logger = createLogger('TemplateMetadata')
3+
// import { db } from '@sim/db'
4+
// import { templateCreators, templates } from '@sim/db/schema'
5+
// import { createLogger } from '@sim/logger'
6+
// import { eq } from 'drizzle-orm'
7+
// import type { Metadata } from 'next'
8+
// import { getBaseUrl } from '@/lib/core/utils/urls'
9+
// import TemplateDetails from '@/app/templates/[id]/template'
1010

11-
/**
12-
* Generate dynamic metadata for template pages.
13-
* This provides OpenGraph images for social media sharing.
14-
*/
15-
export async function generateMetadata({
16-
params,
17-
}: {
18-
params: Promise<{ id: string }>
19-
}): Promise<Metadata> {
20-
const { id } = await params
21-
22-
try {
23-
const result = await db
24-
.select({
25-
template: templates,
26-
creator: templateCreators,
27-
})
28-
.from(templates)
29-
.leftJoin(templateCreators, eq(templates.creatorId, templateCreators.id))
30-
.where(eq(templates.id, id))
31-
.limit(1)
32-
33-
if (result.length === 0) {
34-
return {
35-
title: 'Template Not Found',
36-
description: 'The requested template could not be found.',
37-
}
38-
}
11+
// const logger = createLogger('TemplateMetadata')
3912

40-
const { template, creator } = result[0]
41-
const baseUrl = getBaseUrl()
42-
43-
const details = template.details as { tagline?: string; about?: string } | null
44-
const description = details?.tagline || 'AI workflow template on Sim'
45-
46-
const hasOgImage = !!template.ogImageUrl
47-
const ogImageUrl = template.ogImageUrl || `${baseUrl}/logo/primary/rounded.png`
48-
49-
return {
50-
title: template.name,
51-
description,
52-
openGraph: {
53-
title: template.name,
54-
description,
55-
type: 'website',
56-
url: `${baseUrl}/templates/${id}`,
57-
siteName: 'Sim',
58-
images: [
59-
{
60-
url: ogImageUrl,
61-
width: hasOgImage ? 1200 : 512,
62-
height: hasOgImage ? 630 : 512,
63-
alt: `${template.name} - Workflow Preview`,
64-
},
65-
],
66-
},
67-
twitter: {
68-
card: hasOgImage ? 'summary_large_image' : 'summary',
69-
title: template.name,
70-
description,
71-
images: [ogImageUrl],
72-
creator: creator?.details
73-
? ((creator.details as Record<string, unknown>).xHandle as string) || undefined
74-
: undefined,
75-
},
76-
}
77-
} catch (error) {
78-
logger.error('Failed to generate template metadata:', error)
79-
return {
80-
title: 'Template',
81-
description: 'AI workflow template on Sim',
82-
}
83-
}
84-
}
13+
// /**
14+
// * Generate dynamic metadata for template pages.
15+
// * This provides OpenGraph images for social media sharing.
16+
// */
17+
// export async function generateMetadata({
18+
// params,
19+
// }: {
20+
// params: Promise<{ id: string }>
21+
// }): Promise<Metadata> {
22+
// const { id } = await params
23+
//
24+
// try {
25+
// const result = await db
26+
// .select({
27+
// template: templates,
28+
// creator: templateCreators,
29+
// })
30+
// .from(templates)
31+
// .leftJoin(templateCreators, eq(templates.creatorId, templateCreators.id))
32+
// .where(eq(templates.id, id))
33+
// .limit(1)
34+
//
35+
// if (result.length === 0) {
36+
// return {
37+
// title: 'Template Not Found',
38+
// description: 'The requested template could not be found.',
39+
// }
40+
// }
41+
//
42+
// const { template, creator } = result[0]
43+
// const baseUrl = getBaseUrl()
44+
//
45+
// const details = template.details as { tagline?: string; about?: string } | null
46+
// const description = details?.tagline || 'AI workflow template on Sim'
47+
//
48+
// const hasOgImage = !!template.ogImageUrl
49+
// const ogImageUrl = template.ogImageUrl || `${baseUrl}/logo/primary/rounded.png`
50+
//
51+
// return {
52+
// title: template.name,
53+
// description,
54+
// openGraph: {
55+
// title: template.name,
56+
// description,
57+
// type: 'website',
58+
// url: `${baseUrl}/templates/${id}`,
59+
// siteName: 'Sim',
60+
// images: [
61+
// {
62+
// url: ogImageUrl,
63+
// width: hasOgImage ? 1200 : 512,
64+
// height: hasOgImage ? 630 : 512,
65+
// alt: `${template.name} - Workflow Preview`,
66+
// },
67+
// ],
68+
// },
69+
// twitter: {
70+
// card: hasOgImage ? 'summary_large_image' : 'summary',
71+
// title: template.name,
72+
// description,
73+
// images: [ogImageUrl],
74+
// creator: creator?.details
75+
// ? ((creator.details as Record<string, unknown>).xHandle as string) || undefined
76+
// : undefined,
77+
// },
78+
// }
79+
// } catch (error) {
80+
// logger.error('Failed to generate template metadata:', error)
81+
// return {
82+
// title: 'Template',
83+
// description: 'AI workflow template on Sim',
84+
// }
85+
// }
86+
// }
8587

8688
/**
87-
* Public template detail page for unauthenticated users.
88-
* Authenticated-user redirect is handled in templates/[id]/layout.tsx.
89+
* Public template detail page — currently disabled, returns 404.
8990
*/
9091
export default function TemplatePage() {
91-
return <TemplateDetails />
92+
notFound()
9293
}

0 commit comments

Comments
 (0)