Skip to content

Erweiterung E-Mails#582

Merged
dspangenberg merged 1 commit into
mainfrom
develop
Jul 11, 2026
Merged

Erweiterung E-Mails#582
dspangenberg merged 1 commit into
mainfrom
develop

Conversation

@dspangenberg

@dspangenberg dspangenberg commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Neue Funktionen

    • E-Mail-Nachrichten werden automatisch als eingehend erkannt und entsprechend gekennzeichnet.
    • Die E-Mail-Ansicht bietet eine neue Seitenleiste mit den Kategorien „Posteingang“, „Gesendete Objekte“ und „Archiv“.
  • Fehlerbehebungen

    • In der E-Mail-Liste werden jetzt ausschließlich eingehende Nachrichten angezeigt.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Ein neuer Artisan-Befehl setzt is_inbound für Dropbox-Mails tenantbezogen. Die E-Mail-Abfrage zeigt nur eingehende Nachrichten, und die Oberfläche erhält eine Kategorien-Seitenleiste mit angepasster Inhaltspositionierung.

Changes

Eingehende E-Mails

Layer / File(s) Summary
Dropbox-Mail-Klassifizierung
app/Console/Commands/SetInboundForDropboxMails.php
Der neue Artisan-Befehl verarbeitet alle oder einen angegebenen Tenant, vergleicht Dropbox-Adresse und Absender und speichert is_inbound.
Filter für den Posteingang
app/Http/Controllers/App/EmailController.php
Die paginierte E-Mail-Abfrage berücksichtigt nur Datensätze mit is_inbound = true.
Kategorien-Seitenleiste
resources/js/Pages/App/Email/EmailIndex.tsx
Die Ansicht zeigt Kategorien und verschiebt den rechten Inhaltsbereich neben die neue Seitenleiste.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Poem

Hoppelnd sortiert der Hase den Mail-Klee,
Dropbox-Adressen erkennt er im Schnee.
Eingänge leuchten, Kategorien stehen,
die Seitenleiste lässt alles klarer sehen.
Möhre für Möhre — der Posteingang ist schön!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive Der Titel ist sehr allgemein und beschreibt die Änderung nicht konkret genug. Bitte die Hauptänderung konkret benennen, z. B. den neuen Inbound-Filter, den Artisan-Command oder die Anpassung der E-Mail-Ansicht.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

🔧 PHPStan (2.2.2)

PHPStan was skipped because the config uses disallowed bootstrapFiles, bootstrapFile, or includes directives.


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

🧹 Nitpick comments (1)
app/Console/Commands/SetInboundForDropboxMails.php (1)

55-59: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Alle Mails auf einmal laden und bedingungslos speichern.

->get() lädt alle Mails eines Tenants in den Speicher. Bei großen Tenants kann das zu OOM führen. Zusätzlich wird jeder Mail gespeichert, auch wenn sich is_inbound nicht geändert hat — das erzeugt unnötige UPDATE-Queries.

♻️ Vorschlag: chunkById + Dirty-Check
     $tenant->run(function () {
-        $mails = DropboxMail::query()->with('dropbox')->get();
-
-        foreach ($mails as $mail) {
-            $mail->is_inbound = $mail->dropbox->real_email !== $mail->from;
-            $mail->save();
-        }
+        DropboxMail::query()
+            ->with('dropbox')
+            ->chunkById(500, function ($mails) {
+                foreach ($mails as $mail) {
+                    $mail->is_inbound = $mail->dropbox->real_email !== $mail->from;
+                    if ($mail->isDirty('is_inbound')) {
+                        $mail->save();
+                    }
+                }
+            });
     });
