Skip to content

Conversation

vijayraghav-io
Copy link
Contributor

@vijayraghav-io vijayraghav-io commented Nov 11, 2024

What does this PR do?

fixes hydration error due to nested anchor elements.

Before Fix / Issue :
https://www.loom.com/share/20d314a3952c47a4a53b252a5eb79edc?sid=a145ef5f-d97a-4d34-8cc7-882e8a91b05c

After Fix :
https://www.loom.com/share/c72b274adc8441c498d2a8165dc478db?sid=bcc7d554-328b-4bb0-adcd-76e2ff626dd9

Mandatory Tasks (DO NOT REMOVE)

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

Copy link

vercel bot commented Nov 11, 2024

@vijayraghav-io is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot requested a review from a team November 11, 2024 08:41
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Nov 11, 2024
@github-actions github-actions bot added the 🐛 bug Something isn't working label Nov 11, 2024
@dosubot dosubot bot added the automated-tests area: unit tests, e2e tests, playwright label Nov 11, 2024
Copy link

graphite-app bot commented Nov 11, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (11/11/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (11/11/24)

1 label was added to this PR based on Keith Williams's automation.

@github-actions github-actions bot added organizations area: organizations, orgs teams area: teams, round robin, collective, managed event-types labels Nov 11, 2024
@vijayraghav-io vijayraghav-io changed the title fix: hydration error in [org-slug]/team, [org-slug]/team/[team-slug]/[type] pages fix: hydration error in [org-slug]/[team-slug], [org-slug]/[team-slug]/[type] pages Nov 11, 2024
@vijayraghav-io
Copy link
Contributor Author

vijayraghav-io commented Nov 11, 2024

Ready!

@Udit-takkar Udit-takkar added this to the v4.7 milestone Nov 12, 2024
@Praashh Praashh self-assigned this Nov 15, 2024
@keithwillcode keithwillcode modified the milestones: v4.7, v4.8 Nov 18, 2024
@dosubot dosubot bot modified the milestone: v4.8 Nov 18, 2024
@Praashh
Copy link
Contributor

Praashh commented Nov 19, 2024

Hey @vijayraghav-io can you please attach a loom video of the fix.

@vijayraghav-io
Copy link
Contributor Author

Hey @vijayraghav-io can you please attach a loom video of the fix.

Attached before and after fix videos in description.

Copy link
Contributor

@Praashh Praashh left a comment

Choose a reason for hiding this comment

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

LGTM!, tagging @anikdhabal for a final review before approving.

Copy link
Contributor

github-actions bot commented Dec 6, 2024

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Dec 6, 2024
@vijayraghav-io
Copy link
Contributor Author

Gentle Reminder!

@kart1ka
Copy link
Contributor

kart1ka commented Jul 14, 2025

Hey @vijayraghav-io, can you pls resolve merge conflicts? A test seems to be failing. Can you pls address that as well?

Comment on lines 12 to 45
test.describe("Organization Team page", () => {
test("Team page with org domain url", async ({ page, users }) => {
const orgMember = await users.create(undefined, {
hasTeam: true,
isOrg: true,
hasSubteam: true,
isOrgVerified: true,
isDnsSetup: true,
orgRequestedSlug: "example",
schedulingType: SchedulingType.ROUND_ROBIN,
});
const { team: org } = await orgMember.getOrgMembership();
const { team } = await orgMember.getFirstTeamMembership();
const teamEvent = await orgMember.getFirstTeamEvent(team.id);
await orgMember.apiLogin();

await test.step("Team page is loaded with profile and can select eventtype", async () => {
await doOnOrgDomain(
{
orgSlug: org.slug,
page,
},
async ({ page, goToUrlWithErrorHandling }) => {
await goToUrlWithErrorHandling(`/team/${team.slug}`);
await expect(page.getByTestId("team-name")).toBeVisible();
await expect(page.getByTestId("event-type-link")).toBeVisible();
await goToUrlWithErrorHandling(`/team/${team.slug}/${teamEvent.slug}`);
await expect(page.getByTestId("event-title")).toBeVisible();
await bookEventOnThisPage(page);
}
);
});
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

This test seems to be flaky. Can you check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the hardcoded orgRequestedSlug , may be the requested slug example was trying to override an existing org slug and was causing flakiness.
So made the org slug dynamic (which is by default).

@kart1ka kart1ka marked this pull request as draft July 14, 2025 17:15
@vijayraghav-io
Copy link
Contributor Author

Hey @vijayraghav-io, can you pls resolve merge conflicts? A test seems to be failing. Can you pls address that as well?

Sure will check and update

@CarinaWolli CarinaWolli modified the milestones: v5.5, v5.6 Jul 16, 2025
@dosubot dosubot bot removed this from the v5.6 milestone Jul 16, 2025
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

Walkthrough

The changes refactor navigation within the EventTypes and SubTeams components in apps/web/modules/team/team-view.tsx, replacing Link components with clickable list items that use router.push for navigation. Query parameters are now explicitly serialized, and accessibility attributes are added to interactive elements. A new Playwright end-to-end test is introduced in apps/web/playwright/organization/organization-team-page.e2e.ts to verify navigation and booking flows on the organization team page. A minor stylistic change is made in packages/features/schedules/components/Schedule.tsx by removing an extraneous blank line.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective Addressed Explanation
Eliminate hydration errors on [org-slug]/[team-slug] or [org-slug] pages (#17575)
Eliminate hydration errors on [org-slug/[team-slug]/[event-slug] pages (#17575)
Ensure navigation and booking flows work on org/team pages (#17575)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found. All changes align with the requirements of the linked issue.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ab99498 and fba01eb.

📒 Files selected for processing (1)
  • apps/web/playwright/organization/organization-team-page.e2e.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/playwright/organization/organization-team-page.e2e.ts
✨ 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.
    • 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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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.

@vijayraghav-io
Copy link
Contributor Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@anikdhabal anikdhabal added the Low priority Created by Linear-GitHub Sync label Jul 16, 2025
@vijayraghav-io vijayraghav-io marked this pull request as ready for review July 28, 2025 17:14
@dosubot dosubot bot added this to the v5.6 milestone Jul 28, 2025
@vijayraghav-io
Copy link
Contributor Author

Hey @vijayraghav-io, can you pls resolve merge conflicts? A test seems to be failing. Can you pls address that as well?

@kart1ka All tests are passing now. The flaky failing test was a unrelated one.
Also removed the flakiness in new test in this PR.

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

@dosubot dosubot bot modified the milestones: v5.6, v5.7 Aug 18, 2025
@hbjORbj
Copy link
Contributor

hbjORbj commented Aug 28, 2025

@vijayraghav-io Hey, I apologize for a late response and thanks for opening this PR. I agree that we have a hydration error due to nested anchor elements in the team page. The following is my analysis:

UserAvatarGroup computes hrefs on render using getBookerBaseUrlSync(user.profile?.organization?.slug).
->
That calls getOrgFullOrigin, which depends on env-derived constants like WEBAPP_URL/WEBSITE_URL
->
Hence, the server-rendered values differ from the client-rendered ones during hydration.

So, this issue must be addressed from the component UserAvatarGroup itself, not from team-view. I will address this myself in a separate PR.

@hbjORbj hbjORbj closed this Aug 28, 2025
@dosubot dosubot bot modified the milestone: v5.7 Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated-tests area: unit tests, e2e tests, playwright 🐛 bug Something isn't working community Created by Linear-GitHub Sync Low priority Created by Linear-GitHub Sync organizations area: organizations, orgs ready-for-e2e teams area: teams, round robin, collective, managed event-types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-4746] Hydration error on org/team page
8 participants