E-Mail-Views#583
Conversation
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughDie Mailbox unterstützt nun mehrere Ansichten und Soft Deletes. Der Controller liest den gewünschten View aus dem Request, das Model kapselt die Filterlogik, und die React-Navigation verlinkt Posteingang, gesendete Objekte, Archiv und Papierkorb. ChangesMailbox views
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Request
participant EmailController
participant DropboxMail
participant EmailIndex
Request->>EmailController: request view
EmailController->>DropboxMail: query view-filtered mails
DropboxMail-->>EmailController: paginated mails
EmailController-->>EmailIndex: render mailbox data
EmailIndex->>EmailController: navigate to selected view
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
resources/js/Pages/App/Email/EmailIndex.tsx (1)
127-145: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
<br />durch semantisches Flex-Layout ersetzen.Die Verwendung von
<br />für Layout-Zwecke ist nicht semantisch und erschwert die Wartbarkeit. Ein flex-column-Container oder eine<nav>-Liste ist die bessere Wahl. Dies ist im obigen Diff bereits enthalten.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@resources/js/Pages/App/Email/EmailIndex.tsx` around lines 127 - 145, Replace the layout-only <br /> elements in the email navigation block with a semantic vertical layout, using a flex-column container or a nav/list structure around the links. Preserve the existing routes and link labels while keeping the links visually stacked.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/Http/Controllers/App/EmailController.php`:
- Around line 51-57: Validate the request’s view parameter in EmailController
before passing it to DropboxMail::query()->view($view), allowing only the view
values supported by scopeView and defaulting or rejecting invalid input without
triggering an UnhandledMatchError. Keep the existing mail query behavior
unchanged for valid views.
In `@app/Models/DropboxMail.php`:
- Line 66: In der Methode scopeView den Parameter $view explizit mit dem Typ
string deklarieren, ohne die bestehende Rückgabe- oder Query-Logik zu ändern.
- Around line 68-73: Ergänze im Match-Ausdruck der Methode in DropboxMail einen
Default-Arm für ungültige $view-Werte, sodass diese nicht mehr als
UnhandledMatchError fehlschlagen. Lasse den Default auf die Inbox-Abfrage
zurückfallen und behalte das bestehende Verhalten für die gültigen Werte inbox,
sent, archived und trash unverändert.
In `@resources/js/Pages/App/Email/EmailIndex.tsx`:
- Around line 127-145: Expose the current view value from the EmailController
response as an Inertia prop, then update the mailbox navigation in the
EmailIndex component to compare that prop with each link’s view and apply the
existing active-link styling to the selected view. Preserve the current route
targets and labels for inbox, sent, archived, and trash.
---
Nitpick comments:
In `@resources/js/Pages/App/Email/EmailIndex.tsx`:
- Around line 127-145: Replace the layout-only <br /> elements in the email
navigation block with a semantic vertical layout, using a flex-column container
or a nav/list structure around the links. Preserve the existing routes and link
labels while keeping the links visually stacked.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 7f5fda74-50a9-474f-af81-00005026b87b
📒 Files selected for processing (4)
app/Http/Controllers/App/EmailController.phpapp/Models/DropboxMail.phpdatabase/migrations/tenant/2026_07_12_135807_add_softdelete_to_dropbox_mails.phpresources/js/Pages/App/Email/EmailIndex.tsx
| <div className="m-4"> | ||
| <Link href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'inbox' } })}> | ||
| Posteingang | ||
| </Link> | ||
| <br /> | ||
| <Link href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'sent' } })}> | ||
| Gesendete Objekte | ||
| </Link> | ||
| <br /> | ||
| <Link | ||
| href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'archived' } })} | ||
| > | ||
| Archiv | ||
| </Link> | ||
| <br /> | ||
| <Link href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'trash' } })}> | ||
| Papierkorb | ||
| </Link> | ||
| </div> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keine Active-State-Anzeige für die aktuelle Mailbox-Ansicht.
Die Navigation Links haben keine aktive Hervorhebung. Der Benutzer kann nicht erkennen, welche Ansicht (Posteingang, Gesendet, Archiv, Papierkorb) gerade ausgewählt ist. Der Controller übergibt den aktuellen view-Wert nicht an die Inertia-Props, sodass die Komponente ihn nicht kennt.
Lösung: Den view-Wert im Controller an Inertia übergeben und in der Komponente für eine aktive Styles nutzen.
🐛 Proposed fix: `view` an Inertia-Props übergeben und Active-State nutzen
Im Controller (EmailController.php):
return Inertia::render('App/Email/EmailIndex', [
'mails' => DropboxMailData::collect($mails),
'mail' => $mail ? DropboxMailData::from($mail) : null,
'dropbox' => DropboxData::from($dropbox),
'contacts' => SimpleContactData::collect($contacts),
'projects' => ProjectData::collect($projects),
+ 'view' => $view,
]);In der Komponente (EmailIndex.tsx):
interface InboxIndexProps extends PageProps {
mails: App.Data.Paginated.PaginationMeta<App.Data.DropboxMailData[]>
mail?: App.Data.DropboxMailData | null
dropbox: App.Data.DropboxData
contacts: App.Data.ContactData[]
projects: App.Data.ProjectData[]
+ view: string
}-const EmailIndex: React.FC<InboxIndexProps> = ({ contacts, dropbox, mail, mails, projects }) => {
+const EmailIndex: React.FC<InboxIndexProps> = ({ contacts, dropbox, mail, mails, projects, view }) => {- <Link href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'inbox' } })}>
- Posteingang
- </Link>
- <br />
- <Link href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'sent' } })}>
- Gesendete Objekte
- </Link>
- <br />
- <Link
- href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'archived' } })}
- >
- Archiv
- </Link>
- <br />
- <Link href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'trash' } })}>
- Papierkorb
- </Link>
+ <nav className="flex flex-col gap-2">
+ <Link
+ href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'inbox' } })}
+ className={view === 'inbox' ? 'font-bold' : ''}
+ >
+ Posteingang
+ </Link>
+ <Link
+ href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'sent' } })}
+ className={view === 'sent' ? 'font-bold' : ''}
+ >
+ Gesendete Objekte
+ </Link>
+ <Link
+ href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'archived' } })}
+ className={view === 'archived' ? 'font-bold' : ''}
+ >
+ Archiv
+ </Link>
+ <Link
+ href={route('app.email.index', { dropbox: dropbox.id, _query: { view: 'trash' } })}
+ className={view === 'trash' ? 'font-bold' : ''}
+ >
+ Papierkorb
+ </Link>
+ </nav>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@resources/js/Pages/App/Email/EmailIndex.tsx` around lines 127 - 145, Expose
the current view value from the EmailController response as an Inertia prop,
then update the mailbox navigation in the EmailIndex component to compare that
prop with each link’s view and apply the existing active-link styling to the
selected view. Preserve the current route targets and labels for inbox, sent,
archived, and trash.
Summary by CodeRabbit
Neue Funktionen
Verbesserungen