Skip to content

[codex] Move competition index to root#497

Merged
zacjones93 merged 8 commits into
mainfrom
codex/move-compete-index
Jun 9, 2026
Merged

[codex] Move competition index to root#497
zacjones93 merged 8 commits into
mainfrom
codex/move-compete-index

Conversation

@zacjones93

@zacjones93 zacjones93 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move the public competition discovery page from /compete to the site root /.
  • Add a /compete index redirect back to / while preserving event routes like /compete/:slug.
  • Update exact /compete browse/return links and redirects to point at /.
  • Remove /compete from the static sitemap entry and update lat.md architecture notes.
image image image image

Validation

  • PATH=/Users/ianjones/.nvm/versions/node/v24.14.1/bin:$PATH lat check passed.
  • gitnexus detect_changes was attempted twice but failed with Cannot destructure property 'package' of 'node.target' as it is null. before producing an affected-scope report.

Notes

gh auth status reports the local GitHub CLI token is invalid, so this PR was opened through the GitHub connector after pushing the branch with git.


Summary by cubic

Moved the competition discovery page to / with a /compete redirect that preserves filters. Fixed the navigation shell to prevent flashes and ensure organizer/cohost routes use their own layouts during pending navigation.

  • Refactors

    • Root route renders discovery UI with Compete nav and footer; competition detail routes remain at /compete/:slug.
    • /compete index redirects to / with existing search params; login/sign-up redirects updated to /.
    • Updated navs, mobile navs, sidebars, breadcrumbs, and “Browse Competitions” links to point to /; the breadcrumb root crumb now links to /.
    • Compete header: shows Competitions (active on /), shows HOST A COMP until a user's team has an organizer request, then MANAGE COMPETITIONS; adds a divider before the host CTA; active links use underline and aria-current across desktop and mobile.
    • Auth routes render the Compete header; hide MainNav on / and auth routes; prevent the public Compete shell from wrapping organizer/cohost layouts during pending navigation.
    • Workout-tracking guards and auth redirects now target /; removed /compete from the sitemap; updated architecture and organizer dashboard docs.
  • Migration

    • Existing /compete links will redirect to /.
    • Update any hardcoded marketing or docs links to the discovery page at /.

Written for commit 1dabb10. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Navigation Updates

    • Competition discovery moved to the home page; many "Compete" links, redirects and breadcrumbs now point to the site root. Sitemap updated accordingly.
  • UI/Behavior

    • Top, mobile and sidebar brand links updated to the home route.
    • Protected-route redirects and invite/transfer flows now send users to the home page when appropriate.
    • Organizer CTA now toggles between "HOST A COMP…" and "MANAGE COMPETITIONS" based on organizer entitlement.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This PR moves competition discovery to "/", makes /compete an index redirect preserving search, replaces internal links/guards to point to "/", updates breadcrumb and sitemap entries, and wires a new hasOrganizerApplication entitlement into compete navigation.

Changes

Root Route and Compete Index Migration

Layer / File(s) Summary
Root route: CompetePage with search, filters, sorting
apps/wodsmith-start/src/routes/index.tsx
Replaces landing page with CompetePage that loads competitions, validates search params, computes per-competition status/location, renders tabs, search, advanced filters, sorting, and an EmptyState.
Compete index: redirect to root
apps/wodsmith-start/src/routes/compete/index.tsx
Replaces the /compete/ page with a beforeLoad redirect to / that preserves sanitized/preserved search parameters.
Root router: treat / as compete route
apps/wodsmith-start/src/routes/__root.tsx
Expands isCompeteRoute logic to recognize / and navigation targeting / so MainNav visibility is consistent when browsing competitions at root.

Navigation and Link Updates

Layer / File(s) Summary
Main navigation: logo and Compete links to /
apps/wodsmith-start/src/components/nav/main-nav.tsx
Header logo and “Compete” link destinations now point to / for both signed-in and signed-out users.
Mobile navigation: Compete link to /
apps/wodsmith-start/src/components/nav/mobile-nav.tsx
Mobile nav Compete anchors now route to / (auth + unauth paths) with route-group annotations.
Compete namespace navigation
apps/wodsmith-start/src/components/compete-nav-brand.tsx, apps/wodsmith-start/src/components/compete-nav.tsx
Rename Events→Competitions, link primary nav to /, derive aria-current via router state, update Login/Sign Up redirect search to /, and add hasOrganizerApplication prop.
Compete mobile navigation
apps/wodsmith-start/src/components/compete-mobile-nav.tsx
Brand/home and Competitions links now use /; component accepts optional hasOrganizerApplication to select organizer CTA label/target and computes active styling on /.
Sidebars: logo links to /
apps/wodsmith-start/src/components/cohost-sidebar.tsx, apps/wodsmith-start/src/components/competition-sidebar.tsx, apps/wodsmith-start/src/components/series-sidebar.tsx
Update sidebar header and collapsed-icon logo links (desktop + mobile inset) from /compete to /; several navigation arrays were reformatted but hrefs/icons unchanged.
Landing page CTAs: Browse Competitions to /
apps/wodsmith-start/src/components/landing/final-cta.tsx, apps/wodsmith-start/src/components/landing/two-audiences.tsx
“Browse Competitions” CTAs now target / and include route-group annotations.

Protected and Feature-Gated Route Redirects

Layer / File(s) Summary
Workout tracking feature gates
apps/wodsmith-start/src/routes/_protected/*
Update beforeLoad guards that require hasWorkoutTracking to redirect to / instead of /compete when unavailable (multiple protected routes).
Settings: empty-state browse link
apps/wodsmith-start/src/routes/_protected/settings/overview/index.tsx
Competitive History empty-state CTA now links to /.
Log route authorization redirect
apps/wodsmith-start/src/routes/_protected/log/index.tsx
Unauthorized redirect target changed from /compete to /.

Compete Sub-Route Redirects and Updates

Layer / File(s) Summary
Competition detail loaders: fallback redirects
apps/wodsmith-start/src/routes/compete/$slug/register/success.tsx, apps/wodsmith-start/src/routes/compete/$slug/registered.tsx
Loaders now redirect to / when competition data is missing.
Co-host invite: Browse Competitions links and redirects
apps/wodsmith-start/src/routes/compete/cohost-invite/$token.tsx
“Browse Competitions” links and acceptance fallbacks updated to /.
Co-host competition layout: permission and data redirects
apps/wodsmith-start/src/routes/compete/cohost/$competitionId.tsx
Loader redirects (missing teamId or permissions) now target /.
Volunteer invite: Browse links and accept fallbacks
apps/wodsmith-start/src/routes/compete/invite/$token.tsx, invite components
Invite UIs and accept components now navigate to / for browse links and fallback post-accept when competitionSlug absent.
Organizer management: authorization and cancel redirects
apps/wodsmith-start/src/routes/compete/organizer/*
Organizer route unauthorized/canManage redirects and onboarding cancel target /.
Transfer: Browse Competitions links
apps/wodsmith-start/src/routes/transfer/$transferId.tsx
Transfer-not-found/expired/cancelled CTAs updated to /.

Supporting Changes

Layer / File(s) Summary
Sitemap: remove /compete static entry
apps/wodsmith-start/src/routes/api/sitemap.ts
Remove /compete static page entry from sitemap generation.
Compete nav data and dashboard wiring
apps/wodsmith-start/src/routes/compete.tsx, apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx
Compute and return hasOrganizerApplication via server fn and pass it into CompeteNav and organizer dashboard layouts.
Breadcrumbs and docs
apps/wodsmith-start/src/components/compete-breadcrumb.tsx, lat.md/architecture.md, lat.md/organizer-dashboard.md
Introduce COMPETITION_DISCOVERY_PATH ("/") for breadcrumbs; update docs to reflect discovery at / and organizer CTA labeling notes.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • theianjones

🐇 I hopped from /compete to the root so bold,
Filters and tabs in a new story told.
Links all rebloom on the homepage street,
Breadcrumbs and guards now point to the beat.
Happy hops — browse competitions, fleet!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.45% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[codex] Move competition index to root' directly and clearly summarizes the main objective of this PR, which moves the public competition discovery page from /compete to the site root (/).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/move-compete-index

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@theianjones theianjones marked this pull request as ready for review June 8, 2026 03:30

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/wodsmith-start/src/routes/compete/index.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/wodsmith-start/src/components/compete-mobile-nav.tsx (1)

100-203: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a LAT reference comment for these mobile-nav route updates.

Please annotate this changed block with // @lat: [[...]] to tie the "/" navigation migration to its lat.md section.
As per coding guidelines, TS/TSX changes should include LAT reference comments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/components/compete-mobile-nav.tsx` around lines 100 -
203, The mobile navigation block that updates the "/" route (the Link elements
and anchor tags inside the CompeteMobileNav component, e.g., the top Link to="/"
and the Link to="/" under session?.user, and handlers like handleLinkClick)
needs a LAT reference comment; add a single-line comment of the form // `@lat`:
[[...]] directly above the changed route block (above the first Link to="/")
tying this navigation migration to its lat.md section so TSX changes follow the
LAT guideline.

Source: Coding guidelines

apps/wodsmith-start/src/components/compete-nav.tsx (1)

29-73: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add LAT linkage for the updated nav + auth redirect paths.

The route and redirect updates are correct, but this changed segment needs a // @lat: [[...]] reference to the relevant documentation section.
As per coding guidelines, **/*.{ts,tsx,js,jsx,rs,go,c,h,py} must include LAT reference comments in TS/JS files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/components/compete-nav.tsx` around lines 29 - 73, Add
a LAT linkage comment for the updated nav and auth redirect paths by inserting a
// `@lat`: [[...]] reference near the nav/auth JSX block in compete-nav.tsx (for
example just above the fragment that renders Links, the canOrganize conditional,
or above the Login/Sign-up Links), so the Events/Organize and sign-in/sign-up
redirect changes (symbols: canOrganize, Link to="/compete/organizer", Link
to="/sign-in" with search redirect, Link to="/sign-up") are documented; ensure
the comment follows the required format and points to the correct documentation
section.

Source: Coding guidelines

🧹 Nitpick comments (10)
apps/wodsmith-start/src/routes/compete/invite/$token.tsx (1)

62-63: ⚡ Quick win

Add a LAT code-reference comment for this route file.

This file is missing the required // @lat: [[section-id]] linkage comment for TSX source. Please add one near the route declaration (around Line 62) to keep concept-to-code traceability consistent.

As per coding guidelines, "**/*.{ts,tsx,js,jsx,rs,go,c,h,py}: Use // @lat: [[section-id]] code reference comments...".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/compete/invite/`$token.tsx around lines 62 -
63, Add the required LAT code-reference comment above the route declaration so
the TSX file contains the linkage comment; specifically insert a line like "//
`@lat`: [[section-id]]" immediately before the export const Route =
createFileRoute("/compete/invite/$token")({...}) declaration (reference symbols:
Route and createFileRoute) to satisfy the code-reference guideline for TSX
sources.

Source: Coding guidelines

apps/wodsmith-start/src/routes/compete/organizer/series/$groupId.tsx (1)

1-3: ⚡ Quick win

Add a LAT code-reference comment at the top of this route file.

Please add // @lat: [[section-id]] in this TSX file (near Line 1) so the route stays traceable to LAT documentation standards.

As per coding guidelines, "**/*.{ts,tsx,js,jsx,rs,go,c,h,py}: Use // @lat: [[section-id]] code reference comments...".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/compete/organizer/series/`$groupId.tsx around
lines 1 - 3, Add the LAT code-reference comment near the top of this TSX route
file so it remains traceable; insert a single-line comment `// `@lat`:
[[section-id]]` immediately above the first import (or at the very top of the
file) in apps/wodsmith-start/src/routes/compete/organizer/series/$groupId.tsx so
it precedes symbols like createFileRoute and Link and follows the repository
coding guideline for LAT comments.

Source: Coding guidelines

apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx (1)

1-4: ⚡ Quick win

Add the required LAT reference comment in this component file.

Please add a // @lat: [[section-id]] comment near the top (around Line 1) to comply with the code-to-concept linking rule for TSX files.

As per coding guidelines, "**/*.{ts,tsx,js,jsx,rs,go,c,h,py}: Use // @lat: [[section-id]] code reference comments...".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx`
around lines 1 - 4, Add the required LAT reference comment near the top of this
TSX component file by inserting a single-line comment of the form "// `@lat`:
[[section-id]]" just above or immediately after the "use client" directive in
apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx
so the file (which contains the imports useNavigate and useServerFn and the
AcceptInviteButton component code) complies with the code-to-concept linking
rule; ensure the comment is exactly formatted as "// `@lat`: [[section-id]]" and
placed before any other top-level code or imports.

Source: Coding guidelines

apps/wodsmith-start/src/routes/compete/index.tsx (1)

1-7: 💤 Low value

Consider preserving search params in redirect.

External links or bookmarks to /compete?q=crossfit will lose the search context when redirected to /. For better UX during the migration period, consider forwarding search params:

