Skip to content

Conversation

@dannyroosevelt
Copy link
Collaborator

@dannyroosevelt dannyroosevelt commented Apr 30, 2025

WHY

Summary by CodeRabbit

  • New Features

    • Introduced a custom 404 error page that automatically redirects users to the home page if a page is not found, displaying a "Page not found" message during the redirect.
    • Added middleware to redirect unmatched URLs to the home page with a permanent redirect.
  • Chores

    • Removed a redirect rule that previously redirected certain app-related URLs to an external site.
    • Removed the documentation page listing integrated apps and premium app details.
    • Updated .gitignore to exclude specific local settings files.
    • Corrected multiple documentation links and headings for improved clarity and accuracy.

@vercel
Copy link

vercel bot commented Apr 30, 2025

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview May 6, 2025 4:46am
pipedream-docs ⬜️ Ignored (Inspect) May 6, 2025 4:46am
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) May 6, 2025 4:46am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 30, 2025

Warning

Rate limit exceeded

@dannyroosevelt has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 24ef2b6 and 68d0a78.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • docs-v2/next.config.mjs (3 hunks)
  • docs-v2/pages/connect/api.mdx (21 hunks)
  • docs-v2/pages/connect/components.mdx (2 hunks)
  • docs-v2/pages/connect/workflows.mdx (1 hunks)

Walkthrough

This update removes a permanent redirect rule from the Next.js configuration that previously redirected all /apps/:path*/ routes to an external site. Additionally, it introduces a custom 404 error page component that automatically redirects users to the home page when a non-existent route is accessed. The new 404 page displays a message indicating the page was not found and that a redirect is occurring, using centered layout styling. Also, the entire documentation page describing Pipedream's integrated apps was removed. Several documentation files were updated to fix or simplify internal API reference links. A new middleware was added to handle unmatched routes by redirecting them to the home page with a 301 status. The .gitignore was updated to ignore a new local settings file pattern.

Changes

File(s) Change Summary
docs-v2/next.config.mjs Removed the redirect rule for /apps/:path*/ to https://pipedream.com/apps/:path*/; added a rewrite for /workflows/errors/.
docs-v2/pages/404.tsx Added a new custom 404 page component that redirects users to the home page on mount after a short delay.
docs-v2/pages/apps/apps.mdx Removed the entire documentation page describing Pipedream's integrated apps and premium apps.
docs-v2/middleware.ts Added middleware to redirect unmatched non-static, non-API routes to home page with a 301 redirect.
.gitignore Added ignore pattern for **/.claude/settings.local.json.
docs-v2/pages/connect/api.mdx Simplified multiple API reference headings by removing articles "a" and "an".
docs-v2/pages/connect/components.mdx Corrected URL for updating listening webhooks of deployed triggers.
docs-v2/pages/connect/environments.mdx Corrected hyperlink for creating a new Connect token.
docs-v2/pages/connect/managed-auth/connect-link.mdx Updated API reference link for token creation parameters.
docs-v2/pages/connect/managed-auth/quickstart.mdx Updated API reference links for creating Connect tokens.
docs-v2/pages/connect/managed-auth/tokens.mdx Updated API reference links for token creation anchors.
docs-v2/pages/connect/managed-auth/users.mdx Updated API reference link for deleting an end user.
docs-v2/pages/connect/managed-auth/webhooks.mdx Updated API reference link for creating a Connect token.
docs-v2/pages/privacy-and-security/index.mdx Updated API reference link for creating a server-side token in Connect SDK authorization flow.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Next.js App
    participant Middleware
    participant Custom404 Component

    User->>Next.js App: Requests non-existent page
    Next.js App->>Middleware: Checks request path
    alt Path is unmatched and not static/API
        Middleware->>User: 301 Redirect to "/"
    else Path allowed or static
        Next.js App->>Custom404 Component: Renders 404 page (fallback)
        Custom404 Component->>User: Displays "Page not found" message
        Custom404 Component->>Next.js App: Triggers router.replace('/')
        Next.js App->>User: Redirects to home page
    end
Loading

Possibly related PRs

  • Fixing redirect rules #16460: Also modifies redirect rules in docs-v2/next.config.mjs, removing multiple redirect entries but not the exact same /apps/:path*/ rule.

Poem

Hopped through the docs, found a path that’s no more,
No more redirects whisking you out the door.
Now if you’re lost, don’t fear or roam—
A gentle 404 will guide you home.
🥕
Pages may vanish, but bunnies ensure,
You’ll always find your way for sure!

✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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 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
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)
docs-v2/pages/404.tsx (2)

4-10: Consider adding a delay before redirection

The current implementation immediately redirects users to the home page, which might not give them enough time to read the error message. Consider adding a short delay (2-3 seconds) to allow users to see and understand the 404 message before being redirected.

useEffect(() => {
  // 302 redirect (temporary) to home page
- router.replace('/')
+ setTimeout(() => {
+   router.replace('/')
+ }, 3000) // 3 second delay before redirect
}, [router])

12-19: Improve accessibility and semantics of the 404 page

While the layout works well, consider these improvements:

  1. Use semantic HTML for error pages
  2. Add appropriate ARIA roles and attributes
  3. Consider using a styled component or CSS module instead of inline styles for consistency with the rest of the application
return (
- <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>
-   <div>
-     <h1>Page not found</h1>
-     <p>Redirecting to home page...</p>
-   </div>
- </div>
+ <main 
+   style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}
+   role="alert"
+   aria-labelledby="error-title"
+ >
+   <div className="error-container">
+     <h1 id="error-title">Page not found</h1>
+     <p>Redirecting to home page...</p>
+   </div>
+ </main>
)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e12786e and f22bcbc.

