Skip to content

feat(studio,web): add general structure of singleGroup #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2025

Conversation

mheob
Copy link
Owner

@mheob mheob commented Aug 9, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated single group page with contact persons section and enhanced metadata.
    • Added support for displaying featured images and email addresses for group types.
    • Implemented queries to fetch single group page data and associated contact persons.
  • Enhancements

    • Updated group cards to display featured images and improved navigation structure.
    • Refined contact persons display and accessibility in group-related pages.
    • Improved handling of missing pages by triggering explicit "not found" responses.
  • Bug Fixes

    • Removed unused or deprecated fields, such as the description in person affiliations.
  • Style

    • Updated visual styling for group cards and news article previews for a more consistent appearance.
  • Chores

    • Upgraded multiple dependencies to their latest versions.
    • Cleaned up configuration and removed unused CSS modules.

@mheob mheob added frontend 🖥️ Belongs to the Next.js App studio 🗃️ labels Aug 9, 2025
Copy link

height bot commented Aug 9, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

Copy link

vercel bot commented Aug 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsg-irlich-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2025 1:16pm
tsg-irlich-web-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2025 1:16pm

Copy link

coderabbitai bot commented Aug 9, 2025

Walkthrough

This change restructures and extends Sanity schemas and related code for group and person documents, introducing a singleGroupPage type with a new content.contactPersonsSection. It adds a required email field and renames image to featuredImage in several group types, removes the description field from person.affiliations, updates queries and types, and adjusts UI components accordingly.

Changes

Cohort / File(s) Change Summary
Sanity schema & type updates
apps/studio/schema.json, apps/studio/schemas/documents/person.ts, apps/studio/schemas/single-pages/single-group.ts, apps/studio/schemas/single-pages/single-group/_groups.ts, apps/studio/schemas/single-pages/single-group/contact-persons.ts, apps/studio/schemas/single-pages/single-group/index.ts, apps/studio/utils/documents/group.tsx, apps/web/src/types/sanity.types.generated.ts
Extended group types with a required email field and renamed image to featuredImage. Added content.contactPersonsSection to singleGroupPage. Removed description from person.affiliations. Refactored and consolidated singleGroupPage schema and related field groups. Updated generated types to match schema changes.
Sanity queries
apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts, apps/web/src/lib/sanity/queries/pages/offer-groups.ts
Added queries for singleGroupPage, related groups, and contact persons. Updated group queries to use featuredImage instead of image.
Single group page implementation
apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
Introduced a new page component for single group pages, fetching main content and contact persons, rendering hero, contact, and newsletter sections, and generating Open Graph metadata.
Group card & group section UI
apps/web/src/app/angebot/[group]/_sections/group-card.tsx, apps/web/src/app/angebot/[group]/_sections/groups.tsx, apps/web/src/app/angebot/_sections/group-card.tsx, apps/web/src/components/ui/news-article-preview-wide.tsx
Updated GroupCard to accept featuredImage and currentDepartment, switched from CSS modules to Tailwind, and improved accessibility. Updated child prop passing and border radius classes for consistent UI.
Removed/deprecated files
apps/web/src/app/angebot/[group]/_sections/group-card.module.css, apps/studio/schemas/single-pages/single-group.ts
Deleted unused CSS module and old singleGroupPage schema file as part of refactoring.
Configuration and housekeeping
apps/studio/sanity-typegen.json, apps/web/components.json, apps/web/sanity-typegen.json, pnpm-workspace.yaml, turbo.json
Reordered keys in JSON config files, updated dependency versions, removed trailing commas, and cleaned up configuration properties.
Minor logging
apps/web/src/app/angebot/[group]/page.tsx
Added a console log for the group parameter.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant NextJSPage as SingleGroupPage (Next.js)
    participant SanityClient
    participant ContactPersonsSection
    participant HeroSection
    participant NewsletterSection

    User->>NextJSPage: Visit /angebot/[group]/[singleGroup]
    NextJSPage->>SanityClient: Fetch singleGroupPage by slug
    NextJSPage->>SanityClient: Fetch contact persons by group slug
    SanityClient-->>NextJSPage: Return page data and contact persons
    NextJSPage->>HeroSection: Render with page data
    NextJSPage->>ContactPersonsSection: Render with contact persons and content
    NextJSPage->>NewsletterSection: Render
    NextJSPage-->>User: Rendered page with hero, contacts, and newsletter
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

Suggested labels

studio :card_file_box:, enhancement :sparkles:

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 200-create-groups-page

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 10

🔭 Outside diff range comments (4)
apps/web/src/lib/sanity/queries/pages/offer-groups.ts (1)

34-38: Filtering by first affiliation only will miss valid matches; match any affiliation instead.

Using affiliations[0]... restricts results to the first entry. Prefer checking across all affiliations.

-export const offerGroupsPageContactPersonsQuery = defineQuery(`
-  *[_type == 'person'][affiliations[0].role->email == $email] {
-    ${contactPersons}
-  }
-`);
+export const offerGroupsPageContactPersonsQuery = defineQuery(`
+  *[_type == 'person' && $email in coalesce(affiliations[].role->email, [])] {
+    ${contactPersons}
+  }
+`);
apps/web/src/app/angebot/[group]/_sections/groups.tsx (1)

24-24: Avoid rendering “undefined” when currentDepartment is absent.

Template interpolation will turn undefined into a string. Use a conditional join:

- title={`${title} ${currentDepartment?.title}`.trim()}
+ title={[title, currentDepartment?.title].filter(Boolean).join(' ')}
apps/studio/utils/documents/group.tsx (1)

103-107: Implement content migration for the renamed featuredImage field

Renaming imagefeaturedImage in your group schema will leave existing documents with featuredImage empty while image remains populated, breaking queries and UI. You need to:

• Write and run a Sanity migration (e.g. via sanity exec) to copy each document’s image value into featuredImage.
• Temporarily add back a hidden, read-only image field in your schema for verification, then remove it once you’ve confirmed data was copied.
• Update all code that still selects or reads the old image field—at minimum, you must fix:
– apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (lines 19 & 40: change imagefeaturedImage)
– apps/web/src/utils/groups/index.ts (uses groupSection.image, getGroupImage)
– Any other queries, components or utilities referencing group.image (e.g. group-card, page components)
• After migration and code updates, remove the temporary image field from your schema.

Once the migration is applied and references updated, you can rely on featuredImage exclusively.

apps/web/src/types/sanity.types.generated.ts (1)

2284-2365: Query result uses image but schema/types use featuredImage

This union shows image because the GROQ query projects image. Please update the query to featuredImage (see offer-groups-group.ts fix), then re-run typegen.

🧹 Nitpick comments (13)
apps/web/src/app/angebot/[group]/page.tsx (1)

48-49: Replace disallowed console.log with allowed method and gate to dev

ESLint warns: Unexpected console statement; only info/warn/error allowed. Either remove or gate for non-prod and use console.info.

Apply:

-	console.log(group);
+	if (process.env.NODE_ENV !== 'production') console.info('[angebot/[group]] group param:', group)
apps/studio/schemas/single-pages/single-group/_groups.ts (1)

1-4: Preserve literal types for Sanity group object

Mark as readonly to improve type inference when consumed by schema definitions.

-export const contactPersons = {
+export const contactPersons = {
   title: 'Ansprechpartner',
   name: 'contactPersons',
-};
+} as const;
apps/web/sanity-typegen.json (1)

3-5: Reordering is fine; consider narrowing the glob to TS/TSX only.

Key order in JSON is a no-op. To align with “Use TypeScript for all code” and reduce scan time, prefer excluding JS/JSX:

-  "path": "./src/lib/sanity/**/*.{ts,tsx,js,jsx}",
+  "path": "./src/lib/sanity/**/*.{ts,tsx}",
apps/web/src/app/angebot/_sections/groups.tsx (1)

21-21: Keep a graceful icon fallback to avoid rendering issues.

If any groupSections entry lacks icon, render will pass undefined to DOSBIcon. Consider an inline fallback:

-<GroupCard icon={icon} key={slug} slug={slug} title={title} />
+<GroupCard icon={icon || title.charAt(0).toUpperCase()} key={slug} slug={slug} title={title} />

Please confirm that all groupSections entries are guaranteed to have icon. If yes, you can ignore this.

apps/studio/schemas/single-pages/single-group/contact-persons.ts (2)

1-1: Prefer Sanity’s icon set for Studio schemas.

Use @sanity/icons before third-party icon packs for consistency and lighter bundles.

-import { RiLinksLine } from 'react-icons/ri';
+import { UsersIcon } from '@sanity/icons';
@@
-  icon: RiLinksLine,
+  icon: UsersIcon,

Also applies to: 10-10


6-14: Add a brief description and optional UX niceties.

Provide a German description for editors and consider making the section collapsible.

 export const contactPersonsField = defineField({
   title: 'Ansprechpartner',
   name: 'contactPersonsSection',
   type: 'object',
-  icon: RiLinksLine,
+  icon: UsersIcon,
   group: 'contactPersons',
+  description:
+    'Bereich für Ansprechpartner der Gruppe. Titel, Untertitel und optionaler Einleitungstext.',
   fields: [...getDefaultPageSectionFieldsWithGroup()],
   validation: Rule => [Rule.required().error('Ansprechpartner sind erforderlich')],
+  options: { collapsible: true, collapsed: false },
 });
apps/web/src/app/angebot/_sections/group-card.tsx (1)

9-9: Use an interface (preferred) and place types after the component.

Project guideline favors interfaces and keeping types at the bottom of TSX files.

-type GroupCardProps = Pick<GroupsType['groups'][number], 'icon' | 'slug' | 'title'>;
+interface GroupCardProps extends Pick<GroupsType['groups'][number], 'icon' | 'slug' | 'title'> {}

Additionally, move the interface GroupCardProps to the end of the file (after the component) to follow the declared file order rule.

apps/studio/schemas/single-pages/single-group/index.ts (3)

1-1: Prefer @sanity/icons for Studio document and field icons.

Swap react-icons for @sanity/icons to align with Studio conventions.