🤖 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 `@app/Console/Commands/SetInboundForDropboxMails.php` around lines 55 - 59,
Update the mail processing loop around DropboxMail::query() to process records
in ID-based chunks instead of loading the full result with get(). Within each
chunk, calculate is_inbound and save only mails whose value actually changed,
using the model’s dirty-check mechanism.
🤖 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/Console/Commands/SetInboundForDropboxMails.php`:
- Line 23: Update the $description property in SetInboundForDropboxMails to
accurately describe that the command classifies Dropbox mails as inbound,
replacing the copied recurring-invoice description.
- Line 28: Füge der Methode handle() in SetInboundForDropboxMails eine explizite
Rückgabetypdeklaration hinzu. Verwende den Rückgabetyp, der dem tatsächlich
zurückgegebenen Wert und dem bestehenden Laravel-Command-Vertrag entspricht.

In `@resources/js/Pages/App/Email/EmailIndex.tsx`:
- Around line 126-132: Ersetze den reinen Textblock mit <br />-Trennern durch
eine semantische Navigation mit <nav>, <ul> und <li>. Rendere jede Kategorie als
interaktives Button- oder Link-Element, binde die Auswahl an die bestehende
Zustands- oder Routinglogik an und kennzeichne den aktuell aktiven Eintrag
barrierefrei.

---

Nitpick comments:
In `@app/Console/Commands/SetInboundForDropboxMails.php`:
- Around line 55-59: Update the mail processing loop around DropboxMail::query()
to process records in ID-based chunks instead of loading the full result with
get(). Within each chunk, calculate is_inbound and save only mails whose value
actually changed, using the model’s dirty-check mechanism.
🪄 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: 9a804dde-5d1b-4321-b4fa-5d25e29fcab6

📥 Commits

Reviewing files that changed from the base of the PR and between 8792934 and 0054a86.

📒 Files selected for processing (3)
  • app/Console/Commands/SetInboundForDropboxMails.php
  • app/Http/Controllers/App/EmailController.php
  • resources/js/Pages/App/Email/EmailIndex.tsx

*
* @var string
*/
protected $description = 'Create recurring invoices that are due today';

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 | 🟡 Minor | ⚡ Quick win

Falsche Command-Beschreibung.

Die Beschreibung lautet "Create recurring invoices that are due today", aber der Befehl klassifiziert Dropbox-Mails als eingehend. Dies ist ein Copy-Paste-Fehler.

🐛 Vorgeschlagene Korrektur
-    protected $description = 'Create recurring invoices that are due today';
+    protected $description = 'Set is_inbound for dropbox mails based on sender address';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
protected $description = 'Create recurring invoices that are due today';
protected $description = 'Set is_inbound for dropbox mails based on sender address';
🤖 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 `@app/Console/Commands/SetInboundForDropboxMails.php` at line 23, Update the
$description property in SetInboundForDropboxMails to accurately describe that
the command classifies Dropbox mails as inbound, replacing the copied
recurring-invoice description.

/**
* Execute the console command.
*/
public function handle()

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Rückgabetyp für handle() fehlt.

Die Methode handle() hat keine explizite Rückgabetypdeklaration. Gemäß den Coding-Guidelines müssen alle PHP-Methoden explizite Rückgabetypen haben.

♻️ Vorgeschlagene Korrektur
-    public function handle()
+    public function handle(): int
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public function handle()
public function handle(): int
🤖 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 `@app/Console/Commands/SetInboundForDropboxMails.php` at line 28, Füge der
Methode handle() in SetInboundForDropboxMails eine explizite
Rückgabetypdeklaration hinzu. Verwende den Rückgabetyp, der dem tatsächlich
zurückgegebenen Wert und dem bestehenden Laravel-Command-Vertrag entspricht.

Source: Coding guidelines

Comment on lines +126 to +132
<div className="absolute top-0 bottom-0 w-68 border-r">
Posteingang
<br />
Gesendete Objekte
<br />
Archiv
</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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Seitenleiste ohne semantische Struktur und Interaktivität.

Die Kategorien sind als reiner Text mit <br />-Trennern implementiert. Das ist weder semantisch (keine <nav>/<ul>/<li>-Struktur) noch interaktiv (keine Klick-Handler, keine aktiven Zustände, keine Routing-Anbindung). Für Screenreader ist die Navigation nicht erfassbar.

♻️ Vorschlag: semantische Navigation mit Buttons
-      <div className="absolute top-0 bottom-0 w-68 border-r">
-        Posteingang
-        <br />
-        Gesendete Objekte
-        <br />
-        Archiv
-      </div>
+      <nav className="absolute top-0 bottom-0 w-68 border-r">
+        <ul className="flex flex-col gap-1 p-4">
+          <li>
+            <button
+              type="button"
+              className="w-full rounded-md px-3 py-2 text-left text-sm font-medium hover:bg-accent"
+            >
+              Posteingang
+            </button>
+          </li>
+          <li>
+            <button
+              type="button"
+              className="w-full rounded-md px-3 py-2 text-left text-sm font-medium hover:bg-accent"
+            >
+              Gesendete Objekte
+            </button>
+          </li>
+          <li>
+            <button
+              type="button"
+              className="w-full rounded-md px-3 py-2 text-left text-sm font-medium hover:bg-accent"
+            >
+              Archiv
+            </button>
+          </li>
+        </ul>
+      </nav>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div className="absolute top-0 bottom-0 w-68 border-r">
Posteingang
<br />
Gesendete Objekte
<br />
Archiv
</div>
<nav className="absolute top-0 bottom-0 w-68 border-r">
<ul className="flex flex-col gap-1 p-4">
<li>
<button
type="button"
className="w-full rounded-md px-3 py-2 text-left text-sm font-medium hover:bg-accent"
>
Posteingang
</button>
</li>
<li>
<button
type="button"
className="w-full rounded-md px-3 py-2 text-left text-sm font-medium hover:bg-accent"
>
Gesendete Objekte
</button>
</li>
<li>
<button
type="button"
className="w-full rounded-md px-3 py-2 text-left text-sm font-medium hover:bg-accent"
>
Archiv
</button>
</li>
</ul>
</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 126 - 132, Ersetze
den reinen Textblock mit <br />-Trennern durch eine semantische Navigation mit
<nav>, <ul> und <li>. Rendere jede Kategorie als interaktives Button- oder
Link-Element, binde die Auswahl an die bestehende Zustands- oder Routinglogik an
und kennzeichne den aktuell aktiven Eintrag barrierefrei.

@dspangenberg
dspangenberg merged commit 52c4ecc into main Jul 11, 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