Skip to content

fix: move fetching data to client side to fix error deployment because blocked by CF#72

Merged
Fakhri1999 merged 6 commits intomasterfrom
fix-deployment-blocked-cf
Sep 1, 2025
Merged

fix: move fetching data to client side to fix error deployment because blocked by CF#72
Fakhri1999 merged 6 commits intomasterfrom
fix-deployment-blocked-cf

Conversation

@Fakhri1999
Copy link
Member

@Fakhri1999 Fakhri1999 commented Sep 1, 2025

Summary by CodeRabbit

  • New Features

    • Added a dedicated 500 error page with localized messaging (EN/ID).
    • Introduced skeleton UIs for room detail and search pages for smoother loading.
    • Display room ratings with two decimal places for consistency.
  • Refactor

    • Room detail page now fetches data client-side with improved loading and error handling, plus dynamic metadata.
  • Localization

    • Added server error translations (EN, ID) and standardized apostrophes in EN copy.
  • Chores

    • Updated local dev server port.
    • Adjusted CI workflow trigger.
    • Updated app configuration.

@Fakhri1999 Fakhri1999 self-assigned this Sep 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Updates CI workflow trigger branch. Adjusts Next.js config (adds publicRuntimeConfig header, removes experimental font loaders). Changes dev server port. Adds i18n strings for 500 error in en/id. Formats ratings to two decimals. Introduces skeleton UIs. Extends room search service (query/header support). Adds 500 page. Rewrites room slug page to client-side fetching.

Changes

Cohort / File(s) Summary
CI Workflow Trigger
.github/workflows/git-sync.yml
Triggers on pushes to branch fix-deployment-blocked-cf instead of master.
Next.js Config & Dev Script
next.config.js, package.json
Adds publicRuntimeConfig.nextISRSecretHeader from env; removes experimental.fontLoaders. Changes dev script to run on port 3002.
i18n: 500 Error Strings
public/locales/en/common.json, public/locales/id/common.json
Adds server_error block (title "500", descriptions) in en and id. Fixes apostrophes in en not_found descriptions.
Ratings Formatting
src/modules/room/RoomCardItem.tsx, src/modules/room/detail/RoomDetailContainer.tsx
Displays averageRating with two decimals using toFixed(2) in card and detail views.
Skeleton UIs
src/modules/room/RoomDetailSkeleton.tsx, src/modules/room/SearchPageSkeleton.tsx, src/modules/room/RoomSearchContainer.tsx
Adds RoomDetailSkeleton and SearchPageSkeleton components. Replaces spinner with skeleton cards in RoomSearchContainer.
Room Search Service Update
src/modules/room/roomService.ts
Adds optional bypassCf to SearchRoomRequest; updates searchRoom to accept optional headers and send bypassCf as query param.
Error and Room Pages
src/pages/500.tsx, src/pages/room/[slug].tsx
Adds 500 error page with i18n and SSR props for translations. Rewrites room slug page to client-side fetch with skeleton, error handling, dynamic head; simplifies getStaticPaths; getStaticProps loads only translations.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant NextRouter as Next Router
  participant Index as /room/[slug] Page
  participant Hook as useSearchRoomQuery
  participant Service as roomService.searchRoom
  participant API as Rooms API

  User->>NextRouter: Navigate to /room/{slug}
  NextRouter->>Index: Render with slug
  Index->>Index: Show skeleton
  Index->>Hook: useSearchRoomQuery(slug)
  Hook->>Service: searchRoom({ slug, ... }, headers?)
  Service->>API: GET /rooms?bypassCf? + payload<br/>+ optional headers
  API-->>Service: 200 with rooms | 404/5xx
  Service-->>Hook: Response / Error
  Hook-->>Index: data / error / loading=false

  alt data.rooms[0] exists
    Index->>Index: Select first room
    Index->>Index: Set dynamic <head> tags
    Index->>Index: Render RoomDetailContainer
  else error is 404-like or no room
    Index->>Index: Render Page404
  else other error
    Index->>Index: Render Page500
  end

  note over Service,API: New: supports bypassCf query and custom headers
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I tap my paws on ports anew, 3002 aglow,
Stars align for slug-bound fetch, client winds now blow.
Skeletons dance while pages load, ratings gleam .00,
A 500 moon says “Oops!” in tongues that humans know.
With headers packed, we leap past clouds—onward we go! 🐇🚀


📜 Recent review details

Configuration used: CodeRabbit UI

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 e5c8006 and 188d2a2.

📒 Files selected for processing (13)
  • .github/workflows/git-sync.yml (1 hunks)
  • next.config.js (1 hunks)
  • package.json (1 hunks)
  • public/locales/en/common.json (1 hunks)
  • public/locales/id/common.json (1 hunks)
  • src/modules/room/RoomCardItem.tsx (1 hunks)
  • src/modules/room/RoomDetailSkeleton.tsx (1 hunks)
  • src/modules/room/RoomSearchContainer.tsx (3 hunks)
  • src/modules/room/SearchPageSkeleton.tsx (1 hunks)
  • src/modules/room/detail/RoomDetailContainer.tsx (2 hunks)
  • src/modules/room/roomService.ts (2 hunks)
  • src/pages/500.tsx (1 hunks)
  • src/pages/room/[slug].tsx (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-deployment-blocked-cf

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 or @coderabbit 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

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.

@Fakhri1999 Fakhri1999 merged commit abab604 into master Sep 1, 2025
1 of 2 checks passed
@Fakhri1999 Fakhri1999 deleted the fix-deployment-blocked-cf branch September 1, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant