release/v0.1.12-phase12-recent-conversions-table#181
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nversions-table-skeleton CONV-164: Create RecentConversionsTable skeleton
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONV-165: Add empty state
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lumn CONV-166: Add file name column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arget-format-columns CONV-167: Add source and target format columns
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lumn CONV-168: Add file size column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONV-169: Add date column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-column CONV-170: Add status badge column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-action CONV-171: Add download row action
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONV-172: Add search input
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONV-173: Add status filter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CONV-174: Add pagination
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…n-test CONV-175: Add convert again test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t-again-action CONV-176: Implement convert again action
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ion-test CONV-177: Add star conversion test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onversion-action CONV-178: Implement star conversion action
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ization-tests CONV-179: Add table authorization tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rsions-integration-test CONV-180: Add recent conversions integration test
📝 WalkthroughWalkthroughAdds a "Recent Conversions" Livewire table: searchable, status-filtered, paginated, user-scoped, with actions to star jobs and request repeat conversions; adds an is_starred column and model flag; integrates the component into the dashboard and includes comprehensive tests. ChangesRecent Conversions Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/Feature/Livewire/RecentConversionsTableAuthorizationTest.php (1)
57-65: ⚡ Quick winStore the other user's job in a variable for clarity.
The inline query
ConversionJob::where('user_id', $other->id)->first()on line 65 works but reduces readability and adds an unnecessary database query in the assertion.♻️ Proposed refactor
- ConversionJob::factory()->for($other)->completed()->create([ + $otherJob = ConversionJob::factory()->for($other)->completed()->create([ 'result_file_id' => $otherResult->id, ]); $this->actingAs($user); Livewire::test(RecentConversionsTable::class) ->assertSeeHtml(route('conversions.download', $ownJob)) - ->assertDontSeeHtml(route('conversions.download', ConversionJob::where('user_id', $other->id)->first())); + ->assertDontSeeHtml(route('conversions.download', $otherJob));🤖 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 `@tests/Feature/Livewire/RecentConversionsTableAuthorizationTest.php` around lines 57 - 65, The assertion uses an inline query ConversionJob::where('user_id', $other->id)->first() which hurts readability and issues an extra DB call; instead, after creating the other user's job with ConversionJob::factory()->for($other)->completed()->create([...]) assign that returned model to a variable (e.g. $otherJob) and then use route('conversions.download', $otherJob) in the Livewire::test assertions alongside $ownJob and RecentConversionsTable::class to remove the inline query and make the test clearer.
🤖 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 `@resources/views/livewire/recent-conversions-table.blade.php`:
- Around line 68-81: Add two helper methods to the Livewire component
RecentConversionsTable: public function canDownload(ConversionJob $job): bool {
return $job->isCompleted() && $job->result_file_id !== null; } and public
function canConvertAgain(ConversionJob $job): bool { return $job->isCompleted()
|| $job->status === ConversionStatus::Failed; } (import ConversionStatus in the
component), then update recent-conversions-table.blade.php to replace the inline
conditionals ($job->isCompleted() && $job->result_file_id, $job->isCompleted()
|| $job->status === \App\Enums\ConversionStatus::Failed) with calls to
canDownload($job) and canConvertAgain($job) respectively so all business rules
live in the component.
---
Nitpick comments:
In `@tests/Feature/Livewire/RecentConversionsTableAuthorizationTest.php`:
- Around line 57-65: The assertion uses an inline query
ConversionJob::where('user_id', $other->id)->first() which hurts readability and
issues an extra DB call; instead, after creating the other user's job with
ConversionJob::factory()->for($other)->completed()->create([...]) assign that
returned model to a variable (e.g. $otherJob) and then use
route('conversions.download', $otherJob) in the Livewire::test assertions
alongside $ownJob and RecentConversionsTable::class to remove the inline query
and make the test clearer.
🪄 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: de97c0d2-b55e-4bd5-8d50-7dc508c715fe
📒 Files selected for processing (9)
app/Livewire/RecentConversionsTable.phpapp/Models/ConversionJob.phpdatabase/migrations/2026_06_02_074426_add_is_starred_to_conversion_jobs_table.phpresources/views/dashboard.blade.phpresources/views/livewire/recent-conversions-table.blade.phptests/Feature/Livewire/RecentConversionsTableActionsTest.phptests/Feature/Livewire/RecentConversionsTableAuthorizationTest.phptests/Feature/Livewire/RecentConversionsTableIntegrationTest.phptests/Feature/Livewire/RecentConversionsTableTest.php
…ine DB query in test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/Livewire/RecentConversionsTable.php (1)
72-83: ⚡ Quick winConsider gating
convertAgain()with the newcanConvertAgain()helper.The new
canConvertAgain()eligibility rule is only enforced in the view, while theconvertAgain()action dispatchesconversion-repeat-requestedfor any user-owned job regardless of status (e.g. aQueued/Processingjob). Since Livewire actions are directly callable from the client, the UI gate can be bypassed. Aligning the action with the helper keeps the eligibility rule authoritative server-side.♻️ Proposed change
if (! $job) { return; } + if (! $this->canConvertAgain($job)) { + return; + } + $this->dispatch('conversion-repeat-requested', conversionJobId: $job->id);🤖 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/Livewire/RecentConversionsTable.php` around lines 72 - 83, The convertAgain() Livewire action currently dispatches conversion-repeat-requested for any user-owned ConversionJob; update it to call the canConvertAgain() helper and only dispatch when that helper returns true for the loaded $job. Locate the convertAgain() method in RecentConversionsTable.php, after fetching the $job, invoke canConvertAgain($job) (or the appropriate helper signature) and return early if it’s false, so only eligible jobs (per the server-side rule) trigger the dispatch('conversion-repeat-requested', conversionJobId: $job->id).
🤖 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.
Nitpick comments:
In `@app/Livewire/RecentConversionsTable.php`:
- Around line 72-83: The convertAgain() Livewire action currently dispatches
conversion-repeat-requested for any user-owned ConversionJob; update it to call
the canConvertAgain() helper and only dispatch when that helper returns true for
the loaded $job. Locate the convertAgain() method in RecentConversionsTable.php,
after fetching the $job, invoke canConvertAgain($job) (or the appropriate helper
signature) and return early if it’s false, so only eligible jobs (per the
server-side rule) trigger the dispatch('conversion-repeat-requested',
conversionJobId: $job->id).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6f9ca487-5e08-4ce6-a812-27bec5e4776b
📒 Files selected for processing (3)
app/Livewire/RecentConversionsTable.phpresources/views/livewire/recent-conversions-table.blade.phptests/Feature/Livewire/RecentConversionsTableAuthorizationTest.php
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/Feature/Livewire/RecentConversionsTableAuthorizationTest.php
- resources/views/livewire/recent-conversions-table.blade.php
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 12 — Recent Conversions Table
Summary
Implements the
RecentConversionsTableLivewire component on the dashboard (CONV-164–CONV-180).What's included
RecentConversionsTableskeleton component + dashboard integrationisCompleted()model helperconversion-repeat-requestedevent)is_starredmigration + model castSecurity
auth()->id()convertAgain,toggleStar) silently no-op on foreign jobsStats
composer lint— passesnpm run build— passes🤖 Generated with Claude Code
Summary by cubic
Adds a
LivewireRecent Conversions table to the dashboard so users can search, filter, and act on their latest conversion jobs. Meets CONV-164–CONV-180, scopes all data to the signed-in user, and guards the convert-again action to ignore queued/processing jobs.New Features
RecentConversionsTablewith columns: file name, from/to formats (uppercase), size (result or source), date, status badge.conversion-repeat-requestedfor completed/failed), Star/Unstar.auth()->id(), actions no-op for other users’ jobs, download links hidden for non-owners.is_starredboolean cast,isCompleted()helper, eager-loadsourceFile/resultFile, extractedcanDownload/canConvertAgainhelpers.Migration
is_starredtoconversion_jobs(default false).Written for commit 6788d2b. Summary will update on new commits.
Summary by CodeRabbit
New Features
Behavior
Tests