-import { RiBookletLine, RiLinksLine } from 'react-icons/ri';
+import { BookIcon, LinkIcon } from '@sanity/icons';
@@
-  icon: RiBookletLine,
+  icon: BookIcon,
@@
-      icon: RiLinksLine,
+      icon: LinkIcon,

Also applies to: 15-15, 31-31


26-36: Add editor-facing descriptions; consider collapsible content object.

Short German descriptions improve Studio UX, and collapsible sections keep the form tidy.

 defineField({
   title: 'Inhalte',
   name: 'content',
   type: 'object',
-  icon: RiLinksLine,
+  icon: LinkIcon,
   group: 'content',
+  description: 'Seiteninhalte für die Einzel-Gruppe. Enthält u. a. den Bereich „Ansprechpartner“.',
   groups: [contactPersons],
   fields: [contactPersonsField],
   validation: Rule => Rule.required(),
+  options: { collapsible: true, collapsed: false },
 }),

11-17: Schema structure looks sound; remember to regenerate types.

After adding a new document type, regenerate types to keep web types in sync.

Suggested command (adjust to your tooling):

  • pnpm: pnpm run extract-types
  • nx: nx run studio:extract-types

I can open a follow-up to run the type extraction and update affected queries/components if you’d like.

Also applies to: 38-41

apps/web/src/app/angebot/[group]/_sections/group-card.tsx (2)

12-12: Prefer interface over type for props, and place types at end of file

Guidelines prefer interfaces and keeping types at the end. This improves IDE perf and consistency.

- type GroupCardProps = GroupsType['groups'][number] & { currentDepartment?: GroupSection };
+ interface GroupCardProps extends GroupsType['groups'][number] {
+  currentDepartment?: GroupSection;
+}

23-25: Clip overlay/image within rounded corners

Add overflow-hidden to the container so absolutely positioned layers don’t bleed beyond rounded corners when scaling.

- <article className="relative aspect-video shadow-lg transition-transform duration-200 hover:scale-105">
+ <article className="relative aspect-video overflow-hidden rounded-xl shadow-lg transition-transform duration-200 hover:scale-105">

You can then drop redundant rounded-xl on children if you want.

apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx (1)

25-35: Metadata currently hard-coded

Not blocking, but consider deriving title/OG from CMS when available to improve SEO.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 731426e and 6e0684f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • apps/studio/sanity-typegen.json (1 hunks)
  • apps/studio/schema.json (15 hunks)
  • apps/studio/schemas/documents/person.ts (0 hunks)
  • apps/studio/schemas/single-pages/single-group.ts (0 hunks)
  • apps/studio/schemas/single-pages/single-group/_groups.ts (1 hunks)
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts (1 hunks)
  • apps/studio/schemas/single-pages/single-group/index.ts (1 hunks)
  • apps/studio/utils/documents/group.tsx (3 hunks)
  • apps/web/components.json (1 hunks)
  • apps/web/sanity-typegen.json (1 hunks)
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx (1 hunks)
  • apps/web/src/app/angebot/[group]/_sections/group-card.module.css (0 hunks)
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx (2 hunks)
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx (1 hunks)
  • apps/web/src/app/angebot/[group]/page.tsx (1 hunks)
  • apps/web/src/app/angebot/_sections/group-card.tsx (2 hunks)
  • apps/web/src/app/angebot/_sections/groups.tsx (1 hunks)
  • apps/web/src/components/ui/news-article-preview-wide.tsx (1 hunks)
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (1 hunks)
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts (1 hunks)
  • apps/web/src/types/sanity.types.generated.ts (19 hunks)
  • pnpm-workspace.yaml (5 hunks)
  • turbo.json (1 hunks)
💤 Files with no reviewable changes (3)
  • apps/studio/schemas/documents/person.ts
  • apps/studio/schemas/single-pages/single-group.ts
  • apps/web/src/app/angebot/[group]/_sections/group-card.module.css
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/any-inside-generic-functions.mdc)

**/*.{ts,tsx}: When building generic functions in TypeScript, it is acceptable to use any inside the function body if TypeScript cannot match runtime logic to type logic.
Outside of generic functions, use any extremely sparingly in TypeScript code.

Unless explicitly required by the framework, do not use default exports in TypeScript files.

**/*.{ts,tsx}: Use TypeScript for all code. Prefer interfaces over types.
Follow the ESLint rules.
Use 'function' keyword for pure functions.
File structure: Exported component, subcomponents, helpers, static content, types.
Avoid unnecessary curly braces in conditional statements.
For single-line statements in conditionals, omit curly braces.
Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
Handle errors and edge cases at the beginning of functions.
Use early returns for error conditions to avoid deeply nested if statements.
Place the happy path last in the function for improved readability.
Avoid unnecessary else statements; use if-return pattern instead.
Use guard clauses to handle preconditions and invalid states early.
Implement proper error logging and user-friendly error messages.
Consider using custom error types or error factories for consistent error handling.
Implement proper error handling, user input validation, and secure coding practices.
Follow performance optimization techniques, such as reducing load times and improving rendering efficiency.
Provide clear and concise comments for complex logic.
Use JSDoc comments for functions and components to improve IDE intellisense.

**/*.{ts,tsx}: Proactively use discriminated unions to model data that can be in one of a few different shapes in TypeScript.
Use switch statements to handle the results of discriminated unions in TypeScript.
Use discriminated unions to prevent the 'bag of optionals' problem in TypeScript, especially when modeling state objects.

**/*.{ts,tsx}: Do not introduce new enums into the c...

Files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/studio/schemas/single-pages/single-group/_groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/studio/utils/documents/group.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
  • apps/web/src/types/sanity.types.generated.ts
**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/*.tsx: Use functional components and TypeScript interfaces in React/Next.js code
Use declarative JSX in React components
Use function, not const, for component declarations
Favor named exports for components
Use Shadcn UI and Tailwind CSS for components and styling
Implement responsive design with Tailwind CSS using a mobile-first approach
Place static content and interfaces at the end of the file
Use content variables for static content outside render functions
Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
Use Zod for form validation
Wrap client components in Suspense with fallback
Use dynamic loading for non-critical components
Implement dynamic imports for code splitting and optimization
Optimize images: use WebP format, size data, lazy loading, and the next/image component
Use useActionState with react-hook-form for form validation
Break down components into smaller parts with minimal props
Suggest micro folder structure for components
Use composition to build complex components
Follow the order: component declaration, then TypeScript types
Use React Server Components for data fetching when possible
Implement the preload pattern to prevent waterfalls
Use Tailwind CSS for styling, following the Utility First approach
Utilize the Class Variance Authority (CVA) for managing component variants
Ensure interfaces are keyboard navigable
Implement proper ARIA labels and roles for components
Ensure color contrast ratios meet WCAG standards for readability

Files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/studio/utils/documents/group.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
**/*.ts

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/*.ts: Model expected errors as return values; avoid using try/catch for expected errors in Server Actions
Use next-safe-action for all server actions
Implement type-safe server actions with proper validation
Handle errors gracefully and return appropriate responses

Files:

  • apps/studio/schemas/single-pages/single-group/_groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/types/sanity.types.generated.ts
**/{queries,groq}/**/*.ts

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/{queries,groq}/**/*.ts: Import defineQuery and groq from next-sanity at the top of GROQ query files
Export queries as constants using the defineQuery function
Organize queries by content type (blogs, pages, products, etc.) and group related queries together
Whenever there is an image within a GROQ query, do not expand it unless explicitly instructed to do so

Files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
🧠 Learnings (62)
📓 Common learnings
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When producing schema from screenshots, use the Sanity schema format, include descriptions based on visual elements, and map visual cues (e.g., tiny text above a title is an eyebrow, large text is a title, formatted text is richText, images require alt text, and button arrays should be reused).
📚 Learning: 2025-06-19T13:37:14.734Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#204
File: apps/studio/schema.json:4505-4529
Timestamp: 2025-06-19T13:37:14.734Z
Learning: The `apps/studio/schema.json` file in Sanity projects is auto-generated and should not be manually edited. Schema changes should be made in the source TypeScript schema definition files.

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/web/components.json
  • apps/studio/sanity-typegen.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/studio/schema.json
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: After adding new Sanity schema, run the type generation command ('nr extract-types') to generate TypeScript definitions.

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/studio/sanity-typegen.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When creating Sanity schema in TypeScript files, always import the necessary Sanity types: 'defineField', 'defineType', and 'defineArrayMember' (only if needed) from 'sanity'.

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/studio/sanity-typegen.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/utils/documents/group.tsx
  • pnpm-workspace.yaml
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : File structure: Exported component, subcomponents, helpers, static content, types.

Applied to files:

  • apps/web/sanity-typegen.json
  • turbo.json
  • apps/web/components.json
  • apps/studio/sanity-typegen.json
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Follow the ESLint rules.

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/studio/sanity-typegen.json
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:09:28.798Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-08-03T10:09:28.798Z
Learning: Applies to **/*.{config.ts,test.ts,context.tsx,type.ts,hook.ts} : File extensions: Use `.config.ts`, `.test.ts`, `.context.tsx`, `.type.ts`, `.hook.ts` as appropriate

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/studio/sanity-typegen.json
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Import defineQuery and groq from next-sanity at the top of GROQ query files

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/studio/utils/documents/group.tsx
  • pnpm-workspace.yaml
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript for all code. Prefer interfaces over types.

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/studio/sanity-typegen.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/studio/sanity-typegen.json
📚 Learning: 2025-08-03T10:09:18.141Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-08-03T10:09:18.141Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments to annotate functions and types.

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/studio/sanity-typegen.json
📚 Learning: 2025-06-09T16:08:42.643Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/app/angebote/page.tsx:26-28
Timestamp: 2025-06-09T16:08:42.643Z
Learning: The user (mheob) prefers to keep TODO comments as-is in apps/web/src/app/angebote/page.tsx and doesn't want suggestions to improve error handling for basic null checks with TODO comments in this context.

Applied to files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Organize queries by content type (blogs, pages, products, etc.) and group related queries together

Applied to files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.{ts,tsx} : Provide clear and concise comments for complex logic

Applied to files:

  • apps/web/src/app/angebot/[group]/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use Shadcn UI and Tailwind CSS for components and styling

Applied to files:

  • turbo.json
  • apps/web/components.json
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • pnpm-workspace.yaml
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use Tailwind CSS for styling, following the Utility First approach

Applied to files:

  • apps/web/components.json
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Suggest micro folder structure for components

Applied to files:

  • apps/web/components.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Break down components into smaller parts with minimal props

Applied to files:

  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Implement responsive design with Tailwind CSS using a mobile-first approach

Applied to files:

  • apps/web/components.json
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Follow the order: component declaration, then TypeScript types

Applied to files:

  • apps/web/components.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Place static content and interfaces at the end of the file

Applied to files:

  • apps/web/components.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)

Applied to files:

  • apps/web/components.json
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use functional components and TypeScript interfaces in React/Next.js code

Applied to files:

  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • pnpm-workspace.yaml
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use composition to build complex components

Applied to files:

  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Favor named exports for components

Applied to files:

  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:09:28.798Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-08-03T10:09:28.798Z
Learning: Applies to **/*.{ts,tsx} : Avoid magic numbers and define constants

