Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/server/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import { LoadErrorCard } from '../components/actionUi'
* expose in the URL) renders the dashboard right here, unchanged.
*/
export const Route = createFileRoute('/')({
ssr: false,
// `?template=<name>` deep-links from the public market (`/templates`): it rides through
// the gated redirect and preselects the compose modal (see DashboardView.openTemplate).
validateSearch: (s: Record<string, unknown>): { template?: string } => ({
template: typeof s.template === 'string' && s.template ? s.template : undefined,
}),
loaderDeps: ({ search }) => ({ template: search.template }),
ssr: false,
loader: async ({ deps }): Promise<{ mode: 'signin' | 'dashboard'; auth: { enabled: boolean }; initial?: DashboardData }> => {
const auth = await getAuthState()
if (auth.enabled) {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/onboarding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import { LoadErrorCard } from '../components/actionUi'
* from the URL), falling back to the default. Open mode renders with no team segment.
*/
export const Route = createFileRoute('/onboarding')({
ssr: false,
validateSearch: (search: Record<string, unknown>): { team?: string } => {
const team = typeof search.team === 'string' ? search.team.trim() : ''
return team ? { team } : {}
},
loaderDeps: ({ search }) => ({ team: search.team }),
ssr: false,
loader: async ({
deps,
}): Promise<{
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/t.$teamId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import { LoadErrorCard } from '../components/actionUi'
* single shared workspace.
*/
export const Route = createFileRoute('/t/$teamId')({
ssr: false,
// `?template=<name>` is forwarded from `/` (the public-market deep link) and preselects
// the compose modal on this team's dashboard.
validateSearch: (s: Record<string, unknown>): { template?: string } => ({
template: typeof s.template === 'string' && s.template ? s.template : undefined,
}),
ssr: false,
loader: async ({
params,
}): Promise<{ mode: 'signin' | 'dashboard'; auth: { enabled: boolean }; teamId: string; initial?: DashboardData }> => {
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/routes/templates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type { BundleView } from '../types'
* the SEO meta. The interactive bits (category filter, copy buttons) hydrate as usual.
*/
export const Route = createFileRoute('/templates')({
loader: async (): Promise<{ bundles: BundleView[] }> => ({ bundles: await listPublicBundles() }),
head: () => ({
meta: [
{ title: 'Loopany templates — agent loops that actually work' },
Expand All @@ -31,7 +32,6 @@ export const Route = createFileRoute('/templates')({
},
],
}),
loader: async (): Promise<{ bundles: BundleView[] }> => ({ bundles: await listPublicBundles() }),
component: TemplatesRoute,
})

Expand Down