Skip to content

E-Mail-Views#583

Merged
dspangenberg merged 2 commits into
mainfrom
develop
Jul 12, 2026
Merged

E-Mail-Views#583
dspangenberg merged 2 commits into
mainfrom
develop

Conversation

@dspangenberg

@dspangenberg dspangenberg commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Neue Funktionen

    • E-Mail-Ansicht unterstützt jetzt Posteingang, gesendete Nachrichten, Archiv und Papierkorb.
    • Nachrichten können in den Papierkorb verschoben und bei Bedarf archiviert werden.
    • Die E-Mail-Navigation ermöglicht den direkten Wechsel zwischen den verschiedenen Ansichten.
  • Verbesserungen

    • Die angezeigte Nachrichtenliste wird passend zur ausgewählten Ansicht geladen.
    • Archivierte und gelöschte Nachrichten werden getrennt von aktiven Nachrichten behandelt.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@dspangenberg, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a3407896-10a4-4804-80d7-3eb9a9facf88

📥 Commits

Reviewing files that changed from the base of the PR and between a8c4600 and 8b3e996.

📒 Files selected for processing (2)
  • app/Http/Controllers/App/EmailController.php
  • app/Models/DropboxMail.php

Walkthrough

Die 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.

Changes

Mailbox views

Layer / File(s) Summary
Soft-delete storage and mailbox query scope
database/migrations/tenant/..., app/Models/DropboxMail.php
dropbox_mails erhält Soft Deletes. scopeView filtert Inbox, gesendete, archivierte und gelöschte Mails.
Request-driven email index
app/Http/Controllers/App/EmailController.php
EmailController@index liest den view-Parameter und verwendet ihn für die Mail-Abfrage sowie die paginierten Indexdaten.
Mailbox view navigation
resources/js/Pages/App/Email/EmailIndex.tsx
Die Navigation verwendet Inertia-Links für die vier Mailbox-Ansichten.

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
Loading

Possibly related PRs

Poem

Hopp, hopp, der Posteingang wird fein,
Archiv und Papierkorb schließen sich ein.
Gesendet zieht leise vorbei,
Soft Deletes machen die Mails sorgenfrei.
Ein Link führt jede Ansicht geschwind —
so jubelt der Hase im Frühlingswind!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Der Titel passt zum Kern der Änderung, da die PR die E-Mail-Ansichten und deren Navigation/Filterung anpasst.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 52c4ecc and a8c4600.

📒 Files selected for processing (4)
  • app/Http/Controllers/App/EmailController.php
  • app/Models/DropboxMail.php
  • database/migrations/tenant/2026_07_12_135807_add_softdelete_to_dropbox_mails.php
  • resources/js/Pages/App/Email/EmailIndex.tsx

Comment thread app/Http/Controllers/App/EmailController.php Outdated
Comment thread app/Models/DropboxMail.php Outdated
Comment thread app/Models/DropboxMail.php
Comment on lines +127 to +145
<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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 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.

@dspangenberg
dspangenberg merged commit 71ed5b2 into main Jul 12, 2026
3 checks passed
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