Applied to files:

  • apps/studio/schemas/single-pages/single-group/_groups.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Whenever there is an image within a GROQ query, do not expand it unless explicitly instructed to do so

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Export queries as constants using the defineQuery function

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2024-12-16T17:10:23.283Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#134
File: apps/web/src/lib/sanity/queries/shared/news.ts:5-14
Timestamp: 2024-12-16T17:10:23.283Z
Learning: All fields in the `newsArticle` query in `apps/web/src/lib/sanity/queries/shared/news.ts` are required and can be safely assumed to exist without null checks.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Organize GROQ queries by content type and group related queries together for maintainability.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use template literals for GROQ query strings, indent nested structures for readability, keep related query parts together, maintain consistent whitespace and indentation, and use comments to explain complex logic.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Export TypeScript interfaces for GROQ query responses when needed, using descriptive types that match the query structure.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: In GROQ queries, do not expand images unless explicitly instructed to do so.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
📚 Learning: 2025-06-22T05:21:22.143Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#205
File: apps/studio/schema.json:195-394
Timestamp: 2025-06-22T05:21:22.143Z
Learning: Die Datei `apps/studio/schema.json` ist automatisch generiert und darf nicht manuell geändert werden.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schema.json
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense.

Applied to files:

  • apps/studio/sanity-typegen.json
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Always use 'defineField' for every field and 'defineType' for the schema type in Sanity TypeScript schemas.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/utils/documents/group.tsx
  • apps/studio/schemas/single-pages/single-group/index.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: In Sanity schemas, always include a title, name, description, and type for each field. The description should be in simple German for non-technical users.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/utils/documents/group.tsx
  • apps/studio/schemas/single-pages/single-group/index.ts
📚 Learning: 2025-06-09T16:12:07.501Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/components/ui/form/use-form-field.ts:18-28
Timestamp: 2025-06-09T16:12:07.501Z
Learning: In the TSG Irlich web project, when reviewing form-related error handling in use-form-field.ts, the user prefers not to add additional context validation checks beyond the existing fieldContext check, even if itemContext access could potentially cause runtime errors.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When adding icons to a Sanity schema, use the default 'sanity/icons' first, and only use other icon sets (e.g., lucide-react, react-icons/ri) if no relevant icon exists. Icons should always be named exports.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/utils/documents/group.tsx
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use function, not const, for component declarations

Applied to files:

  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Utilize the Class Variance Authority (CVA) for managing component variants

Applied to files:

  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Implement proper ARIA labels and roles for components

Applied to files:

  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Optimize images: use WebP format, size data, lazy loading, and the next/image component

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • pnpm-workspace.yaml
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Optimize images in Next.js by using the next/image component, WebP format, specifying size data, and enabling lazy loading for improved performance.

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
📚 Learning: 2025-06-09T16:08:32.469Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/components/ui/form/form-context.ts:17-17
Timestamp: 2025-06-09T16:08:32.469Z
Learning: In apps/web/src/components/ui/form/form-context.ts, the team prefers to use type assertion on empty objects for React context default values (e.g., `{} as FormFieldContextValue`) rather than providing safer defaults with actual properties.

Applied to files:

  • apps/studio/utils/documents/group.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use useActionState with react-hook-form for form validation

Applied to files:

  • apps/studio/utils/documents/group.tsx