📒 Files selected for processing (2)
  • docs-v2/next.config.mjs (0 hunks)
  • docs-v2/pages/404.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • docs-v2/next.config.mjs
🔇 Additional comments (2)
docs-v2/pages/404.tsx (2)

1-2: Imports look good!

The imports correctly include the necessary React and Next.js hooks for implementing a redirect-based 404 page.


4-20: Consider SEO implications of auto-redirecting 404 pages

Automatically redirecting from a 404 page to the home page can affect how search engines index your site. Search engines prefer that non-existent URLs return proper 404 status codes without redirects.

For documentation sites, consider:

  1. Maintaining the 404 status without redirecting
  2. Adding helpful navigation options instead of automatic redirection
  3. If redirection is required, ensure the server still returns a 404 status code first

Before implementing this change, confirm if automatic redirection is the desired behavior for all 404 cases, especially for SEO considerations.

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: 2

🧹 Nitpick comments (4)
docs-v2/middleware.ts (2)

13-13: Remove trailing whitespace.

There's a trailing space at the end of this line.

-  const pathname = request.nextUrl.pathname
+  const pathname = request.nextUrl.pathname
🧰 Tools
🪛 GitHub Check: Lint Code Base

[failure] 13-13:
Trailing spaces not allowed


16-16: Remove trailing whitespace.

There's a trailing space at the end of this line.

-    pathname.startsWith('/_next') || 
+    pathname.startsWith('/_next') ||
🧰 Tools
🪛 GitHub Check: Lint Code Base

[failure] 16-16:
Strings must use doublequote


[failure] 16-16:
Trailing spaces not allowed

docs-v2/pages/404.tsx (2)

12-20: Consider adding user feedback while redirect is pending.

The current implementation has a 100ms delay before redirecting, which is very short but could be noticeable to users on slower connections.

You could consider adding a visual indicator (like a spinner) or using a fade-out animation during the redirect process to enhance user experience.

useEffect(() => {
  // Set a state to show loading/redirect in progress
  setIsRedirecting(true);
  
  const redirectTimeout = setTimeout(() => {
    router.replace("/")
  }, 100)
  
  return () => clearTimeout(redirectTimeout)
}, [router])

23-34: Consider adding more semantic HTML structure.

The current implementation uses generic div elements with inline styles. For better accessibility and semantics, consider using more appropriate HTML elements.

  return (
    <div style={{
      display: "flex",
      justifyContent: "center",
      alignItems: "center",
      height: "100vh",
    }}>
-      <div>
+      <main>
        <h1>Page not found</h1>
        <p>Redirecting to home page...</p>
-      </div>
+      </main>
    </div>
  )
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 787970c and 24ef2b6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (13)
  • .gitignore (1 hunks)
  • docs-v2/middleware.ts (1 hunks)
  • docs-v2/next.config.mjs (1 hunks)
  • docs-v2/pages/404.tsx (1 hunks)
  • docs-v2/pages/connect/api.mdx (9 hunks)
  • docs-v2/pages/connect/components.mdx (1 hunks)
  • docs-v2/pages/connect/environments.mdx (1 hunks)
  • docs-v2/pages/connect/managed-auth/connect-link.mdx (1 hunks)
  • docs-v2/pages/connect/managed-auth/quickstart.mdx (2 hunks)
  • docs-v2/pages/connect/managed-auth/tokens.mdx (2 hunks)
  • docs-v2/pages/connect/managed-auth/users.mdx (1 hunks)
  • docs-v2/pages/connect/managed-auth/webhooks.mdx (1 hunks)
  • docs-v2/pages/privacy-and-security/index.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (10)
  • docs-v2/pages/connect/environments.mdx
  • docs-v2/pages/connect/managed-auth/users.mdx
  • .gitignore
  • docs-v2/pages/connect/managed-auth/connect-link.mdx
  • docs-v2/pages/connect/managed-auth/webhooks.mdx
  • docs-v2/pages/privacy-and-security/index.mdx
  • docs-v2/pages/connect/managed-auth/quickstart.mdx
  • docs-v2/pages/connect/managed-auth/tokens.mdx
  • docs-v2/pages/connect/components.mdx
  • docs-v2/pages/connect/api.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs-v2/next.config.mjs
🧰 Additional context used
🪛 GitHub Check: Lint Code Base
docs-v2/middleware.ts

[failure] 1-1:
Strings must use doublequote


[failure] 2-2:
Strings must use doublequote


[failure] 13-13:
Trailing spaces not allowed


[failure] 16-16:
Strings must use doublequote


[failure] 16-16:
Trailing spaces not allowed


[failure] 17-17:
Strings must use doublequote


[failure] 18-18:
Strings must use doublequote


[failure] 19-19:
Strings must use doublequote


[failure] 25-25:
Strings must use doublequote


[failure] 39-39:
Strings must use doublequote

🪛 GitHub Actions: Pull Request Checks
docs-v2/middleware.ts

[error] 1-1: ESLint: Strings must use doublequote (quotes) at line 1, column 30.

🔇 Additional comments (1)
docs-v2/pages/404.tsx (1)

1-35: Clean implementation of fallback 404 redirect page.

The Custom404 component implements a good fallback mechanism for the middleware with proper cleanup of the timeout. The code is well-structured with clear documentation and follows good React practices.

@dannyroosevelt dannyroosevelt merged commit 43747d1 into master May 6, 2025
5 checks passed
@dannyroosevelt dannyroosevelt deleted the danny/fixing-docs-apps-redirect branch May 6, 2025 04:49
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.

2 participants