inbox-zero
inbox-zero copied to clipboard
Made the email appear on fullscreen
This PR makes the email appear on full screen,Removed the split screen mode.
Fixes #344
Result Video attached :
https://github.com/user-attachments/assets/8e9e1307-8364-466b-8826-60b113670da3
Summary by CodeRabbit
-
New Features
- Introduced an enhanced email interface that displays complete email threads and supports seamless redirection between individual emails and the inbox.
-
UI Enhancements
- Improved navigation by enabling direct URL-based transitions, including a new "Back to inbox" button in fullscreen email views for easier return to the main list.
@rohanshrma222 is attempting to deploy a commit to the Inbox Zero Team on Vercel.
A member of the Team first needs to authorize it.
Walkthrough
This pull request introduces and refactors several email-related components. A new Mail component in the [...slug]/page.tsx file now handles email thread viewing with data fetching, pagination, and state management. An existing Mail component in mail/page.tsx is refactored to a simplified redirection component (MailRedirect) that uses Next.js routing hooks. Additionally, the EmailList component has been updated to navigate directly on thread selection, and the EmailPanel component now conditionally displays a "Back to inbox" button in fullscreen mode.
Changes
| File(s) | Change Summary |
|---|---|
apps/web/app/(app)/mail/[...slug]/page.tsxapps/web/app/(app)/mail/page.tsx |
Added a new Mail component for thread handling (using useSWRInfinite and jotai) and refactored the legacy Mail component to MailRedirect for redirection based on URL parameters using Next.js hooks. |
apps/web/components/email-list/EmailList.tsx |
Updated the email list component to use useRouter and useSearchParams for simplified navigation via router.push on email thread click, removing old state and scroll logic. |
apps/web/components/email-list/EmailPanel.tsx |
Enhanced the email panel by incorporating ArrowLeftIcon and usePathname to detect fullscreen mode and render a "Back to inbox" button conditionally. |
Sequence Diagram(s)
sequenceDiagram
participant U as User
participant M as Mail Component
participant API as Email API
participant AT as Atom (refetch)
U->>M: Load email page with URL slug
M->>API: Fetch email threads (with pagination)
API-->>M: Return threads data
M->>AT: Update refetch function for global access
alt Viewing specific thread
M->>UI: Render EmailPanel for the selected thread
else
M->>UI: Render EmailList
end
sequenceDiagram
participant U as User
participant MR as MailRedirect Component
participant R as Router
U->>MR: Request the /mail page
MR->>MR: Extract search parameters (type, threadId)
alt threadId exists
MR->>R: Redirect to specific thread view
else
MR->>R: Redirect to general mail list view
end
sequenceDiagram
participant U as User
participant EL as EmailList Component
participant R as Router
participant EP as EmailPanel Component
U->>EL: Click on an email thread
EL->>R: Navigate to URL with type and thread id
R-->>EP: Load updated email panel view
EP->>EP: Check view mode using pathname
alt Fullscreen mode detected
EP->>UI: Render "Back to inbox" button
else
EP->>UI: Render without back button
end
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Mail: Full screen mode for emails (#344) | ✅ |
Possibly related PRs
- elie222/inbox-zero#303: Modifies the refetch function’s parameter structure in the Mail component, directly relating to its new functionality.
- elie222/inbox-zero#211: Implements pagination with
useSWRInfinite, which aligns with the new Mail component’s data fetching mechanism.
Poem
I'm just a rabbit, hopping in the code,
Bringing full-screen emails on a cheerful road.
Threads unfurl with hooks that guide,
Redirections swift like a bouncy slide.
With icons and states, the views align,
In CodeRabbit style, everything's just fine!
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
🔧 ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
Scope: all 2 workspace projects WARN GET http://10.0.0.28:4873/turbo error (503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/eslint-plugin-only-warn/-/eslint-plugin-only-warn-1.1.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/typescript/-/typescript-5.8.2.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/@vercel/style-guide/-/style-guide-6.0.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/eslint-config-prettier/-/eslint-config-prettier-10.1.1.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/eslint-config-turbo/-/eslint-config-turbo-2.4.4.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.27.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/eslint/-/eslint-9.23.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/turbo/-/turbo-2.4.4.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/@typescript-eslint/parser/-/parser-8.27.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/prettier/-/prettier-3.5.3.tgz error (ERR_PNPM_FETCH_503). Will retry in 10 seconds. 2 retries left. WARN GET http://10.0.0.28:4873/turbo error (503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/typescript/-/typescript-5.8.2.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/eslint-plugin-only-warn/-/eslint-plugin-only-warn-1.1.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/@vercel/style-guide/-/style-guide-6.0.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/eslint-config-prettier/-/eslint-config-prettier-10.1.1.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/eslint-config-turbo/-/eslint-config-turbo-2.4.4.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.27.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/eslint/-/eslint-9.23.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/turbo/-/turbo-2.4.4.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/@typescript-eslint/parser/-/parser-8.27.0.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. WARN GET http://10.0.0.28:4873/prettier/-/prettier-3.5.3.tgz error (ERR_PNPM_FETCH_503). Will retry in 1 minute. 1 retries left. /tmp/eslint/packages/eslint-config: ERR_PNPM_FETCH_503 GET http://10.0.0.28:4873/typescript/-/typescript-5.8.2.tgz: Service Unavailable - 503
This error happened while installing a direct dependency of /tmp/eslint/packages/eslint-config
✨ 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.
🪧 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
@coderabbitaiin 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
@coderabbitaiin 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.
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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai planto trigger planning for file edits and PR creation.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
Hey, would be best if we did this like Gmail and kept the split screen option as it's already working. But also offered full screen mode.
Also I notice the path for the page is /mail/inbox/messageid. no reason for it to be under /inbox. although gmail does do something like this with their urls doesn't seem a smart way to handle it.
may also be worth considering keeping the page as is and the full screen is more a modal type thing. similar to split screen mode, but it just covers the whole screen instead. this way you don't lose page context / need reload when you go back to inbox
Thanks for the suggestion.
- Like in Gmail they have their setting for fullscreen view and split-screen, so how do you want me to do it add a button or something?
- Do you want to avoid a new route and make a fullscreen model there only?
Thanks for the suggestion.
1. Like in Gmail they have their setting for fullscreen view and split-screen, so how do you want me to do it add a button or something? 2. Do you want to avoid a new route and make a fullscreen model there only?
Why not both ? Modal and new page button ?