📚 Learning: 2025-08-03T10:08:46.583Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-08-03T10:08:46.583Z
Learning: Applies to **/*.{ts,tsx} : Prefer top-level `import type` over inline `import { type ... }` in TypeScript files

Applied to files:

  • apps/web/src/app/angebot/_sections/group-card.tsx
📚 Learning: 2025-06-13T16:38:06.852Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#197
File: pnpm-workspace.yaml:10-10
Timestamp: 2025-06-13T16:38:06.852Z
Learning: pnpm added support for the `catalogMode` setting (values such as `prefer`) beginning with version 10.12.1, so this key is valid in `pnpm-workspace.yaml` when using that or newer versions.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:04:04.084Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#214
File: package.json:47-50
Timestamp: 2025-08-03T10:04:04.084Z
Learning: The pnpm/action-setup GitHub Action automatically reads the packageManager field from package.json to determine the correct pnpm version when no explicit version is specified in the workflow. This requires an exact version format like "pnpmx.y.z" in the packageManager field, making manual version pinning in workflows unnecessary and allowing version management directly from the project manifest.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:09:08.245Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/installing-libraries.mdc:0-0
Timestamp: 2025-08-03T10:09:08.245Z
Learning: When installing libraries, do not rely on your own training data; instead of picking a version manually (via updating the package.json file), use a script (e.g., pnpm/yarn/npm add) to install the latest version of a library.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:04:04.084Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#214
File: package.json:47-50
Timestamp: 2025-08-03T10:04:04.084Z
Learning: The pnpm/action-setup GitHub Action automatically reads the packageManager field from package.json to determine the correct pnpm version when no explicit version is specified in the workflow, making manual version pinning unnecessary.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Use Tailwind CSS, Shadcn UI, and Radix UI for consistent, modern, and responsive UI design.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Minimize the use of 'use client', useEffect, and setState in Next.js 15+; favor React Server Components (RSC) and SSR features for better performance and scalability.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Use Sanity as a headless CMS to fetch and manage content, leveraging its flexibility and scalability.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-03-19T10:27:11.409Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#176
File: apps/studio/package.json:25-25
Timestamp: 2025-03-19T10:27:11.409Z
Learning: The update of sanity-plugin-media from version 2.x to 3.x doesn't cause issues for the TSG Irlich web project, as confirmed by the developer after research.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use Zod for form validation

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: For GROQ query files, always import 'defineQuery' and 'groq' from 'next-sanity' at the top, and export queries as constants using 'defineQuery'.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use camelCase for all GROQ query names, prefix with an action verb (get, getAll, etc.), and suffix with 'Query'. Reusable fragments should be prefixed with an underscore.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Refer to Next.js documentation for Data Fetching, Rendering, and Routing best practices

Applied to files:

  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When producing schema from screenshots, use the Sanity schema format, include descriptions based on visual elements, and map visual cues (e.g., tiny text above a title is an eyebrow, large text is a title, formatted text is richText, images require alt text, and button arrays should be reused).

Applied to files:

  • apps/studio/schemas/single-pages/single-group/index.ts
📚 Learning: 2025-06-09T16:08:37.917Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/components/layout/main-nav/desktop.tsx:38-73
Timestamp: 2025-06-09T16:08:37.917Z
Learning: In apps/web/src/components/layout/main-nav/desktop.tsx, the user prefers to keep the commented-out `components` array code block even though it appears to be dead code. Do not suggest removing this commented code.

Applied to files:

  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use explicit filtering in GROQ queries (e.g., '_type == "x"'), prefer projection over returning entire documents, use 'order()' for sorting, check for defined fields before accessing, use conditional projections, and add pagination parameters for list queries.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
🧬 Code Graph Analysis (6)
apps/web/src/app/angebot/_sections/groups.tsx (1)
apps/web/src/app/_home/group-card.tsx (1)
  • GroupCard (13-43)
apps/web/src/components/ui/news-article-preview-wide.tsx (1)
apps/web/src/components/ui/news-article-preview.tsx (1)
  • NewsArticlePreview (16-80)
apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (2)
apps/web/src/app/angebot/page.tsx (1)
  • OfferPage (33-47)
apps/web/src/types/sanity.types.ts (1)
  • Groups (15-17)
apps/studio/schemas/single-pages/single-group/index.ts (1)
apps/studio/structure/index.ts (1)
  • getGroupSinglePages (83-111)
apps/web/src/app/angebot/[group]/_sections/group-card.tsx (2)
apps/web/src/app/_home/group-card.tsx (1)
  • GroupCard (13-43)
apps/web/src/app/_home/groups.tsx (1)
  • Groups (16-44)
apps/web/src/types/sanity.types.generated.ts (2)
apps/web/src/types/sanity.types.ts (1)
  • Groups (15-17)
apps/web/src/utils/groups/index.ts (1)
  • GroupSection (19-25)
🪛 GitHub Check: Check
apps/web/src/app/angebot/[group]/page.tsx

[warning] 48-48:
Unexpected console statement. Only these console methods are allowed: info, warn, error

🔇 Additional comments (17)
turbo.json (1)

41-41: Valid JSON cleanup

Trailing comma removed at end of tasks object. JSON remains valid; no functional change. LGTM.

pnpm-workspace.yaml (2)

25-39: Version alignment (Next 15, Sanity 4, client 7) looks consistent

  • next ^15.4.6 matches react 19 already in catalog.
  • @sanity/client ^7.x, sanity ^4.x, next-sanity ^10.x are the expected compatible majors.

No blockers from this set. Proceed.


41-77: Verify Node engine, ESLint/Next.js/Sanity compatibility, and Zod v4 migration

  • Node/tooling
    • Root package.json enforces engines.node >=22.15 with [email protected] – this satisfies the @types/node (^22.17.1) requirement, and child workspaces inherit it.
    • No .nvmrc detected; consider adding one for consistent local setups.

  • ESLint & Next.js
    • Using ESLint 9 with [email protected] and [email protected] against Next 15—ensure your .eslintrc and any Next.js‐specific plugin configs support these major versions and that npm run lint passes in CI.

  • next-sanity v10
    • Imports found in multiple files under apps/web/src/... – confirm you’ve migrated to the v10 API (e.g. updated createClient options, TypeScript types, and any helper functions) and that your Sanity queries still resolve correctly.

  • Zod v4
    • Found import { z } from 'zod' in apps/web/src/components/section/contact-form.tsx – v4 contains breaking changes (schema refinements, transformer signatures, optional/nullish distinctions).
    • Verify all Zod schemas and any @hookform/resolvers/zod integrations use the updated v4 API (e.g. z.string().min(…), updated default issue messages, no deprecated methods).

Overall, engines configuration is correct, but please double-check linting against Next 15, your Sanity client/query migrations, and that every Zod schema/resolver has been updated for v4.

apps/studio/sanity-typegen.json (1)

3-5: apps/studio/sanity-typegen.json — Config order and syntax are valid

No changes required: the reordered keys and trailing commas are acceptable in JSON.

• After updating any Sanity schema, regenerate the TypeScript definitions:

pnpm -w turbo run extract-types

(Or run your repo’s equivalent extract-types script.)

apps/web/sanity-typegen.json (1)

3-5: Sanity types regenerated successfully

The generated types in apps/web/src/types/sanity.types.generated.ts include featuredImage and no longer reference image. No further action is needed.

apps/web/src/lib/sanity/queries/pages/offer-groups.ts (1)

21-21: Correct rename to match schema (imagefeaturedImage).

Matches the updated Sanity schema and generated types.

apps/web/src/app/angebot/[group]/_sections/groups.tsx (1)

33-33: Prop wiring looks good.

Passing currentDepartment to GroupCard aligns with the new single-group flow.

apps/studio/utils/documents/group.tsx (1)

46-47: Adding a required email field is appropriate.

Assuming emailField includes proper Rule.email() validation and helpful description text for editors, this is good.

Please confirm emailField enforces email format and is marked required as per the PR objective.

apps/web/components.json (2)

11-11: LGTM: shadcn config keys and values are consistent.

style: "new-york", tailwind.baseColor: "neutral", and tsx: true are in line with current shadcn/ui conventions.

Also applies to: 13-13, 19-19


3-9: Path Alias Consistency Verified

The aliases defined in apps/web/components.json
(components, hooks, lib, ui, utils → @/…)
are all covered by your tsconfig.json wildcard mapping ("@/*": ["./src/*"]). No further changes needed.

apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (1)

32-47: Contact persons query looks solid

Good filtering by team slug and ordering by last name; minimal projection.

apps/studio/schema.json (2)

845-884: Auto-generated file: ensure changes originate from schema source files

This file is generated. Don’t hand-edit. The added singleGroupPage.content.contactPersonsSection matches the PR intent.


4953-4960: Groups: email added and image renamed to featuredImage

Updates align with web/types. Looks good.

Also applies to: 5059-5141, 5320-5326, 5426-5508, 5687-5693, 5793-5875, 6788-6794, 6894-6976, 7155-7161, 7261-7343

apps/web/src/types/sanity.types.generated.ts (4)

160-167: Typegen for SingleGroupPage content looks correct

Matches schema addition for contactPersonsSection.


870-914: Group types: required email and featuredImage added

These reflect the schema updates. Good.

Also applies to: 945-1002, 1012-1069, 1079-1136, 1146-1203, 1213-1270, 1280-1337


2745-2747: TypeMap still references image in groups query

After updating the query to featuredImage, re-generate types so the TypeMap aligns.


2393-2518: Offer groups (departments) page query results look consistent

Uses featuredImage as expected and matches web components.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🔭 Outside diff range comments (5)
apps/web/src/lib/sanity/queries/pages/offer-groups.ts (1)

35-37: Ensure robust affiliation filtering in offerGroupsPageContactPersonsQuery

The current filter only checks the first affiliation and will miss persons where the matching role appears later in the array. Update the GROQ query to match any affiliation entry:

In apps/web/src/lib/sanity/queries/pages/offer-groups.ts:

-export const offerGroupsPageContactPersonsQuery = defineQuery(`
-  *[_type == 'person'][affiliations[0].role->email == $email] {
-    ${contactPersons}
-  }
-`);
+export const offerGroupsPageContactPersonsQuery = defineQuery(`
+  *[_type == 'person' && count(affiliations[role->email == $email]) > 0] {
+    ${contactPersons}
+  }
+`);

—or— use a predicate:

-export const offerGroupsPageContactPersonsQuery = defineQuery(`
-  *[_type == 'person'][affiliations[0].role->email == $email] {
-    ${contactPersons}
-  }
-`);
+export const offerGroupsPageContactPersonsQuery = defineQuery(`
+  *[_type == 'person' && affiliations[role->email == $email][0] defined] {
+    ${contactPersons}
+  }
+`);

• After updating, regenerate your Sanity types so the generated TS reflects this change.

apps/web/src/app/angebot/[group]/_sections/groups.tsx (1)

24-25: Fix title concatenation that can render “undefined”

Interpolating currentDepartment?.title inside a template string can produce "undefined" when absent. Use a conditional join instead.

- title={`${title} ${currentDepartment?.title}`.trim()}
+ title={[title, currentDepartment?.title].filter(Boolean).join(' ')}
apps/web/src/app/angebot/_sections/group-card.tsx (1)

15-20: alt text + aria-hidden conflict.

If the image is decorative, set alt=""; if informative, drop aria-hidden. Screen-reader suppression plus non-empty alt is contradictory.

-				alt={title}
-
-				aria-hidden
+				alt=""
+
+				aria-hidden
apps/web/src/types/sanity.types.generated.ts (2)

2284-2365: Type misalignment stems from query using image instead of featuredImage.

OfferGroupsGroupPageGroupsQueryResult exposes image, but groups now have featuredImage. Update the query file (offer-groups-group.ts) to request featuredImage and regenerate types.

Would you like me to open a follow-up PR that fixes the query and re-runs typegen?


2480-2518: Update featuredImage fragment to expand nested fields and constrain to ExtendedImage

Right now the shared fragment in apps/web/src/lib/sanity/queries/index.ts just injects the field name, so the TS generator falls back to both MainImage and ExtendedImage variants. Since your schema models featuredImage as ExtendedImage, expanding the fragment removes the unintended mainImage branch and keeps projections consistent:

• apps/web/src/lib/sanity/queries/index.ts

-export const featuredImage = /* groq */ `featuredImage`;
+export const featuredImage = /* groq */ `
+  featuredImage {
+    asset-> {
+      _id,
+      url,
+      metadata {
+        dimensions,
+        lqip
+      }
+    },
+    hotspot,
+    crop,
+    alt,
+    description
+  }
+`;

This change ensures the generated types only include the ExtendedImage variant and simplifies your unions.

🧹 Nitpick comments (12)
apps/studio/schemas/single-pages/single-group/_groups.ts (1)

1-4: Narrow literals for stronger typing

Use as const to preserve literal types for title and name and avoid accidental mutation/mismatch elsewhere.

 export const contactPersons = {
   title: 'Ansprechpartner',
   name: 'contactPersons',
-};
+} as const;
apps/web/src/app/angebot/[group]/page.tsx (1)

48-49: Remove or guard debug log

Avoid unconditional server-side logging in production. Either remove it or guard for dev builds.

Option A — remove:

-	console.log(group);

Option B — dev-only guard:

-	console.log(group);
+	if (process.env.NODE_ENV !== 'production') console.debug('offer group param', group);

Side note: const { group } = await params; above doesn’t need await since params is not a Promise in Next.js route handlers.

apps/studio/schemas/single-pages/single-group/contact-persons.ts (2)

1-1: Prefer Sanity’s built-in LinkIcon over react-icons import.

Using react-icons/ri increases bundle size and breaks the “use Sanity icons first” guideline.

-import { RiLinksLine } from 'react-icons/ri';
+import { LinkIcon } from 'sanity';

10-13: Avoid hard-coding the group name.

Reuse the constant to prevent typos and double-maintenance.

-	group: 'contactPersons',
+	group: contactPersons.name,
apps/studio/schemas/single-pages/single-group/index.ts (2)

1-1: Use Sanity icons where available.

Swap RiBookletLine/RiLinksLine for native icons (DocumentIcon, LinkIcon, etc.) to stay consistent with Sanity UI and avoid extra deps.


31-33: Reference shared constant for group name.

-			group: 'content',
+			group: content.name,

Prevents accidental divergence if the group identifier ever changes.

apps/web/src/app/angebot/[group]/_sections/group-card.tsx (1)

23-25: Minor visual polish: apply rounding to container for consistent corners.

Overlay and image are rounded, container isn’t. Round the article too for consistent edges.

- <article className="relative aspect-video shadow-lg transition-transform duration-200 hover:scale-105">
+ <article className="relative aspect-video rounded-xl shadow-lg transition-transform duration-200 hover:scale-105">

Also applies to: 28-28

apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx (3)

14-18: Unnecessary await on params.

params is a plain object in Next.js App Router; awaiting it is unnecessary and misleading.