Proposed change to preserve search params
 import { createFileRoute, redirect } from "`@tanstack/react-router`"

 export const Route = createFileRoute("/compete/")({
-  beforeLoad: () => {
-    throw redirect({ to: "/" })
+  beforeLoad: ({ search }) => {
+    throw redirect({ to: "/", search })
   },
 })
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/compete/index.tsx` around lines 1 - 7, The
redirect in Route (created via createFileRoute) always drops the current query
string; update the beforeLoad handler to read the current request's search
params (e.g., from window.location.search or the router-provided
location/context) and include them when calling redirect so the destination
becomes "/" plus the original query string; modify beforeLoad in the Route
definition to build the redirected URL with the preserved search params before
throwing redirect().
apps/wodsmith-start/src/routes/_protected/calculator/index.tsx (1)

285-288: ⚡ Quick win

Add a @lat code reference on this modified guard.

Please annotate this beforeLoad redirect block with // @lat: [[section-id]] to keep docs/code traceability intact.
As per coding guidelines, **/*.{ts,tsx,js,jsx,rs,go,c,h,py} must use // @lat: [[section-id]] code reference comments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/_protected/calculator/index.tsx` around lines
285 - 288, Add the required code-traceability annotation to the guard in the
beforeLoad function: insert a comment line "// `@lat`: [[section-id]]" immediately
above the redirect block that checks context.hasWorkoutTracking and calls
redirect(...). Ensure the comment is placed within the beforeLoad implementation
and adjacent to the conditional so the annotation clearly ties to the redirect
guard.

Source: Coding guidelines

apps/wodsmith-start/src/routes/_protected/admin/teams/programming/index.tsx (1)

25-29: ⚡ Quick win

Add a @lat reference comment for this updated guard block.

Please add a // @lat: [[section-id]] comment adjacent to the beforeLoad redirect logic so this change remains traceable to the related concept/docs section.
As per coding guidelines, **/*.{ts,tsx,js,jsx,rs,go,c,h,py} must use // @lat: [[section-id]] code reference comments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/_protected/admin/teams/programming/index.tsx`
around lines 25 - 29, Add a `// `@lat`: [[section-id]]` reference comment next to
the updated guard in the beforeLoad handler so the change is traceable; locate
the beforeLoad function (the async ({ context }) => { if
(!context.hasWorkoutTracking) { throw redirect({ to: "/" }) } }) and insert the
required `// `@lat`: [[section-id]]` comment adjacent to the redirect/guard logic
line (near the if or throw redirect) following the project's `// `@lat`:
[[section-id]]` format.

Source: Coding guidelines

apps/wodsmith-start/src/routes/_protected/settings/overview/index.tsx (1)

401-403: ⚡ Quick win

Add a @lat reference for this updated competition CTA.

Add // @lat: [[section-id]] next to the modified “Browse Competitions” link to preserve code-to-doc linkage for this routing change.
As per coding guidelines, **/*.{ts,tsx,js,jsx,rs,go,c,h,py} must use // @lat: [[section-id]] code reference comments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/_protected/settings/overview/index.tsx` around
lines 401 - 403, Add the required code-to-doc linkage comment next to the
updated "Browse Competitions" CTA: insert the comment "// `@lat`: [[section-id]]"
adjacent to the <Link to="/"> element in the Button/asChild block (the JSX
containing Button and Link) so the Link component (used for routing) carries the
`@lat` reference as per the repo guideline.

Source: Coding guidelines

apps/wodsmith-start/src/routes/_protected/log/index.tsx (1)

9-12: ⚡ Quick win

Add a @lat reference comment on this guard change.

Please place // @lat: [[section-id]] adjacent to this beforeLoad redirect update for traceability.
As per coding guidelines, **/*.{ts,tsx,js,jsx,rs,go,c,h,py} must use // @lat: [[section-id]] code reference comments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/_protected/log/index.tsx` around lines 9 - 12,
Add the required traceability comment next to the guard change in the beforeLoad
function: insert a single-line comment `// `@lat`: [[section-id]]` adjacent to the
redirect call inside beforeLoad (the block starting with "beforeLoad: async ({
context }) => { ... throw redirect({ to: '/' }) }") so the guard update has the
mandated code reference comment per guidelines.

Source: Coding guidelines

apps/wodsmith-start/src/routes/_protected/admin/teams/scaling/index.tsx (1)

44-47: ⚡ Quick win

Add a @lat reference comment beside this redirect update.

Include // @lat: [[section-id]] next to the beforeLoad guard so this route-gate change is linked to the corresponding concept section.
As per coding guidelines, **/*.{ts,tsx,js,jsx,rs,go,c,h,py} must use // @lat: [[section-id]] code reference comments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/_protected/admin/teams/scaling/index.tsx`
around lines 44 - 47, Add the required LAT reference comment next to the route
guard: in the beforeLoad handler that checks context.hasWorkoutTracking and
calls redirect({ to: "/" }), append a single-line comment of the form // `@lat`:
[[section-id]] immediately beside or directly above that redirect/check so the
guard is linked to the concept section; ensure the comment uses the exact format
// `@lat`: [[section-id]] and does not alter the logic in beforeLoad or the
redirect call.

Source: Coding guidelines

apps/wodsmith-start/src/routes/_protected/dashboard.tsx (1)

27-30: ⚡ Quick win

Add a @lat marker for this guard redirect block.

Please add // @lat: [[section-id]] near this updated redirect so the route-access behavior remains linked to its spec/architecture reference.
As per coding guidelines, **/*.{ts,tsx,js,jsx,rs,go,c,h,py} must use // @lat: [[section-id]] code reference comments.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/_protected/dashboard.tsx` around lines 27 -
30, Add the required LAT reference comment directly above the redirect guard in
the beforeLoad function: locate the beforeLoad block (function name beforeLoad)
that checks context.hasWorkoutTracking and calls redirect, and insert a
single-line comment `// `@lat`: [[section-id]]` immediately before the guard (or
on the same line as the redirect check) so the route-access behavior remains
linked to its spec. Ensure the comment format matches other files exactly and
does not alter logic in beforeLoad or the redirect invocation.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/wodsmith-start/src/components/compete-nav-brand.tsx`:
- Line 7: Add the required LAT reference comment next to the updated route in
the CompeteNavBrand component: place a single-line comment like // `@lat`:
[[section-id]] immediately above or beside the Link JSX element (the <Link
to="/" className="flex items-center gap-2">) so the route change is traceable to
the corresponding lat.md section; replace section-id with the correct LAT
identifier.

In `@apps/wodsmith-start/src/components/competition-sidebar.tsx`:
- Line 211: The migrated header/mobile Link elements in the CompetitionSidebar
component currently lack LAT traceability comments; locate the JSX Link elements
with prop to="/" (and the other updated link targets referenced near the same
places) inside the CompetitionSidebar function/component and add nearby
single-line comments in the form // `@lat`: [[section-id]] for each updated link
target (one comment adjacent to each Link instance that had to="/" at the three
locations mentioned). Ensure the comments are plain JS/TS single-line comments
immediately above or beside the Link element so they remain visible in source
and match the required format.

In `@apps/wodsmith-start/src/components/landing/two-audiences.tsx`:
- Line 140: Add a LAT reference comment for the route update in the TwoAudiences
component: locate the Link element with to="/" in two-audiences.tsx (the "Browse
Competitions" route change) and add a single-line LAT annotation like // `@lat`:
[[...]] immediately above the Link (or directly on the same line) so the TSX
file includes the required source-to-doc traceability comment.

In `@apps/wodsmith-start/src/components/nav/main-nav.tsx`:
- Line 37: Add the required LAT code-reference comments next to the updated
route targets in the main navigation component: insert lines like // `@lat`:
[[section-id]] adjacent to the route string "/" at the location where the
default route is returned (around the expression ":" "/" in the JSX/ternary),
and do the same next to the other updated route targets referenced later in the
file (the targets around line ranges you were called out for). Ensure each
comment sits on the same line or immediately above the corresponding route
string so the code-to-doc linkage is preserved for the navigation rendering
logic (update the three spots noted: the "/" target and the two other
route-target expressions).

In `@apps/wodsmith-start/src/components/nav/mobile-nav.tsx`:
- Line 98: Update the migrated mobile Compete link elements in MobileNav
(apps/wodsmith-start/src/components/nav/mobile-nav.tsx) to include LAT reference
comments immediately above the relevant JSX anchor/link nodes; add lines like //
`@lat`: [[section-id]] for the link with href="/" (symbol: the anchor/Link
rendered at the location previously shown) and similarly for the link at the
other spot (symbol: the anchor/Link rendered around line 111) so each link has a
nearby LAT comment for traceability following the "// `@lat`: [[section-id]]"
format used in TypeScript/JavaScript files.

In `@apps/wodsmith-start/src/components/series-sidebar.tsx`:
- Line 120: Add the required LAT reference comments next to the updated Link
elements in the series sidebar: find the JSX Link elements that set to="/" (and
the other two updated link targets referenced in this file) inside the
SeriesSidebar component and append a line comment // `@lat`: [[section-id]]
immediately after each link target expression (preserve existing
spacing/indentation and use the exact comment format). Ensure the comment is
placed in the same file (apps/wodsmith-start/src/components/series-sidebar.tsx)
next to the Link prop values so the traceability rule picks them up for the
three changed links.

In `@apps/wodsmith-start/src/routes/_protected/movements/index.tsx`:
- Around line 17-20: Add the required LAT reference comment above the updated
route guard: insert a line containing "// `@lat`: [[section-id]]" immediately
before the beforeLoad function (the block that checks context.hasWorkoutTracking
and throws redirect). Ensure the comment appears in the TSX file near the
beforeLoad declaration so repository traceability tools can pick up the marker.

In `@apps/wodsmith-start/src/routes/_protected/programming/index.tsx`:
- Around line 40-43: Add the required LAT reference comment inside the updated
beforeLoad guard: annotate the start of the beforeLoad block (the async ({
context }) => { ... } that checks context.hasWorkoutTracking and calls redirect)
with a single-line comment // `@lat`: [[section-id]] so the source-to-doc linkage
is preserved; place the comment immediately above or on the same line as the
beforeLoad declaration to satisfy the file-wide LAT comment requirement.

In `@apps/wodsmith-start/src/routes/_protected/settings/programming/index.tsx`:
- Around line 13-16: The updated beforeLoad guard lacks the required LAT
code-reference marker; add a single-line comment containing the LAT marker
(e.g., // `@lat`: [[section-id]]) immediately above or on the same line as the
beforeLoad redirect logic so the beforeLoad function (the beforeLoad: async ({
context }) => { ... } block that calls redirect when
!context.hasWorkoutTracking) carries the // `@lat`: [[section-id]] marker per
guidelines.

In `@apps/wodsmith-start/src/routes/_protected/team/index.tsx`:
- Around line 6-9: The modified beforeLoad block in the route (the beforeLoad:
async ({ context }) => { ... } handler) needs the required source reference
annotation; add a single-line comment directly above the changed beforeLoad
block with the exact text // `@lat`: [[section-id]] (replace [[section-id]] with
the correct identifier for this change) so the TSX change is tied to the concept
per guidelines.

In `@apps/wodsmith-start/src/routes/_protected/workouts/index.tsx`:
- Around line 74-77: The beforeLoad route guard (function beforeLoad in
apps/wodsmith-start/src/routes/_protected/workouts/index.tsx) is missing the
required LAT reference comment; add the comment line // `@lat`: [[section-id]]
immediately above the edited guard (beforeLoad) block so the file includes the
LAT code reference as required by the repository's coding guidelines.

---

Outside diff comments:
In `@apps/wodsmith-start/src/components/compete-mobile-nav.tsx`:
- Around line 100-203: The mobile navigation block that updates the "/" route
(the Link elements and anchor tags inside the CompeteMobileNav component, e.g.,
the top Link to="/" and the Link to="/" under session?.user, and handlers like
handleLinkClick) needs a LAT reference comment; add a single-line comment of the
form // `@lat`: [[...]] directly above the changed route block (above the first
Link to="/") tying this navigation migration to its lat.md section so TSX
changes follow the LAT guideline.

In `@apps/wodsmith-start/src/components/compete-nav.tsx`:
- Around line 29-73: Add a LAT linkage comment for the updated nav and auth
redirect paths by inserting a // `@lat`: [[...]] reference near the nav/auth JSX
block in compete-nav.tsx (for example just above the fragment that renders
Links, the canOrganize conditional, or above the Login/Sign-up Links), so the
Events/Organize and sign-in/sign-up redirect changes (symbols: canOrganize, Link
to="/compete/organizer", Link to="/sign-in" with search redirect, Link
to="/sign-up") are documented; ensure the comment follows the required format
and points to the correct documentation section.

---

Nitpick comments:
In `@apps/wodsmith-start/src/routes/_protected/admin/teams/programming/index.tsx`:
- Around line 25-29: Add a `// `@lat`: [[section-id]]` reference comment next to
the updated guard in the beforeLoad handler so the change is traceable; locate
the beforeLoad function (the async ({ context }) => { if
(!context.hasWorkoutTracking) { throw redirect({ to: "/" }) } }) and insert the
required `// `@lat`: [[section-id]]` comment adjacent to the redirect/guard logic
line (near the if or throw redirect) following the project's `// `@lat`:
[[section-id]]` format.

In `@apps/wodsmith-start/src/routes/_protected/admin/teams/scaling/index.tsx`:
- Around line 44-47: Add the required LAT reference comment next to the route
guard: in the beforeLoad handler that checks context.hasWorkoutTracking and
calls redirect({ to: "/" }), append a single-line comment of the form // `@lat`:
[[section-id]] immediately beside or directly above that redirect/check so the
guard is linked to the concept section; ensure the comment uses the exact format
// `@lat`: [[section-id]] and does not alter the logic in beforeLoad or the
redirect call.

In `@apps/wodsmith-start/src/routes/_protected/calculator/index.tsx`:
- Around line 285-288: Add the required code-traceability annotation to the
guard in the beforeLoad function: insert a comment line "// `@lat`:
[[section-id]]" immediately above the redirect block that checks
context.hasWorkoutTracking and calls redirect(...). Ensure the comment is placed
within the beforeLoad implementation and adjacent to the conditional so the
annotation clearly ties to the redirect guard.

In `@apps/wodsmith-start/src/routes/_protected/dashboard.tsx`:
- Around line 27-30: Add the required LAT reference comment directly above the
redirect guard in the beforeLoad function: locate the beforeLoad block (function
name beforeLoad) that checks context.hasWorkoutTracking and calls redirect, and
insert a single-line comment `// `@lat`: [[section-id]]` immediately before the
guard (or on the same line as the redirect check) so the route-access behavior
remains linked to its spec. Ensure the comment format matches other files
exactly and does not alter logic in beforeLoad or the redirect invocation.

In `@apps/wodsmith-start/src/routes/_protected/log/index.tsx`:
- Around line 9-12: Add the required traceability comment next to the guard
change in the beforeLoad function: insert a single-line comment `// `@lat`:
[[section-id]]` adjacent to the redirect call inside beforeLoad (the block
starting with "beforeLoad: async ({ context }) => { ... throw redirect({ to: '/'
}) }") so the guard update has the mandated code reference comment per
guidelines.

In `@apps/wodsmith-start/src/routes/_protected/settings/overview/index.tsx`:
- Around line 401-403: Add the required code-to-doc linkage comment next to the
updated "Browse Competitions" CTA: insert the comment "// `@lat`: [[section-id]]"
adjacent to the <Link to="/"> element in the Button/asChild block (the JSX
containing Button and Link) so the Link component (used for routing) carries the
`@lat` reference as per the repo guideline.

In `@apps/wodsmith-start/src/routes/compete/index.tsx`:
- Around line 1-7: The redirect in Route (created via createFileRoute) always
drops the current query string; update the beforeLoad handler to read the
current request's search params (e.g., from window.location.search or the
router-provided location/context) and include them when calling redirect so the
destination becomes "/" plus the original query string; modify beforeLoad in the
Route definition to build the redirected URL with the preserved search params
before throwing redirect().

In
`@apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx`:
- Around line 1-4: Add the required LAT reference comment near the top of this
TSX component file by inserting a single-line comment of the form "// `@lat`:
[[section-id]]" just above or immediately after the "use client" directive in
apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx
so the file (which contains the imports useNavigate and useServerFn and the
AcceptInviteButton component code) complies with the code-to-concept linking
rule; ensure the comment is exactly formatted as "// `@lat`: [[section-id]]" and
placed before any other top-level code or imports.

In `@apps/wodsmith-start/src/routes/compete/invite/`$token.tsx:
- Around line 62-63: Add the required LAT code-reference comment above the route
declaration so the TSX file contains the linkage comment; specifically insert a
line like "// `@lat`: [[section-id]]" immediately before the export const Route =
createFileRoute("/compete/invite/$token")({...}) declaration (reference symbols:
Route and createFileRoute) to satisfy the code-reference guideline for TSX
sources.

In `@apps/wodsmith-start/src/routes/compete/organizer/series/`$groupId.tsx:
- Around line 1-3: Add the LAT code-reference comment near the top of this TSX
route file so it remains traceable; insert a single-line comment `// `@lat`:
[[section-id]]` immediately above the first import (or at the very top of the
file) in apps/wodsmith-start/src/routes/compete/organizer/series/$groupId.tsx so
it precedes symbols like createFileRoute and Link and follows the repository
coding guideline for LAT comments.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 593e2978-e565-4b3a-958c-11c2568b7938

📥 Commits

Reviewing files that changed from the base of the PR and between ba8d0b4 and 81f446d.

📒 Files selected for processing (37)
  • apps/wodsmith-start/src/components/cohost-sidebar.tsx
  • apps/wodsmith-start/src/components/compete-mobile-nav.tsx
  • apps/wodsmith-start/src/components/compete-nav-brand.tsx
  • apps/wodsmith-start/src/components/compete-nav.tsx
  • apps/wodsmith-start/src/components/competition-sidebar.tsx
  • apps/wodsmith-start/src/components/landing/final-cta.tsx
  • apps/wodsmith-start/src/components/landing/two-audiences.tsx
  • apps/wodsmith-start/src/components/nav/main-nav.tsx
  • apps/wodsmith-start/src/components/nav/mobile-nav.tsx
  • apps/wodsmith-start/src/components/series-sidebar.tsx
  • apps/wodsmith-start/src/routes/__root.tsx
  • apps/wodsmith-start/src/routes/_protected/admin/teams/programming/index.tsx
  • apps/wodsmith-start/src/routes/_protected/admin/teams/scaling/index.tsx
  • apps/wodsmith-start/src/routes/_protected/calculator/index.tsx
  • apps/wodsmith-start/src/routes/_protected/dashboard.tsx
  • apps/wodsmith-start/src/routes/_protected/log/index.tsx
  • apps/wodsmith-start/src/routes/_protected/movements/index.tsx
  • apps/wodsmith-start/src/routes/_protected/programming/index.tsx
  • apps/wodsmith-start/src/routes/_protected/settings/overview/index.tsx
  • apps/wodsmith-start/src/routes/_protected/settings/programming/index.tsx
  • apps/wodsmith-start/src/routes/_protected/team/index.tsx
  • apps/wodsmith-start/src/routes/_protected/workouts/index.tsx
  • apps/wodsmith-start/src/routes/api/sitemap.ts
  • apps/wodsmith-start/src/routes/compete/$slug/register/success.tsx
  • apps/wodsmith-start/src/routes/compete/$slug/registered.tsx
  • apps/wodsmith-start/src/routes/compete/cohost-invite/$token.tsx
  • apps/wodsmith-start/src/routes/compete/cohost/$competitionId.tsx
  • apps/wodsmith-start/src/routes/compete/index.tsx
  • apps/wodsmith-start/src/routes/compete/invite/$token.tsx
  • apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx
  • apps/wodsmith-start/src/routes/compete/invite/-components/accept-volunteer-invite-form.tsx
  • apps/wodsmith-start/src/routes/compete/organizer/$competitionId.tsx
  • apps/wodsmith-start/src/routes/compete/organizer/onboard/index.tsx
  • apps/wodsmith-start/src/routes/compete/organizer/series/$groupId.tsx
  • apps/wodsmith-start/src/routes/index.tsx
  • apps/wodsmith-start/src/routes/transfer/$transferId.tsx
  • lat.md/architecture.md
💤 Files with no reviewable changes (1)
  • apps/wodsmith-start/src/routes/api/sitemap.ts

Comment thread apps/wodsmith-start/src/components/compete-nav-brand.tsx
Comment thread apps/wodsmith-start/src/components/competition-sidebar.tsx
Comment thread apps/wodsmith-start/src/components/landing/two-audiences.tsx
Comment thread apps/wodsmith-start/src/components/nav/main-nav.tsx Outdated
Comment thread apps/wodsmith-start/src/components/nav/mobile-nav.tsx
Comment thread apps/wodsmith-start/src/routes/_protected/movements/index.tsx
Comment thread apps/wodsmith-start/src/routes/_protected/programming/index.tsx
Comment thread apps/wodsmith-start/src/routes/_protected/team/index.tsx
Comment thread apps/wodsmith-start/src/routes/_protected/workouts/index.tsx

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 28 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/wodsmith-start/src/routes/compete/index.tsx">

<violation number="1" location="apps/wodsmith-start/src/routes/compete/index.tsx:3">
P3: Duplicate search-schema/validation logic added in redirect route. Centralize this parser to avoid divergence between `/compete` redirect and `/` search handling.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

// ---------------------------------------------------------------------------
import { createFileRoute, redirect } from "@tanstack/react-router"

type StatusFilter = "all" | "registration-open" | "active" | "upcoming" | "past"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Duplicate search-schema/validation logic added in redirect route. Centralize this parser to avoid divergence between /compete redirect and / search handling.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/routes/compete/index.tsx, line 3:

<comment>Duplicate search-schema/validation logic added in redirect route. Centralize this parser to avoid divergence between `/compete` redirect and `/` search handling.</comment>

<file context>
@@ -1,7 +1,39 @@
 import { createFileRoute, redirect } from "@tanstack/react-router"
 
+type StatusFilter = "all" | "registration-open" | "active" | "upcoming" | "past"
+
+type CompeteSearch = {
</file context>

Comment thread apps/wodsmith-start/src/routes/index.tsx Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
apps/wodsmith-start/src/routes/index.tsx (1)

198-199: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Sync localSearch when URL search changes.

Line 198 only seeds state once, but Line 636 clears URL params. The input can keep stale text while results are no longer filtered.

Proposed fix
   const [localSearch, setLocalSearch] = useState(search.q ?? "")
+  useEffect(() => {
+    setLocalSearch(search.q ?? "")
+  }, [search.q])

Also applies to: 631-637

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/index.tsx` around lines 198 - 199, localSearch
is only initialized from search.q once, so when the URL search params change
(e.g., cleared around the code that manipulates params near the clear logic) the
input can stay stale; update the component to sync localSearch with changes to
the URL search value by adding an effect that listens to the URL-derived value
(either search.q or deferredSearchQuery from useDeferredValue) and calls
setLocalSearch(...) when it changes so the input reflects current params;
reference the localSearch/setLocalSearch state and the deferredSearchQuery
variable when implementing the effect.
apps/wodsmith-start/src/routes/compete.tsx (1)

1-16: ⚠️ Potential issue | 🟡 Minor

Add missing // @lat: references in apps/wodsmith-start/src/routes/compete.tsx.

  • apps/wodsmith-start/src/routes/compete.tsx contains no // @lat: [[...]] comments.
  • The request to add import "server-only" is inconsistent with nearby route modules that use createServerFn (e.g., apps/wodsmith-start/src/routes/admin.tsx, apps/wodsmith-start/src/routes/compete/organizer.tsx), which also omit the marker.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/compete.tsx` around lines 1 - 16, Add the
missing // `@lat`: markers at the top of
apps/wodsmith-start/src/routes/compete.tsx for the server-only imports: mark
imports that must stay server-side (createServerFn, getSessionFromCookie,
computeOrganizerEntitlements, TEAM_PERMISSIONS) with an appropriate // `@lat`:
[[server-only]] comment above the top-level import block so the file matches the
module isolation annotations used elsewhere (locate the import block that
includes createServerFn and the auth/entitlements imports to place the comment).

Source: Coding guidelines

apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx (1)

11-19: ⚠️ Potential issue | 🟠 Major

Add import "server-only" to apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx

  • This route imports server-only auth (getSessionFromCookie) inside a createServerFn handler; enforce the server-only boundary with import "server-only".
  • Add a // @lat: [[...]] code-reference comment for the /compete/organizer/_dashboard route segment (none exists in this file).
Proposed fix
+import "server-only"
 import { createFileRoute, Outlet } from "`@tanstack/react-router`"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx` around lines
11 - 19, This file uses server-only APIs inside the createServerFn handler (see
createServerFn and getSessionFromCookie) so add import "server-only" at the top
to enforce the server boundary, and add a route code-reference comment for this
segment (e.g., a single-line comment containing // `@lat`:
[[/compete/organizer/_dashboard]]) near the top of the file to mark the route;
ensure both the import and the // `@lat` comment are placed above other imports so
they are obvious and applied to the module before createServerFn and
computeOrganizerEntitlements are used.

Source: Coding guidelines

🧹 Nitpick comments (3)
apps/wodsmith-start/src/routes/index.tsx (1)

31-33: ⚡ Quick win

Add a @lat reference on this route module.

This changed TSX file is missing a source-concept trace comment.

Proposed fix
+// `@lat`: [[architecture#Route Groups#compete]]
 export const Route = createFileRoute("/")({

As per coding guidelines, Use // @lat: [[section-id]] code reference comments in TypeScript/JavaScript/Rust/Go/C files ... to tie source code to concepts.

Also applies to: 45-46

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/index.tsx` around lines 31 - 33, Add a
source-concept trace comment for this route module by inserting a // `@lat`:
[[section-id]] reference near the top of
apps/wodsmith-start/src/routes/index.tsx (e.g., directly above or below the
existing "//
---------------------------------------------------------------------------\n//
Route\n//
---------------------------------------------------------------------------"
block). Ensure you use the canonical format exactly "// `@lat`: [[section-id]]"
and place the same comment also where analogous route blocks appear (the comment
noted also applies around the code at lines referenced 45-46) so the module is
tied to the correct concept ID.

Source: Coding guidelines

apps/wodsmith-start/src/routes/compete.tsx (1)

37-45: ⚡ Quick win

Add a @lat reference comment on this route declaration.

This changed TSX route segment lacks source-to-concept linkage.

Proposed fix
+// `@lat`: [[architecture#Route Groups#compete]]
 export const Route = createFileRoute("/compete")({

As per coding guidelines, Use // @lat: [[section-id]] code reference comments in TypeScript/JavaScript/Rust/Go/C files ... to tie source code to concepts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/compete.tsx` around lines 37 - 45, The route
declaration exported as Route (created via createFileRoute with component
CompeteLayout and loader calling getCompeteNavDataFn) is missing the required
source-to-concept linkage comment; add a single-line reference comment
immediately above the export like "// `@lat`: [[section-id]]" (replace
[[section-id]] with the appropriate section identifier) so the
Route/createFileRoute declaration has the required // `@lat` reference for
tooling.

Source: Coding guidelines

apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx (1)

38-46: ⚡ Quick win

Add a @lat reference near this route definition.

The changed TSX route section currently has no source-concept reference comment.

Proposed fix
+// `@lat`: [[architecture#Route Groups#compete]]
 export const Route = createFileRoute("/compete/organizer/_dashboard")({

As per coding guidelines, Use // @lat: [[section-id]] code reference comments in TypeScript/JavaScript/Rust/Go/C files ... to tie source code to concepts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx` around lines
38 - 46, Add a // `@lat`: [[section-id]] reference comment adjacent to this route
definition so the source is tied to the concept; place the comment immediately
above the createFileRoute call for the Route export (the block that references
createFileRoute("/compete/organizer/_dashboard"), DashboardLayout, and loader
calling getCompeteNavDataFn) so tools and readers can map this route to the
specified concept id.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lat.md/architecture.md`:
- Around line 94-96: Add wiki-link source references to the new routing notes by
linking the architecture text to the actual implementing symbols: insert wiki
links like [[DiscoveryRoute]] (or [[DiscoveryRoute|root discovery route]]),
[[CompeteLayout]] (or [[CompeteLayout|/compete layout]]), and
[[CompeteBreadcrumbs]] (or [[CompeteBreadcrumbs|breadcrumbs component]]) where
you describe the root discovery route rendering the Compete shell and the
breadcrumb behavior; use the [[target]] or [[target|alias]] form consistent with
lat.md cross-reference rules so readers can jump to the corresponding
route/component sources.

---

Outside diff comments:
In `@apps/wodsmith-start/src/routes/compete.tsx`:
- Around line 1-16: Add the missing // `@lat`: markers at the top of
apps/wodsmith-start/src/routes/compete.tsx for the server-only imports: mark
imports that must stay server-side (createServerFn, getSessionFromCookie,
computeOrganizerEntitlements, TEAM_PERMISSIONS) with an appropriate // `@lat`:
[[server-only]] comment above the top-level import block so the file matches the
module isolation annotations used elsewhere (locate the import block that
includes createServerFn and the auth/entitlements imports to place the comment).

In `@apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx`:
- Around line 11-19: This file uses server-only APIs inside the createServerFn
handler (see createServerFn and getSessionFromCookie) so add import
"server-only" at the top to enforce the server boundary, and add a route
code-reference comment for this segment (e.g., a single-line comment containing
// `@lat`: [[/compete/organizer/_dashboard]]) near the top of the file to mark the
route; ensure both the import and the // `@lat` comment are placed above other
imports so they are obvious and applied to the module before createServerFn and
computeOrganizerEntitlements are used.

In `@apps/wodsmith-start/src/routes/index.tsx`:
- Around line 198-199: localSearch is only initialized from search.q once, so
when the URL search params change (e.g., cleared around the code that
manipulates params near the clear logic) the input can stay stale; update the
component to sync localSearch with changes to the URL search value by adding an
effect that listens to the URL-derived value (either search.q or
deferredSearchQuery from useDeferredValue) and calls setLocalSearch(...) when it
changes so the input reflects current params; reference the
localSearch/setLocalSearch state and the deferredSearchQuery variable when
implementing the effect.

---

Nitpick comments:
In `@apps/wodsmith-start/src/routes/compete.tsx`:
- Around line 37-45: The route declaration exported as Route (created via
createFileRoute with component CompeteLayout and loader calling
getCompeteNavDataFn) is missing the required source-to-concept linkage comment;
add a single-line reference comment immediately above the export like "// `@lat`:
[[section-id]]" (replace [[section-id]] with the appropriate section identifier)
so the Route/createFileRoute declaration has the required // `@lat` reference for
tooling.

In `@apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx`:
- Around line 38-46: Add a // `@lat`: [[section-id]] reference comment adjacent to
this route definition so the source is tied to the concept; place the comment
immediately above the createFileRoute call for the Route export (the block that
references createFileRoute("/compete/organizer/_dashboard"), DashboardLayout,
and loader calling getCompeteNavDataFn) so tools and readers can map this route
to the specified concept id.

In `@apps/wodsmith-start/src/routes/index.tsx`:
- Around line 31-33: Add a source-concept trace comment for this route module by
inserting a // `@lat`: [[section-id]] reference near the top of
apps/wodsmith-start/src/routes/index.tsx (e.g., directly above or below the
existing "//
---------------------------------------------------------------------------\n//
Route\n//
---------------------------------------------------------------------------"
block). Ensure you use the canonical format exactly "// `@lat`: [[section-id]]"
and place the same comment also where analogous route blocks appear (the comment
noted also applies around the code at lines referenced 45-46) so the module is
tied to the correct concept ID.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4ac4d620-4e78-471a-8448-1dabfe5a4567

📥 Commits

Reviewing files that changed from the base of the PR and between 81f446d and 8a713de.

📒 Files selected for processing (31)
  • apps/wodsmith-start/src/components/cohost-sidebar.tsx
  • apps/wodsmith-start/src/components/compete-breadcrumb.tsx
  • apps/wodsmith-start/src/components/compete-mobile-nav.tsx
  • apps/wodsmith-start/src/components/compete-nav-brand.tsx
  • apps/wodsmith-start/src/components/compete-nav.tsx
  • apps/wodsmith-start/src/components/competition-sidebar.tsx
  • apps/wodsmith-start/src/components/landing/final-cta.tsx
  • apps/wodsmith-start/src/components/landing/two-audiences.tsx
  • apps/wodsmith-start/src/components/nav/main-nav.tsx
  • apps/wodsmith-start/src/components/nav/mobile-nav.tsx
  • apps/wodsmith-start/src/components/series-sidebar.tsx
  • apps/wodsmith-start/src/routes/_protected/admin/teams/programming/index.tsx
  • apps/wodsmith-start/src/routes/_protected/admin/teams/scaling/index.tsx
  • apps/wodsmith-start/src/routes/_protected/calculator/index.tsx
  • apps/wodsmith-start/src/routes/_protected/dashboard.tsx
  • apps/wodsmith-start/src/routes/_protected/log/index.tsx
  • apps/wodsmith-start/src/routes/_protected/movements/index.tsx
  • apps/wodsmith-start/src/routes/_protected/programming/index.tsx
  • apps/wodsmith-start/src/routes/_protected/settings/overview/index.tsx
  • apps/wodsmith-start/src/routes/_protected/settings/programming/index.tsx
  • apps/wodsmith-start/src/routes/_protected/team/index.tsx
  • apps/wodsmith-start/src/routes/_protected/workouts/index.tsx
  • apps/wodsmith-start/src/routes/compete.tsx
  • apps/wodsmith-start/src/routes/compete/index.tsx
  • apps/wodsmith-start/src/routes/compete/invite/$token.tsx
  • apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx
  • apps/wodsmith-start/src/routes/compete/organizer/_dashboard.tsx
  • apps/wodsmith-start/src/routes/compete/organizer/series/$groupId.tsx
  • apps/wodsmith-start/src/routes/index.tsx
  • lat.md/architecture.md
  • lat.md/organizer-dashboard.md
✅ Files skipped from review due to trivial changes (1)
  • lat.md/organizer-dashboard.md
🚧 Files skipped from review as they are similar to previous changes (22)
  • apps/wodsmith-start/src/routes/_protected/movements/index.tsx
  • apps/wodsmith-start/src/routes/_protected/settings/programming/index.tsx
  • apps/wodsmith-start/src/components/landing/two-audiences.tsx
  • apps/wodsmith-start/src/routes/_protected/programming/index.tsx
  • apps/wodsmith-start/src/components/landing/final-cta.tsx
  • apps/wodsmith-start/src/components/compete-nav-brand.tsx
  • apps/wodsmith-start/src/routes/_protected/dashboard.tsx
  • apps/wodsmith-start/src/routes/compete/invite/-components/accept-invite-button.tsx
  • apps/wodsmith-start/src/components/nav/mobile-nav.tsx
  • apps/wodsmith-start/src/routes/_protected/admin/teams/programming/index.tsx
  • apps/wodsmith-start/src/routes/_protected/workouts/index.tsx
  • apps/wodsmith-start/src/routes/compete/organizer/series/$groupId.tsx
  • apps/wodsmith-start/src/components/cohost-sidebar.tsx
  • apps/wodsmith-start/src/routes/_protected/settings/overview/index.tsx
  • apps/wodsmith-start/src/routes/_protected/calculator/index.tsx
  • apps/wodsmith-start/src/routes/_protected/admin/teams/scaling/index.tsx
  • apps/wodsmith-start/src/components/nav/main-nav.tsx
  • apps/wodsmith-start/src/routes/compete/index.tsx
  • apps/wodsmith-start/src/routes/compete/invite/$token.tsx
  • apps/wodsmith-start/src/components/competition-sidebar.tsx
  • apps/wodsmith-start/src/routes/_protected/log/index.tsx
  • apps/wodsmith-start/src/components/series-sidebar.tsx

Comment thread lat.md/architecture.md Outdated
Comment on lines +94 to +96
The root discovery route renders the Compete navigation and footer shell because it is outside the `/compete` layout tree. Its header keeps `Competitions` visible on `/` and marks it as the current page.

Compete breadcrumbs label the `/compete` route segment as `Competitions`, but link that root crumb back to `/` because discovery moved out of the `/compete` layout tree.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add wiki-link source references for the new routing behavior notes.

These new architecture assertions should include at least one [[...]] reference to the implementing route/component files, consistent with lat.md cross-reference rules.

As per coding guidelines, “Use wiki links ([[target]] or [[target|alias]]) to cross-reference sections and source code in lat.md/ files.”

🧰 Tools
🪛 LanguageTool

[grammar] ~94-~94: Ensure spelling is correct
Context: .... The root discovery route renders the Compete navigation and footer shell because it ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lat.md/architecture.md` around lines 94 - 96, Add wiki-link source references
to the new routing notes by linking the architecture text to the actual
implementing symbols: insert wiki links like [[DiscoveryRoute]] (or
[[DiscoveryRoute|root discovery route]]), [[CompeteLayout]] (or
[[CompeteLayout|/compete layout]]), and [[CompeteBreadcrumbs]] (or
[[CompeteBreadcrumbs|breadcrumbs component]]) where you describe the root
discovery route rendering the Compete shell and the breadcrumb behavior; use the
[[target]] or [[target|alias]] form consistent with lat.md cross-reference rules
so readers can jump to the corresponding route/component sources.

Source: Coding guidelines

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 10 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/wodsmith-start/src/components/compete-mobile-nav.tsx">

<violation number="1" location="apps/wodsmith-start/src/components/compete-mobile-nav.tsx:161">
P3: Internal nav to organizer onboarding uses `<a href>` instead of TanStack `Link`, causing hard reload and inconsistent SPA behavior.</violation>
</file>

<file name="apps/wodsmith-start/src/routes/__root.tsx">

<violation number="1" location="apps/wodsmith-start/src/routes/__root.tsx:88">
P2: Auth-route detection misses `/team-invite`, so `MainNav` still renders on that auth page. Include `/team-invite` in both current and target path checks.</violation>
</file>

<file name="apps/wodsmith-start/src/server-fns/organizer-onboarding-fns.ts">

<violation number="1" location="apps/wodsmith-start/src/server-fns/organizer-onboarding-fns.ts:217">
P2: Helper treats rejected organizer requests as active applications. Filter to pending/approved statuses so rejected users can re-apply and see correct nav state.</violation>
</file>

<file name="apps/wodsmith-start/src/routes/_auth.tsx">

<violation number="1" location="apps/wodsmith-start/src/routes/_auth.tsx:11">
P1: CompeteNav receives hardcoded `session={null}` and `hasOrganizerApplication={false}` instead of real values from the server, causing auth pages to always show the logged-out navigation bar ("Login" / "Sign Up") even when the user is authenticated.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

return (
<div className="min-h-screen bg-background">
{/* TODO: Add navigation header if needed */}
<CompeteNav session={null} hasOrganizerApplication={false} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: CompeteNav receives hardcoded session={null} and hasOrganizerApplication={false} instead of real values from the server, causing auth pages to always show the logged-out navigation bar ("Login" / "Sign Up") even when the user is authenticated.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/routes/_auth.tsx, line 11:

<comment>CompeteNav receives hardcoded `session={null}` and `hasOrganizerApplication={false}` instead of real values from the server, causing auth pages to always show the logged-out navigation bar ("Login" / "Sign Up") even when the user is authenticated.</comment>

<file context>
@@ -7,11 +8,10 @@ export const Route = createFileRoute("/_auth")({
   return (
     <div className="min-h-screen bg-background">
-      {/* TODO: Add navigation header if needed */}
+      <CompeteNav session={null} hasOrganizerApplication={false} />
       <main>
         <Outlet />
</file context>

Comment on lines +88 to 95
currentPath.startsWith("/verify-email") ||
(isNavigating &&
(targetPath === "/sign-in" ||
targetPath === "/sign-up" ||
targetPath.startsWith("/reset-password") ||
targetPath.startsWith("/forgot-password") ||
targetPath.startsWith("/verify-email")))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Auth-route detection misses /team-invite, so MainNav still renders on that auth page. Include /team-invite in both current and target path checks.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/routes/__root.tsx, line 88:

<comment>Auth-route detection misses `/team-invite`, so `MainNav` still renders on that auth page. Include `/team-invite` in both current and target path checks.</comment>

<file context>
@@ -80,10 +80,22 @@ function RootComponent() {
+    currentPath === "/sign-up" ||
+    currentPath.startsWith("/reset-password") ||
+    currentPath.startsWith("/forgot-password") ||
+    currentPath.startsWith("/verify-email") ||
+    (isNavigating &&
+      (targetPath === "/sign-in" ||
</file context>
Suggested change
currentPath.startsWith("/verify-email") ||
(isNavigating &&
(targetPath === "/sign-in" ||
targetPath === "/sign-up" ||
targetPath.startsWith("/reset-password") ||
targetPath.startsWith("/forgot-password") ||
targetPath.startsWith("/verify-email")))
currentPath.startsWith("/verify-email") ||
currentPath.startsWith("/team-invite") ||
(isNavigating &&
(targetPath === "/sign-in" ||
targetPath === "/sign-up" ||
targetPath.startsWith("/reset-password") ||
targetPath.startsWith("/forgot-password") ||
targetPath.startsWith("/verify-email") ||
targetPath.startsWith("/team-invite")))


const db = getDb()
const request = await db.query.organizerRequestTable.findFirst({
where: inArray(organizerRequestTable.teamId, teamIds),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Helper treats rejected organizer requests as active applications. Filter to pending/approved statuses so rejected users can re-apply and see correct nav state.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/server-fns/organizer-onboarding-fns.ts, line 217:

<comment>Helper treats rejected organizer requests as active applications. Filter to pending/approved statuses so rejected users can re-apply and see correct nav state.</comment>

<file context>
@@ -205,6 +205,21 @@ async function isApprovedOrganizerInternal(teamId: string): Promise<boolean> {
+
+  const db = getDb()
+  const request = await db.query.organizerRequestTable.findFirst({
+    where: inArray(organizerRequestTable.teamId, teamIds),
+  })
+
</file context>
Suggested change
where: inArray(organizerRequestTable.teamId, teamIds),
where: and(
inArray(organizerRequestTable.teamId, teamIds),
inArray(organizerRequestTable.status, [
ORGANIZER_REQUEST_STATUS.PENDING,
ORGANIZER_REQUEST_STATUS.APPROVED,
]),
),

)}
{!hasOrganizerApplication && (
<a
href="/compete/organizer/onboard"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Internal nav to organizer onboarding uses <a href> instead of TanStack Link, causing hard reload and inconsistent SPA behavior.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/wodsmith-start/src/components/compete-mobile-nav.tsx, line 161:

<comment>Internal nav to organizer onboarding uses `<a href>` instead of TanStack `Link`, causing hard reload and inconsistent SPA behavior.</comment>

<file context>
@@ -127,23 +137,32 @@ export default function CompeteMobileNav({
                 <a
-                  href="/compete/organizer"
-                  className="flex items-center gap-2 hover:text-primary"
+                  href="/compete/organizer/onboard"
+                  className="hover:text-primary"
                   onClick={handleLinkClick}
</file context>

@zacjones93 zacjones93 merged commit ae9ec7b into main Jun 9, 2026
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants