Skip to content

Commit ac46221

Browse files
Unexpected search results (#711)
Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent 733a15a commit ac46221

5 files changed

Lines changed: 34 additions & 1 deletion

File tree

app/routes/login.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { HeroSection } from '#app/components/sections/hero-section.tsx'
2727
import { Paragraph } from '#app/components/typography.tsx'
2828
import { getGenericSocialImage, images } from '#app/images.tsx'
2929
import { type RootLoaderType } from '#app/root.tsx'
30+
import { type KCDHandle } from '#app/types.ts'
3031
import { getClientSession } from '#app/utils/client.server.ts'
3132
import { ensurePrimary } from '#app/utils/litefs-js.server.ts'
3233
import { getLoginInfoSession } from '#app/utils/login.server.ts'
@@ -45,6 +46,10 @@ import { getSocialMetas } from '#app/utils/seo.ts'
4546
import { getSession, getUser } from '#app/utils/session.server.ts'
4647
import { type Route } from './+types/login'
4748

49+
export const handle: KCDHandle = {
50+
getSitemapEntries: () => null,
51+
}
52+
4853
export async function loader({ request }: Route.LoaderArgs) {
4954
const user = await getUser(request)
5055
if (user) return redirect('/me')

app/routes/me_.passkeys.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ import { type PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/ser
33
import { data as json, Form, useRevalidator } from 'react-router'
44
import { z } from 'zod'
55
import { Button } from '#app/components/button.tsx'
6+
import { type KCDHandle } from '#app/types.ts'
67
import { prisma } from '#app/utils/prisma.server.ts'
78
import { requireUser } from '#app/utils/session.server.ts'
89
import { type Route } from './+types/me_.passkeys'
910

11+
export const handle: KCDHandle = {
12+
getSitemapEntries: () => null,
13+
}
14+
1015
export async function loader({ request }: Route.LoaderArgs) {
1116
const user = await requireUser(request)
1217
const passkeys = await prisma.passkey.findMany({

app/routes/me_.password.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Field, InputError } from '#app/components/form-elements.tsx'
44
import { Grid } from '#app/components/grid.tsx'
55
import { HeaderSection } from '#app/components/sections/header-section.tsx'
66
import { Spacer } from '#app/components/spacer.tsx'
7+
import { type KCDHandle } from '#app/types.ts'
78
import { ensurePrimary } from '#app/utils/litefs-js.server.ts'
89
import {
910
getPasswordHash,
@@ -14,6 +15,10 @@ import { prisma } from '#app/utils/prisma.server.ts'
1415
import { getSession, requireUser } from '#app/utils/session.server.ts'
1516
import { type Route } from './+types/me_.password'
1617

18+
export const handle: KCDHandle = {
19+
getSitemapEntries: () => null,
20+
}
21+
1722
type ActionData =
1823
| {
1924
status: 'error'

other/semantic-search/__tests__/jsx-page-content.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ describe('jsx page content utils', () => {
5858
expect(
5959
shouldIndexJsxSitemapPath({ pathname: '/feed.json', mdxRoutes }),
6060
).toBe(false)
61+
expect(shouldIndexJsxSitemapPath({ pathname: '/login', mdxRoutes })).toBe(
62+
false,
63+
)
64+
expect(
65+
shouldIndexJsxSitemapPath({ pathname: '/me/password', mdxRoutes }),
66+
).toBe(false)
67+
expect(
68+
shouldIndexJsxSitemapPath({ pathname: '/me/passkeys', mdxRoutes }),
69+
).toBe(false)
70+
expect(shouldIndexJsxSitemapPath({ pathname: '/me', mdxRoutes })).toBe(
71+
false,
72+
)
6173
})
6274

6375
test('getJsxPageSlugFromPath and getJsxPagePathFromSlug are reversible', () => {

other/semantic-search/jsx-page-content.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ const SKIPPED_CLASS_NAMES = new Set([
3333
const SKIPPED_ROLES = new Set(['dialog', 'alert', 'status', 'navigation'])
3434
const SKIPPED_STATIC_ROUTES = new Set([
3535
'/credits',
36+
'/forgot-password',
37+
'/login',
38+
'/magic',
39+
'/me',
40+
'/reset-password',
3641
'/resume',
42+
'/signup',
3743
'/sitemap.xml',
3844
'/testimonials',
3945
])
40-
const SKIPPED_PREFIX_ROUTES = ['/blog/', '/calls/', '/chats/', '/talks/']
46+
const SKIPPED_PREFIX_ROUTES = ['/blog/', '/calls/', '/chats/', '/me/', '/talks/']
4147
const NON_HTML_EXTENSION_PATTERN = /\.[a-z0-9]+$/i
4248
const BLOCK_LEVEL_TAG_NAMES = new Set([
4349
'address',

0 commit comments

Comments
 (0)