-export async function generateMetadata({
-  params,
-}: PageProps<{ singleGroup: string }>): Promise<Metadata> {
-  const { singleGroup } = await params;
+export async function generateMetadata({
+  params,
+}: PageProps<{ singleGroup: string }>): Promise<Metadata> {
+  const { singleGroup } = params;

38-43: Same here: remove unnecessary await on params.

-export default async function GroupsPage({
-  params,
-}: PageProps<{ group: string; singleGroup: string }>) {
-  const { singleGroup } = await params;
+export default async function GroupsPage({
+  params,
+}: PageProps<{ group: string; singleGroup: string }>) {
+  const { singleGroup } = params;

25-35: Consider dynamic metadata from content.

Hard-coded titles are fine for a placeholder, but use CMS data when available for better SEO. Optionally fetch page in generateMetadata or reuse fetched data via a cache/preload.

apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (1)

32-47: Stable ordering for people list.

Sort by lastName then firstName for deterministic output when last names collide.

- ]|order(lastName asc) {
+ ]|order(lastName asc, firstName asc) {
apps/studio/schema.json (1)

845-884: Reminder: schema.json is generated — don’t edit by hand.

Looks like legitimate generated changes (new content.contactPersonsSection). Ensure these originate from TS schema sources; avoid manual edits here.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 731426e and 6e0684f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • apps/studio/sanity-typegen.json (1 hunks)
  • apps/studio/schema.json (15 hunks)
  • apps/studio/schemas/documents/person.ts (0 hunks)
  • apps/studio/schemas/single-pages/single-group.ts (0 hunks)
  • apps/studio/schemas/single-pages/single-group/_groups.ts (1 hunks)
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts (1 hunks)
  • apps/studio/schemas/single-pages/single-group/index.ts (1 hunks)
  • apps/studio/utils/documents/group.tsx (3 hunks)
  • apps/web/components.json (1 hunks)
  • apps/web/sanity-typegen.json (1 hunks)
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx (1 hunks)
  • apps/web/src/app/angebot/[group]/_sections/group-card.module.css (0 hunks)
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx (2 hunks)
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx (1 hunks)
  • apps/web/src/app/angebot/[group]/page.tsx (1 hunks)
  • apps/web/src/app/angebot/_sections/group-card.tsx (2 hunks)
  • apps/web/src/app/angebot/_sections/groups.tsx (1 hunks)
  • apps/web/src/components/ui/news-article-preview-wide.tsx (1 hunks)
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (1 hunks)
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts (1 hunks)
  • apps/web/src/types/sanity.types.generated.ts (19 hunks)
  • pnpm-workspace.yaml (5 hunks)
  • turbo.json (1 hunks)
💤 Files with no reviewable changes (3)
  • apps/studio/schemas/single-pages/single-group.ts
  • apps/studio/schemas/documents/person.ts
  • apps/web/src/app/angebot/[group]/_sections/group-card.module.css
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/any-inside-generic-functions.mdc)

**/*.{ts,tsx}: When building generic functions in TypeScript, it is acceptable to use any inside the function body if TypeScript cannot match runtime logic to type logic.
Outside of generic functions, use any extremely sparingly in TypeScript code.

Unless explicitly required by the framework, do not use default exports in TypeScript files.

**/*.{ts,tsx}: Use TypeScript for all code. Prefer interfaces over types.
Follow the ESLint rules.
Use 'function' keyword for pure functions.
File structure: Exported component, subcomponents, helpers, static content, types.
Avoid unnecessary curly braces in conditional statements.
For single-line statements in conditionals, omit curly braces.
Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
Handle errors and edge cases at the beginning of functions.
Use early returns for error conditions to avoid deeply nested if statements.
Place the happy path last in the function for improved readability.
Avoid unnecessary else statements; use if-return pattern instead.
Use guard clauses to handle preconditions and invalid states early.
Implement proper error logging and user-friendly error messages.
Consider using custom error types or error factories for consistent error handling.
Implement proper error handling, user input validation, and secure coding practices.
Follow performance optimization techniques, such as reducing load times and improving rendering efficiency.
Provide clear and concise comments for complex logic.
Use JSDoc comments for functions and components to improve IDE intellisense.

**/*.{ts,tsx}: Proactively use discriminated unions to model data that can be in one of a few different shapes in TypeScript.
Use switch statements to handle the results of discriminated unions in TypeScript.
Use discriminated unions to prevent the 'bag of optionals' problem in TypeScript, especially when modeling state objects.

**/*.{ts,tsx}: Do not introduce new enums into the c...

Files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/studio/schemas/single-pages/single-group/_groups.ts
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/studio/utils/documents/group.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
  • apps/web/src/types/sanity.types.generated.ts
**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/*.tsx: Use functional components and TypeScript interfaces in React/Next.js code
Use declarative JSX in React components
Use function, not const, for component declarations
Favor named exports for components
Use Shadcn UI and Tailwind CSS for components and styling
Implement responsive design with Tailwind CSS using a mobile-first approach
Place static content and interfaces at the end of the file
Use content variables for static content outside render functions
Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
Use Zod for form validation
Wrap client components in Suspense with fallback
Use dynamic loading for non-critical components
Implement dynamic imports for code splitting and optimization
Optimize images: use WebP format, size data, lazy loading, and the next/image component
Use useActionState with react-hook-form for form validation
Break down components into smaller parts with minimal props
Suggest micro folder structure for components
Use composition to build complex components
Follow the order: component declaration, then TypeScript types
Use React Server Components for data fetching when possible
Implement the preload pattern to prevent waterfalls
Use Tailwind CSS for styling, following the Utility First approach
Utilize the Class Variance Authority (CVA) for managing component variants
Ensure interfaces are keyboard navigable
Implement proper ARIA labels and roles for components
Ensure color contrast ratios meet WCAG standards for readability

Files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/studio/utils/documents/group.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
**/*.ts

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/*.ts: Model expected errors as return values; avoid using try/catch for expected errors in Server Actions
Use next-safe-action for all server actions
Implement type-safe server actions with proper validation
Handle errors gracefully and return appropriate responses

Files:

  • apps/studio/schemas/single-pages/single-group/_groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
**/{queries,groq}/**/*.ts

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/{queries,groq}/**/*.ts: Import defineQuery and groq from next-sanity at the top of GROQ query files
Export queries as constants using the defineQuery function
Organize queries by content type (blogs, pages, products, etc.) and group related queries together
Whenever there is an image within a GROQ query, do not expand it unless explicitly instructed to do so

Files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
🧠 Learnings (64)
📓 Common learnings
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When producing schema from screenshots, use the Sanity schema format, include descriptions based on visual elements, and map visual cues (e.g., tiny text above a title is an eyebrow, large text is a title, formatted text is richText, images require alt text, and button arrays should be reused).
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use Shadcn UI and Tailwind CSS for components and styling

Applied to files:

  • turbo.json
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/components.json
  • pnpm-workspace.yaml
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : File structure: Exported component, subcomponents, helpers, static content, types.

Applied to files:

  • turbo.json
  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
📚 Learning: 2025-06-09T16:08:42.643Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/app/angebote/page.tsx:26-28
Timestamp: 2025-06-09T16:08:42.643Z
Learning: The user (mheob) prefers to keep TODO comments as-is in apps/web/src/app/angebote/page.tsx and doesn't want suggestions to improve error handling for basic null checks with TODO comments in this context.

Applied to files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Organize queries by content type (blogs, pages, products, etc.) and group related queries together

Applied to files:

  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.{ts,tsx} : Provide clear and concise comments for complex logic

Applied to files:

  • apps/web/src/app/angebot/[group]/page.tsx
📚 Learning: 2025-06-19T13:37:14.734Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#204
File: apps/studio/schema.json:4505-4529
Timestamp: 2025-06-19T13:37:14.734Z
Learning: The `apps/studio/schema.json` file in Sanity projects is auto-generated and should not be manually edited. Schema changes should be made in the source TypeScript schema definition files.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
  • apps/web/components.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/studio/schema.json
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: After adding new Sanity schema, run the type generation command ('nr extract-types') to generate TypeScript definitions.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When creating Sanity schema in TypeScript files, always import the necessary Sanity types: 'defineField', 'defineType', and 'defineArrayMember' (only if needed) from 'sanity'.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • pnpm-workspace.yaml
  • apps/studio/utils/documents/group.tsx
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-22T05:21:22.143Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#205
File: apps/studio/schema.json:195-394
Timestamp: 2025-06-22T05:21:22.143Z
Learning: Die Datei `apps/studio/schema.json` ist automatisch generiert und darf nicht manuell geändert werden.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schema.json
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Follow the ESLint rules.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:09:28.798Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-08-03T10:09:28.798Z
Learning: Applies to **/*.{config.ts,test.ts,context.tsx,type.ts,hook.ts} : File extensions: Use `.config.ts`, `.test.ts`, `.context.tsx`, `.type.ts`, `.hook.ts` as appropriate

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
  • pnpm-workspace.yaml
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript for all code. Prefer interfaces over types.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
📚 Learning: 2025-08-03T10:09:18.141Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/jsdoc-comments.mdc:0-0
Timestamp: 2025-08-03T10:09:18.141Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments to annotate functions and types.

Applied to files:

  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Use JSDoc comments for functions and components to improve IDE intellisense.

Applied to files:

  • apps/studio/sanity-typegen.json
📚 Learning: 2025-08-03T10:09:28.798Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-08-03T10:09:28.798Z
Learning: Applies to **/*.{ts,tsx} : Avoid magic numbers and define constants

Applied to files:

  • apps/studio/schemas/single-pages/single-group/_groups.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Import defineQuery and groq from next-sanity at the top of GROQ query files

Applied to files:

  • apps/web/sanity-typegen.json
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • pnpm-workspace.yaml
  • apps/studio/utils/documents/group.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Implement responsive design with Tailwind CSS using a mobile-first approach

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/components.json
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Optimize images: use WebP format, size data, lazy loading, and the next/image component

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • pnpm-workspace.yaml
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Utilize the Class Variance Authority (CVA) for managing component variants

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Implement proper ARIA labels and roles for components

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Break down components into smaller parts with minimal props

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Ensure color contrast ratios meet WCAG standards for readability

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Optimize images in Next.js by using the next/image component, WebP format, specifying size data, and enabling lazy loading for improved performance.

Applied to files:

  • apps/web/src/components/ui/news-article-preview-wide.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use Tailwind CSS for styling, following the Utility First approach

Applied to files:

  • apps/web/components.json
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Suggest micro folder structure for components

Applied to files:

  • apps/web/components.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Follow the order: component declaration, then TypeScript types

Applied to files:

  • apps/web/components.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Place static content and interfaces at the end of the file

Applied to files:

  • apps/web/components.json
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)

Applied to files:

  • apps/web/components.json
  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use functional components and TypeScript interfaces in React/Next.js code

Applied to files:

  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • pnpm-workspace.yaml
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use composition to build complex components

Applied to files:

  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Favor named exports for components

Applied to files:

  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Whenever there is an image within a GROQ query, do not expand it unless explicitly instructed to do so

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Export queries as constants using the defineQuery function

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2024-12-16T17:10:23.283Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#134
File: apps/web/src/lib/sanity/queries/shared/news.ts:5-14
Timestamp: 2024-12-16T17:10:23.283Z
Learning: All fields in the `newsArticle` query in `apps/web/src/lib/sanity/queries/shared/news.ts` are required and can be safely assumed to exist without null checks.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Organize GROQ queries by content type and group related queries together for maintainability.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use template literals for GROQ query strings, indent nested structures for readability, keep related query parts together, maintain consistent whitespace and indentation, and use comments to explain complex logic.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Export TypeScript interfaces for GROQ query responses when needed, using descriptive types that match the query structure.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: In GROQ queries, do not expand images unless explicitly instructed to do so.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use function, not const, for component declarations

Applied to files:

  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:09:28.798Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-08-03T10:09:28.798Z
Learning: Applies to **/*.{ts,tsx} : Use ALL_CAPS (CONSTANT_CASE) for constants and enum values (e.g., `MAX_COUNT`, `Color.RED`)

Applied to files:

  • apps/web/src/app/angebot/_sections/groups.tsx
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Always use 'defineField' for every field and 'defineType' for the schema type in Sanity TypeScript schemas.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/studio/utils/documents/group.tsx
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: In Sanity schemas, always include a title, name, description, and type for each field. The description should be in simple German for non-technical users.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/studio/utils/documents/group.tsx
📚 Learning: 2025-06-09T16:12:07.501Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/components/ui/form/use-form-field.ts:18-28
Timestamp: 2025-06-09T16:12:07.501Z
Learning: In the TSG Irlich web project, when reviewing form-related error handling in use-form-field.ts, the user prefers not to add additional context validation checks beyond the existing fieldContext check, even if itemContext access could potentially cause runtime errors.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When adding icons to a Sanity schema, use the default 'sanity/icons' first, and only use other icon sets (e.g., lucide-react, react-icons/ri) if no relevant icon exists. Icons should always be named exports.

Applied to files:

  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • pnpm-workspace.yaml
  • apps/studio/utils/documents/group.tsx
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When producing schema from screenshots, use the Sanity schema format, include descriptions based on visual elements, and map visual cues (e.g., tiny text above a title is an eyebrow, large text is a title, formatted text is richText, images require alt text, and button arrays should be reused).

Applied to files:

  • apps/studio/schemas/single-pages/single-group/index.ts
📚 Learning: 2025-08-03T10:08:46.583Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/import-type.mdc:0-0
Timestamp: 2025-08-03T10:08:46.583Z
Learning: Applies to **/*.{ts,tsx} : Prefer top-level `import type` over inline `import { type ... }` in TypeScript files

Applied to files:

  • apps/web/src/app/angebot/_sections/group-card.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Refer to Next.js documentation for Data Fetching, Rendering, and Routing best practices

Applied to files:

  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
📚 Learning: 2025-06-13T16:38:06.852Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#197
File: pnpm-workspace.yaml:10-10
Timestamp: 2025-06-13T16:38:06.852Z
Learning: pnpm added support for the `catalogMode` setting (values such as `prefer`) beginning with version 10.12.1, so this key is valid in `pnpm-workspace.yaml` when using that or newer versions.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:04:04.084Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#214
File: package.json:47-50
Timestamp: 2025-08-03T10:04:04.084Z
Learning: The pnpm/action-setup GitHub Action automatically reads the packageManager field from package.json to determine the correct pnpm version when no explicit version is specified in the workflow. This requires an exact version format like "pnpmx.y.z" in the packageManager field, making manual version pinning in workflows unnecessary and allowing version management directly from the project manifest.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:04:04.084Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#214
File: package.json:47-50
Timestamp: 2025-08-03T10:04:04.084Z
Learning: The pnpm/action-setup GitHub Action automatically reads the packageManager field from package.json to determine the correct pnpm version when no explicit version is specified in the workflow, making manual version pinning unnecessary.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:09:08.245Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/installing-libraries.mdc:0-0
Timestamp: 2025-08-03T10:09:08.245Z
Learning: When installing libraries, do not rely on your own training data; instead of picking a version manually (via updating the package.json file), use a script (e.g., pnpm/yarn/npm add) to install the latest version of a library.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Use Tailwind CSS, Shadcn UI, and Radix UI for consistent, modern, and responsive UI design.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Minimize the use of 'use client', useEffect, and setState in Next.js 15+; favor React Server Components (RSC) and SSR features for better performance and scalability.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Use Sanity as a headless CMS to fetch and manage content, leveraging its flexibility and scalability.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-03-19T10:27:11.409Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#176
File: apps/studio/package.json:25-25
Timestamp: 2025-03-19T10:27:11.409Z
Learning: The update of sanity-plugin-media from version 2.x to 3.x doesn't cause issues for the TSG Irlich web project, as confirmed by the developer after research.

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use Zod for form validation

Applied to files:

  • pnpm-workspace.yaml
📚 Learning: 2025-06-09T16:08:32.469Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/components/ui/form/form-context.ts:17-17
Timestamp: 2025-06-09T16:08:32.469Z
Learning: In apps/web/src/components/ui/form/form-context.ts, the team prefers to use type assertion on empty objects for React context default values (e.g., `{} as FormFieldContextValue`) rather than providing safer defaults with actual properties.

Applied to files:

  • apps/studio/utils/documents/group.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use useActionState with react-hook-form for form validation

Applied to files:

  • apps/studio/utils/documents/group.tsx
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: For GROQ query files, always import 'defineQuery' and 'groq' from 'next-sanity' at the top, and export queries as constants using 'defineQuery'.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use camelCase for all GROQ query names, prefix with an action verb (get, getAll, etc.), and suffix with 'Query'. Reusable fragments should be prefixed with an underscore.

Applied to files:

  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-09T16:08:37.917Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/components/layout/main-nav/desktop.tsx:38-73
Timestamp: 2025-06-09T16:08:37.917Z
Learning: In apps/web/src/components/layout/main-nav/desktop.tsx, the user prefers to keep the commented-out `components` array code block even though it appears to be dead code. Do not suggest removing this commented code.

Applied to files:

  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use explicit filtering in GROQ queries (e.g., '_type == "x"'), prefer projection over returning entire documents, use 'order()' for sorting, check for defined fields before accessing, use conditional projections, and add pagination parameters for list queries.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
🧬 Code Graph Analysis (6)
apps/web/src/components/ui/news-article-preview-wide.tsx (1)
apps/web/src/components/ui/news-article-preview.tsx (1)
  • NewsArticlePreview (16-80)
apps/web/src/app/angebot/_sections/groups.tsx (1)
apps/web/src/app/angebot/[group]/_sections/group-card.tsx (1)
  • GroupCard (14-64)
apps/studio/schemas/single-pages/single-group/contact-persons.ts (1)
apps/studio/shared/fields/general.ts (1)
  • getDefaultPageSectionFieldsWithGroup (64-68)
apps/studio/schemas/single-pages/single-group/index.ts (5)
apps/studio/shared/field-groups.ts (3)
  • general (21-24)
  • meta (26-29)
  • content (11-14)
apps/studio/shared/fields/general.ts (1)
  • defaultHeroFields (60-60)
apps/studio/shared/fields/meta.ts (1)
  • metaField (13-18)
apps/studio/schemas/single-pages/single-group/_groups.ts (1)
  • contactPersons (1-4)
apps/studio/schemas/single-pages/single-group/contact-persons.ts (1)
  • contactPersonsField (6-14)
apps/studio/utils/documents/group.tsx (2)
apps/studio/utils/fields.ts (1)
  • getFieldWithoutGroup (29-33)
apps/studio/shared/fields/contact.ts (1)
  • emailField (13-19)
apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (2)
apps/web/src/app/angebot/page.tsx (1)
  • OfferPage (33-47)
apps/web/src/types/sanity.types.ts (1)
  • Groups (15-17)
🔇 Additional comments (13)
turbo.json (1)

41-41: Config cleanup looks good

Closing the tasks object without a trailing comma keeps the JSON valid and consistent. No functional impact here.

apps/web/sanity-typegen.json (1)

3-5: Typegen config reordering is fine

overloadClientMethods, path, and schema look correct for the web app. Remember to regenerate types after schema updates (e.g., nr extract-types) so sanity.types.generated.ts reflects the latest schema.

apps/studio/sanity-typegen.json (1)

3-5: Studio typegen config is valid

Ordering and values look good. schema.json is auto-generated by Sanity; don’t edit it manually. Regenerate types after schema changes to keep Studio types in sync.

apps/web/src/app/angebot/_sections/groups.tsx (1)

21-21: Icon fallback removal is safe

The groupSections array in apps/web/src/utils/groups/index.ts is a static, fully-defined list where every entry includes a non-optional icon (enforced by the GroupSection type). Passing icon directly into GroupCard therefore won’t produce an undefined or empty icon at runtime—no fallback is needed here.

apps/web/src/lib/sanity/queries/pages/offer-groups.ts (1)

21-21: LGTM: Use featuredImage instead of image

Field rename aligns with schema and keeps the image unexpanded, matching our Groq guideline.

apps/web/src/app/angebot/[group]/_sections/groups.tsx (1)

33-33: Prop passthrough LGTM; URL composition verified

The GroupCard’s Link uses

href={`${currentDepartment?.slug ?? ''}/${slug}`}

which yields /slug when currentDepartment is undefined and deptSlug/groupSlug when present—no double slashes under standard slug formats.

apps/studio/utils/documents/group.tsx (1)

46-47: Good addition: required email field, ungrouped

Using getFieldWithoutGroup(emailField) keeps the editor UI flat here and enforces presence. Aligns with the PR objective to support contact person lookups.

apps/web/components.json (1)

3-19: No functional impact identified—re-ordering only.
Key order changes don’t affect runtime; configuration still conforms to Shadcn schema.

pnpm-workspace.yaml (1)

25-77: Confirm dependency matrix after version bumps.

Several Sanity packages now differ in minor versions (@sanity/assist 4.4 vs sanity 4.3). Verify peer-dependency warnings don’t appear after pnpm install.

apps/studio/schema.json (1)

4953-4960: Schema updates LGTM (email required, image→featuredImage).

Required email and featuredImage across group docs align with the app/types. No issues spotted.

Also applies to: 5059-5141, 5320-5326, 5426-5508, 5688-5693, 5793-5875, 6422-6427, 6527-6609, 6789-6794, 6894-6976, 7156-7161, 7261-7343

apps/web/src/types/sanity.types.generated.ts (3)

160-167: SingleGroupPage content type addition looks correct.

content.contactPersonsSection matches studio schema; fine.


870-914: Group types updated as expected (email required, featuredImage).

Generated types reflect schema changes; good.

Also applies to: 937-1002, 1004-1069, 1071-1136, 1138-1203, 1205-1270, 1272-1337


2745-2750: Query TypeMap inconsistency (image vs featuredImage).

The registered query still selects image. Align it with featuredImage to avoid runtime/type errors, then regenerate.

Expected registration after fix:

"\n\t*[_type == $groupType] | order(sortOrder asc) {\n\t\ticon,\n\t\tfeaturedImage,\n\t\toverviewTitle,\n\t\t'slug': slug.current,\n\t\ttitle,\n\t}\n": OfferGroupsGroupPageGroupsQueryResult;
⛔ Skipped due to learnings
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Organize queries by content type (blogs, pages, products, etc.) and group related queries together
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Whenever there is an image within a GROQ query, do not expand it unless explicitly instructed to do so
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Organize GROQ queries by content type and group related queries together for maintainability.
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Export queries as constants using the defineQuery function
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Export TypeScript interfaces for GROQ query responses when needed, using descriptive types that match the query structure.
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Import defineQuery and groq from next-sanity at the top of GROQ query files
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: In GROQ queries, do not expand images unless explicitly instructed to do so.
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use explicit filtering in GROQ queries (e.g., '_type == "x"'), prefer projection over returning entire documents, use 'order()' for sorting, check for defined fields before accessing, use conditional projections, and add pagination parameters for list queries.
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use camelCase for all GROQ query names, prefix with an action verb (get, getAll, etc.), and suffix with 'Query'. Reusable fragments should be prefixed with an underscore.
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use template literals for GROQ query strings, indent nested structures for readability, keep related query parts together, maintain consistent whitespace and indentation, and use comments to explain complex logic.

@mheob mheob force-pushed the 200-create-groups-page branch from 6e0684f to 9843ada Compare August 9, 2025 13:14
Copy link

sonarqubecloud bot commented Aug 9, 2025

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (2)
apps/web/src/types/sanity.types.generated.ts (2)

2284-2365: offerGroupsGroupPageGroupsQuery still selects image instead of featuredImage.

Schema now exposes featuredImage. Projecting image will be null and cause brittle union types. Update the query to project featuredImage instead, then regenerate types.

Apply in apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts:

- *[_type == $groupType][] | order(sortOrder asc) {
-   icon,
-   image,
-   overviewTitle,
-   'slug': slug.current,
-   title,
- }
+ *[_type == $groupType][] | order(sortOrder asc) {
+   icon,
+   featuredImage,
+   overviewTitle,
+   'slug': slug.current,
+   title,
+ }

Then run: sanity typegen generate


2424-2518: Normalize featuredImage field across schemas

The generated OfferGroupsPageGroupsQueryResult is unioning both extendedImage (from group docs) and mainImage (from the shared excerpt field), because we have two different featuredImage definitions:

  • apps/studio/utils/documents/group.tsx
    defineField({ name: 'featuredImage', type: 'extendedImage', … })
  • apps/studio/shared/fields/excerpt.ts
    defineField({ name: 'featuredImage', type: 'mainImage', … })

This collision causes the TS generator to produce a broad union for any query that selects featuredImage. To fix:

• Rename the excerpt/shared field (e.g. to thumbnail or articleImage) in
apps/studio/shared/fields/excerpt.ts (and all its uses in news schemas and queries)
• Update any queries and generated types that reference the old featuredImage in excerpt contexts
• Leave the group document’s featuredImage as extendedImage and confirm your page queries still select featuredImage

After these changes, regenerate your types to ensure OfferGroupsPageGroupsQueryResult only includes the extendedImage shape.

🧹 Nitpick comments (5)
apps/web/src/app/news/[category]/page.tsx (1)

75-79: Use notFound only; drop unreachable return null.

notFound() throws a special error; the subsequent return null is dead code. Remove it for clarity.

-  const { notFound } = await import('next/navigation');
-  notFound();
-  return null;
+  const { notFound } = await import('next/navigation');
+  notFound();
apps/web/src/app/page.tsx (1)

35-39: Use notFound only; drop unreachable return null.

notFound() already ends execution. Removing return null keeps the pattern concise.

-  const { notFound } = await import('next/navigation');
-  notFound();
-  return null;
+  const { notFound } = await import('next/navigation');
+  notFound();
apps/web/src/app/angebot/page.tsx (1)

36-40: Use notFound only; drop unreachable return null.

Same pattern: return null after notFound() is never reached.

-  const { notFound } = await import('next/navigation');
-  notFound();
-  return null;
+  const { notFound } = await import('next/navigation');
+  notFound();
apps/web/src/app/kontakt/page.tsx (1)

21-25: Remove unreachable return null after notFound()

notFound() throws and is typed as never in Next.js App Router. The subsequent return null is unreachable and can be dropped.

-  if (!page) {
-    const { notFound } = await import('next/navigation');
-    notFound();
-    return null;
-  }
+  if (!page) {
+    const { notFound } = await import('next/navigation');
+    notFound();
+  }
apps/web/src/app/news/[category]/[slug]/page.tsx (1)

56-60: Drop redundant return null after notFound()

notFound() throws (return type never), so the explicit return null is unreachable and unnecessary.

-  if (!article || !hero) {
-    const { notFound } = await import('next/navigation');
-    notFound();
-    return null;
-  }
+  if (!article || !hero) {
+    const { notFound } = await import('next/navigation');
+    notFound();
+  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6e0684f and 9843ada.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (29)
  • .cspell.json (2 hunks)
  • apps/studio/sanity-typegen.json (1 hunks)
  • apps/studio/schema.json (15 hunks)
  • apps/studio/schemas/documents/person.ts (0 hunks)
  • apps/studio/schemas/single-pages/single-group.ts (0 hunks)
  • apps/studio/schemas/single-pages/single-group/_groups.ts (1 hunks)
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts (1 hunks)
  • apps/studio/schemas/single-pages/single-group/index.ts (1 hunks)
  • apps/studio/utils/documents/group.tsx (3 hunks)
  • apps/web/components.json (1 hunks)
  • apps/web/sanity-typegen.json (1 hunks)
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx (1 hunks)
  • apps/web/src/app/angebot/[group]/_sections/group-card.module.css (0 hunks)
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx (2 hunks)
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx (1 hunks)
  • apps/web/src/app/angebot/[group]/page.tsx (2 hunks)
  • apps/web/src/app/angebot/_sections/group-card.tsx (1 hunks)
  • apps/web/src/app/angebot/_sections/groups.tsx (1 hunks)
  • apps/web/src/app/angebot/page.tsx (1 hunks)
  • apps/web/src/app/kontakt/page.tsx (1 hunks)
  • apps/web/src/app/news/[category]/[slug]/page.tsx (1 hunks)
  • apps/web/src/app/news/[category]/page.tsx (1 hunks)
  • apps/web/src/app/page.tsx (1 hunks)
  • apps/web/src/components/ui/news-article-preview-wide.tsx (1 hunks)
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts (1 hunks)
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts (1 hunks)
  • apps/web/src/types/sanity.types.generated.ts (19 hunks)
  • pnpm-workspace.yaml (5 hunks)
  • turbo.json (1 hunks)
💤 Files with no reviewable changes (3)
  • apps/web/src/app/angebot/[group]/_sections/group-card.module.css
  • apps/studio/schemas/single-pages/single-group.ts
  • apps/studio/schemas/documents/person.ts
✅ Files skipped from review due to trivial changes (1)
  • turbo.json
🚧 Files skipped from review as they are similar to previous changes (18)
  • apps/studio/schemas/single-pages/single-group/_groups.ts
  • apps/web/src/components/ui/news-article-preview-wide.tsx
  • apps/studio/sanity-typegen.json
  • apps/web/sanity-typegen.json
  • apps/studio/utils/documents/group.tsx
  • apps/web/src/app/angebot/[group]/page.tsx
  • apps/web/src/app/angebot/_sections/groups.tsx
  • apps/web/src/app/angebot/[group]/_sections/group-card.tsx
  • apps/web/src/app/angebot/[group]/_sections/groups.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups.ts
  • apps/studio/schemas/single-pages/single-group/contact-persons.ts
  • apps/web/components.json
  • apps/web/src/app/angebot/_sections/group-card.tsx
  • apps/studio/schemas/single-pages/single-group/index.ts
  • apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx
  • apps/web/src/lib/sanity/queries/pages/offer-groups-group.ts
  • pnpm-workspace.yaml
  • apps/studio/schema.json
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}

📄 CodeRabbit Inference Engine (.cursor/rules/any-inside-generic-functions.mdc)

**/*.{ts,tsx}: When building generic functions in TypeScript, it is acceptable to use any inside the function body if TypeScript cannot match runtime logic to type logic.
Outside of generic functions, use any extremely sparingly in TypeScript code.

Unless explicitly required by the framework, do not use default exports in TypeScript files.

**/*.{ts,tsx}: Use TypeScript for all code. Prefer interfaces over types.
Follow the ESLint rules.
Use 'function' keyword for pure functions.
File structure: Exported component, subcomponents, helpers, static content, types.
Avoid unnecessary curly braces in conditional statements.
For single-line statements in conditionals, omit curly braces.
Use concise, one-line syntax for simple conditional statements (e.g., if (condition) doSomething()).
Handle errors and edge cases at the beginning of functions.
Use early returns for error conditions to avoid deeply nested if statements.
Place the happy path last in the function for improved readability.
Avoid unnecessary else statements; use if-return pattern instead.
Use guard clauses to handle preconditions and invalid states early.
Implement proper error logging and user-friendly error messages.
Consider using custom error types or error factories for consistent error handling.
Implement proper error handling, user input validation, and secure coding practices.
Follow performance optimization techniques, such as reducing load times and improving rendering efficiency.
Provide clear and concise comments for complex logic.
Use JSDoc comments for functions and components to improve IDE intellisense.

**/*.{ts,tsx}: Proactively use discriminated unions to model data that can be in one of a few different shapes in TypeScript.
Use switch statements to handle the results of discriminated unions in TypeScript.
Use discriminated unions to prevent the 'bag of optionals' problem in TypeScript, especially when modeling state objects.

**/*.{ts,tsx}: Do not introduce new enums into the c...

Files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
  • apps/web/src/types/sanity.types.generated.ts
**/*.tsx

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/*.tsx: Use functional components and TypeScript interfaces in React/Next.js code
Use declarative JSX in React components
Use function, not const, for component declarations
Favor named exports for components
Use Shadcn UI and Tailwind CSS for components and styling
Implement responsive design with Tailwind CSS using a mobile-first approach
Place static content and interfaces at the end of the file
Use content variables for static content outside render functions
Minimize 'use client', 'useEffect', and 'setState'; favor React Server Components (RSC)
Use Zod for form validation
Wrap client components in Suspense with fallback
Use dynamic loading for non-critical components
Implement dynamic imports for code splitting and optimization
Optimize images: use WebP format, size data, lazy loading, and the next/image component
Use useActionState with react-hook-form for form validation
Break down components into smaller parts with minimal props
Suggest micro folder structure for components
Use composition to build complex components
Follow the order: component declaration, then TypeScript types
Use React Server Components for data fetching when possible
Implement the preload pattern to prevent waterfalls
Use Tailwind CSS for styling, following the Utility First approach
Utilize the Class Variance Authority (CVA) for managing component variants
Ensure interfaces are keyboard navigable
Implement proper ARIA labels and roles for components
Ensure color contrast ratios meet WCAG standards for readability

Files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
**/*.ts

📄 CodeRabbit Inference Engine (.cursor/rules/frontend-web-development.mdc)

**/*.ts: Model expected errors as return values; avoid using try/catch for expected errors in Server Actions
Use next-safe-action for all server actions
Implement type-safe server actions with proper validation
Handle errors gracefully and return appropriate responses

Files:

  • apps/web/src/types/sanity.types.generated.ts
🧠 Learnings (32)
📓 Common learnings
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When producing schema from screenshots, use the Sanity schema format, include descriptions based on visual elements, and map visual cues (e.g., tiny text above a title is an eyebrow, large text is a title, formatted text is richText, images require alt text, and button arrays should be reused).
📚 Learning: 2025-06-09T16:08:42.643Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#196
File: apps/web/src/app/angebote/page.tsx:26-28
Timestamp: 2025-06-09T16:08:42.643Z
Learning: The user (mheob) prefers to keep TODO comments as-is in apps/web/src/app/angebote/page.tsx and doesn't want suggestions to improve error handling for basic null checks with TODO comments in this context.

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-08-09T13:04:46.926Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#218
File: apps/web/src/app/angebot/[group]/[singleGroup]/page.tsx:38-46
Timestamp: 2025-08-09T13:04:46.926Z
Learning: In Next.js page components in the mheob/tsg-irlich-web repository, the user (mheob) prefers to keep `await params` even when unnecessary, especially in work-in-progress files. Do not suggest removing `await` from params destructuring in page components.

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2024-12-16T17:03:48.446Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#134
File: apps/web/src/app/news/fetch-data.ts:4-7
Timestamp: 2024-12-16T17:03:48.446Z
Learning: In `apps/web/src/app/news/fetch-data.ts`, the `FetchNextPageParams` interface has optional parameters `lastId?: string` and `lastUpdatedAt?: string`, and it's acceptable for these parameters to remain optional even though the function requires both parameters to fetch data.

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use functional components and TypeScript interfaces in React/Next.js code

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Implement dynamic imports for code splitting and optimization

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Use guard clauses to handle preconditions and invalid states early.

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Refer to Next.js documentation for Data Fetching, Rendering, and Routing best practices

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{error,global-error}.tsx : Use error boundaries for unexpected errors: implement error boundaries using error.tsx and global-error.tsx files

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Consider using custom error types or error factories for consistent error handling.

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Handle errors and edge cases at the beginning of functions.

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Rely on Next.js App Router for state changes and routing

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Wrap client components in Suspense with fallback

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Minimize the use of 'use client', useEffect, and setState in Next.js 15+; favor React Server Components (RSC) and SSR features for better performance and scalability.

Applied to files:

  • apps/web/src/app/kontakt/page.tsx
  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2024-12-16T17:10:23.283Z
Learnt from: mheob
PR: mheob/tsg-irlich-web#134
File: apps/web/src/lib/sanity/queries/shared/news.ts:5-14
Timestamp: 2024-12-16T17:10:23.283Z
Learning: All fields in the `newsArticle` query in `apps/web/src/lib/sanity/queries/shared/news.ts` are required and can be safely assumed to exist without null checks.

Applied to files:

  • apps/web/src/app/news/[category]/page.tsx
  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : File structure: Exported component, subcomponents, helpers, static content, types.

Applied to files:

  • apps/web/src/app/news/[category]/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Use React Server Components for data fetching when possible

Applied to files:

  • apps/web/src/app/news/[category]/[slug]/page.tsx
  • apps/web/src/app/page.tsx
📚 Learning: 2025-08-03T10:09:28.798Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/naming-conventions.mdc:0-0
Timestamp: 2025-08-03T10:09:28.798Z
Learning: Applies to **/*.{ts,tsx} : Use complete words instead of abbreviations and correct spelling, except for standard and well-known abbreviations (API, URL, i, j, idx, err, ctx, req, res, next, props, utils)

Applied to files:

  • .cspell.json
📚 Learning: 2025-06-26T02:11:06.767Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .windsurfrules:0-0
Timestamp: 2025-06-26T02:11:06.767Z
Learning: Implement dynamic imports in Next.js to enable code splitting and optimize bundle size.

Applied to files:

  • apps/web/src/app/page.tsx
📚 Learning: 2025-07-19T10:58:27.512Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/default-typescript.mdc:0-0
Timestamp: 2025-07-19T10:58:27.512Z
Learning: Applies to **/*.{ts,tsx} : Place the happy path last in the function for improved readability.

Applied to files:

  • apps/web/src/app/angebot/page.tsx
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Organize queries by content type (blogs, pages, products, etc.) and group related queries together

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Organize GROQ queries by content type and group related queries together for maintainability.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: When creating Sanity schema in TypeScript files, always import the necessary Sanity types: 'defineField', 'defineType', and 'defineArrayMember' (only if needed) from 'sanity'.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/*.tsx : Optimize images: use WebP format, size data, lazy loading, and the next/image component

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Export queries as constants using the defineQuery function

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Export TypeScript interfaces for GROQ query responses when needed, using descriptive types that match the query structure.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Import defineQuery and groq from next-sanity at the top of GROQ query files

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: For GROQ query files, always import 'defineQuery' and 'groq' from 'next-sanity' at the top, and export queries as constants using 'defineQuery'.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-08-03T10:08:42.057Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/frontend-web-development.mdc:0-0
Timestamp: 2025-08-03T10:08:42.057Z
Learning: Applies to **/{queries,groq}/**/*.ts : Whenever there is an image within a GROQ query, do not expand it unless explicitly instructed to do so

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use template literals for GROQ query strings, indent nested structures for readability, keep related query parts together, maintain consistent whitespace and indentation, and use comments to explain complex logic.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use explicit filtering in GROQ queries (e.g., '_type == "x"'), prefer projection over returning entire documents, use 'order()' for sorting, check for defined fields before accessing, use conditional projections, and add pagination parameters for list queries.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
📚 Learning: 2025-06-26T02:10:33.102Z
Learnt from: CR
PR: mheob/tsg-irlich-web#0
File: .cursor/rules/sanity.mdc:0-0
Timestamp: 2025-06-26T02:10:33.102Z
Learning: Use camelCase for all GROQ query names, prefix with an action verb (get, getAll, etc.), and suffix with 'Query'. Reusable fragments should be prefixed with an underscore.

Applied to files:

  • apps/web/src/types/sanity.types.generated.ts
🧬 Code Graph Analysis (1)
apps/web/src/types/sanity.types.generated.ts (3)
apps/web/src/types/sanity.types.ts (1)
  • Groups (15-17)
apps/web/src/utils/groups/index.ts (1)
  • GroupSection (19-25)
apps/studio/structure/index.ts (1)
  • getGroupPersons (26-43)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Check
  • GitHub Check: Check
🔇 Additional comments (8)
.cspell.json (3)

4-4: No functional change; safe to reorder.

Moving "enabled" doesn't affect behavior. Nothing to do.


20-22: No functional change; safe to reorder.

"import", "language", and "version" positions don't affect cspell behavior.


24-24: Add dictionary entry for new domain term.

Adding "angebot" is appropriate to prevent false positives across new routes and content.

apps/web/src/types/sanity.types.generated.ts (5)

160-167: SingleGroupPage: content.contactPersonsSection added — LGTM.

Matches the new schema where persons are fetched via a dedicated query; section holds titles/intro only.


2263-2282: New OfferGroupsGroupPageQueryResult — LGTM.

Type aligns with the new singleGroupPage schema.


2367-2392: Contact persons query for single group — LGTM.

Uses team email from the affiliated group (team->email) and role/title mapping correctly.


2393-2423: OfferGroupsPageQueryResult added — LGTM.

Consistent with groups landing page schema.


878-914: Validate GROQ Queries for featuredImage Updates

I couldn’t locate any .ts files under queries/ or groq/ that still reference the old image field. Please manually verify and update all your GROQ projections to use featuredImage, then re-run your type generation to catch any mismatches.

• Check all query files in your project (e.g. apps/web/src/queries/**, libs/**/groq/**) for any remaining image projections
• Rename those projections and fragments to featuredImage so they match the updated schema
• Re-run your Sanity codegen/typegen step and resolve any errors before merging

@mheob mheob merged commit 31a01b8 into main Aug 9, 2025
11 checks passed
@mheob mheob deleted the 200-create-groups-page branch August 9, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend 🖥️ Belongs to the Next.js App studio 🗃️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant