-
-
Notifications
You must be signed in to change notification settings - Fork 254
Add archive extension selection #1828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughArchive creation now accepts a selected compression extension. The extension value is added to the UI form, validated by the request, passed through the API controller, and forwarded to the daemon repository's compressFiles call and daemon payload. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant UI as Filament UI
participant API as FileController (API)
participant Req as CompressFilesRequest
participant Repo as DaemonFileRepository
participant Daemon as File Daemon
Note over UI: User selects files, enters name + extension
UI->>API: POST /compress { files, name, extension }
API->>Req: validate request (includes extension rule)
Req-->>API: validation result
API->>Repo: compressFiles(root, files, name, extension)
Repo->>Daemon: HTTP POST /compress { files, name, extension }
Daemon-->>Repo: 200 OK / job info
Repo-->>API: result
API-->>UI: 200 OK / activity log
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
app/Filament/Server/Resources/Files/Pages/ListFiles.php (2)
302-319: Add a default value to the extension Select.The Select component uses
selectablePlaceholder(false)but doesn't specify a default value. While this forces the user to make a selection, adding a default would provide better UX and ensure robustness in case of unexpected behavior.Apply this diff to add a sensible default:
Select::make('extension') ->label(trans('server/file.actions.archive.extension')) + ->default('tar.gz') ->selectablePlaceholder(false) ->native(false) ->options([ 'tar.gz' => 'tar.gz', 'zip' => 'zip', 'tar.bz2' => 'tar.bz2', 'tar.xz' => 'tar.xz', ]) ->columnSpan(1),
411-428: Add a default value to the extension Select for bulk actions.Same as the single-file archive action, the bulk action's Select component should have a default value for consistency and robustness.
Apply this diff:
Select::make('extension') ->label(trans('server/file.actions.archive.extension')) + ->default('tar.gz') ->selectablePlaceholder(false) ->native(false) ->options([ 'tar.gz' => 'tar.gz', 'zip' => 'zip', 'tar.bz2' => 'tar.bz2', 'tar.xz' => 'tar.xz', ]) ->columnSpan(1),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
app/Filament/Server/Resources/Files/Pages/ListFiles.php(3 hunks)app/Http/Controllers/Api/Client/Servers/FileController.php(1 hunks)app/Http/Requests/Api/Client/Servers/Files/CompressFilesRequest.php(1 hunks)app/Repositories/Daemon/DaemonFileRepository.php(2 hunks)lang/en/server/file.php(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-15T11:55:53.461Z
Learnt from: rmartinoscar
PR: pelican-dev/panel#1801
File: app/Extensions/OAuth/Schemas/AuthentikSchema.php:7-10
Timestamp: 2025-10-15T11:55:53.461Z
Learning: In Filament v4, Wizard Step components use the Filament\Schemas namespace (Filament\Schemas\Components\Wizard\Step), not Filament\Forms.
Applied to files:
app/Filament/Server/Resources/Files/Pages/ListFiles.php
🧬 Code graph analysis (1)
app/Filament/Server/Resources/Files/Pages/ListFiles.php (2)
app/Filament/Server/Resources/Files/Pages/EditFiles.php (1)
getDaemonFileRepository(270-277)app/Repositories/Daemon/DaemonFileRepository.php (1)
compressFiles(156-170)
🔇 Additional comments (7)
app/Http/Controllers/Api/Client/Servers/FileController.php (1)
215-216: LGTM! Extension parameter correctly passed to repository.The extension parameter is properly extracted from the validated request and passed to the compression routine.
lang/en/server/file.php (1)
49-49: LGTM! Translation key correctly added.The extension label is properly placed under the archive actions section.
app/Repositories/Daemon/DaemonFileRepository.php (2)
156-156: LGTM! Method signature correctly updated.The optional extension parameter is properly typed and aligns with the updated compression flow.
167-167: LGTM! Extension correctly included in payload.The null coalescing to empty string is consistent with the
nameparameter handling on line 166.app/Filament/Server/Resources/Files/Pages/ListFiles.php (3)
29-29: LGTM! Correct imports added.The Select and Grid components are properly imported for the archive UI enhancements.
Also applies to: 36-36
322-322: LGTM! Extension parameter correctly passed.The extension from the form data is properly passed to the compression routine.
433-433: LGTM! Extension parameter correctly passed for bulk actions.The extension is properly passed to the compression routine for bulk file operations.
Requires wings/#123
Allows the user to pick an archive type,