Skip to content

Conversation

@SinghaAnirban005
Copy link
Contributor

@SinghaAnirban005 SinghaAnirban005 commented Aug 27, 2025

What does this PR do?

This PR correctly sets the start of week placeholder based on the chosen day

Visual Demo (For contributors especially)

Screencast.from.2025-08-28.03-08-58.webm

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

@vercel
Copy link

vercel bot commented Aug 27, 2025

@SinghaAnirban005 is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

The change modifies how the GeneralView form sets the default label for the "Start of week" field. Instead of deriving the label via a locale-based day name function that defaulted to Monday for non-Sunday selections, it now finds the matching option in weekStartOptions using user.weekStart and uses that option’s label (with a fallback to an empty string). No exported/public signatures were altered.

Assessment against linked issues

Objective Addressed Explanation
Fix incorrect "Start of week" placeholder defaulting to Monday for non-Sunday selections (#23401)

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
    • 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.
  • 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 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/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Aug 27, 2025
@graphite-app graphite-app bot requested a review from a team August 27, 2025 21:47
@github-actions github-actions bot added the 🐛 bug Something isn't working label Aug 27, 2025
Copy link
Contributor

@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: 0

🧹 Nitpick comments (2)
apps/web/modules/settings/my-account/general-view.tsx (2)

117-120: Use the exact option object to avoid identity mismatches in Select.

Some Select implementations compare by object identity. Passing the found option directly is more robust than reconstructing { value, label }.

Apply this diff:

       weekStart: {
-        value: user.weekStart,
-        label: weekStartOptions.find((option) => option.value === user.weekStart)?.label || "",
-      },
+        // Use the exact option object; fallback to Monday, then first option.
+        // This avoids object-identity mismatches in Select implementations.
+      : weekStartOptions.find((option) => option.value === user.weekStart)
+        ?? weekStartOptions.find((option) => option.value === "Monday")
+        ?? weekStartOptions[0],

367-367: Prefer named export (optional).

To align with the repo guideline favoring named exports, consider exporting GeneralView as named. Defer if this component is intentionally the module’s primary export.

-export default GeneralView;
+export { GeneralView };

Note: This requires updating import sites.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 0367cf8 and 5eb1a30.

📒 Files selected for processing (1)
  • apps/web/modules/settings/my-account/general-view.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Always use t() for text localization in frontend code; direct text embedding should trigger a warning

Files:

  • apps/web/modules/settings/my-account/general-view.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/review.mdc)

Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js .utc() in hot paths like loops

Files:

  • apps/web/modules/settings/my-account/general-view.tsx
**/*.{ts,tsx,js,jsx}

⚙️ CodeRabbit configuration file

Flag default exports and encourage named exports. Named exports provide better tree-shaking, easier refactoring, and clearer imports. Exempt main components like pages, layouts, and components that serve as the primary export of a module.

Files:

  • apps/web/modules/settings/my-account/general-view.tsx
🔇 Additional comments (2)
apps/web/modules/settings/my-account/general-view.tsx (2)

117-120: Good fix: label now reliably reflects the selected start-of-week.

Switching to look up the label from weekStartOptions removes the Monday-default bug and aligns the placeholder with the chosen day.


293-299: Select equality semantics verified — no action required

Short: I checked the codebase — our Select is a thin wrapper around react-select and does not override equality. react-select uses getOptionValue (default: option.value) when marking options as selected, so reconstructing the selected option with the same .value (e.g. { ...event }) will still match the options list.

Checked files:

  • packages/ui/components/form/select/Select.tsx — wraps ReactSelect; no isOptionEqualToValue/getOptionValue overrides.
  • packages/ui/components/form/select/selectTheme.ts — injects custom components only.
  • Location under review: apps/web/modules/settings/my-account/general-view.tsx (the <Select value={value} ... /> snippet).

Conclusion: No change required; the original concern (object-identity matching causing placeholder drift) is not applicable given react-select’s default equality.

Copy link
Contributor

@kart1ka kart1ka left a comment

Choose a reason for hiding this comment

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

LGTM!

@github-actions
Copy link
Contributor

github-actions bot commented Aug 28, 2025

E2E results are ready!

@kart1ka kart1ka merged commit e07f800 into calcom:main Aug 28, 2025
33 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync ready-for-e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Start of week" placeholder shows incorrect day

2 participants