Skip to content

fix(web): narrow ShellMainAppDir prop type to props it actually uses#29686

Draft
jitendravjh wants to merge 1 commit into
calcom:mainfrom
jitendravjh:fix/shell-main-app-dir-unused-props
Draft

fix(web): narrow ShellMainAppDir prop type to props it actually uses#29686
jitendravjh wants to merge 1 commit into
calcom:mainfrom
jitendravjh:fix/shell-main-app-dir-unused-props

Conversation

@jitendravjh

@jitendravjh jitendravjh commented Jul 1, 2026

Copy link
Copy Markdown

Fixes #24433

ShellMainAppDir takes props: LayoutProps, the full shared shell prop type, but the component body never reads most of it. title, description, centered, isPublic, withoutMain, disableSticky, MobileNavigationContainer, SidebarContainer, TopNavContainer, drawerState are all declared on the type but nothing in the function touches them. So today if someone passes title="foo" to it, TS is fine with it and it just silently does nothing — a footgun for whoever adds a call site later expecting it to work like it does elsewhere.

Fix is just picking out the fields the component actually reads into a local ShellMainAppDirProps type and using that instead of the full LayoutProps. Pure type-level narrowing, zero runtime behavior change.

Went through every real usage of this component in the repo (event-types, bookings, availability + their skeletons, booking logs page) — all of them only ever pass heading/subtitle/CTA/children, comfortably within what's still supported, so this doesn't break anything that exists today.

Tested by running tsc-absolute --pretty --noEmit on apps/web (after building tRPC types per the repo's own docs) — clean, zero errors. Also ran yarn biome check on the file and diffed against main to confirm the warnings it flags are pre-existing nursery-rule stuff (ternaries, class sorting), not anything this PR introduced.

ShellMainAppDir accepted the full LayoutProps type but only ever read
a subset of its fields. Fields like title, description, centered,
isPublic, withoutMain, disableSticky, MobileNavigationContainer,
SidebarContainer, TopNavContainer, and drawerState were declared but
silently ignored, so passing them compiled fine yet had no effect.

Narrowed the prop type to a Pick of exactly what the component reads.
No behavior change; all 5 existing call sites (event-types, bookings,
availability, and their skeletons) only pass heading/subtitle/CTA/
children, which remain supported.
@github-actions github-actions Bot added ✨ feature New feature or request 🚨 needs approval This feature request has not been reviewed yet by the Product Team and needs approval beforehand 🧹 Improvements Improvements to existing features. Mostly UX/UI labels Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Welcome to Cal.diy, @jitendravjh! Thanks for opening this pull request.

A few things to keep in mind:

  • This is Cal.diy, not Cal.com. Cal.diy is a community-driven, fully open-source fork of Cal.com licensed under MIT. Your changes here will be part of Cal.diy — they will not be deployed to the Cal.com production app.
  • Please review our Contributing Guidelines if you haven't already.
  • Make sure your PR title follows the Conventional Commits format.

A maintainer will review your PR soon. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feature New feature or request 🧹 Improvements Improvements to existing features. Mostly UX/UI 🚨 needs approval This feature request has not been reviewed yet by the Product Team and needs approval beforehand size/S

1 participant