-
Notifications
You must be signed in to change notification settings - Fork 402
Extract AssetsSidebarTab template and improve UI structure #6164
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
Extract AssetsSidebarTab template and improve UI structure #6164
Conversation
🎭 Playwright Test Results⏰ Completed at: 10/23/2025, 02:24:14 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
bee62d3 to
61eed48
Compare
ac427e5 to
bd23ccc
Compare
915a9e9 to
39dad98
Compare
97d6a6f to
6769687
Compare
354c05e to
98390f5
Compare
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.
Comprehensive PR Review
This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.
Review Summary
PR: Extract AssetsSidebarTab template and improve UI structure (#6164)
Impact: 729 additions, 62 deletions across 15 files
Issue Distribution
- Critical: 0
- High: 1
- Medium: 5
- Low: 2
Category Breakdown
- Architecture: 2 issues
- Security: 1 issue
- Performance: 0 issues
- Code Quality: 5 issues
Key Findings
Architecture & Design
The PR introduces custom tab components to replace PrimeVue's TabView, which diverges from the established component library ecosystem. While the implementation follows Vue 3 patterns correctly, it creates duplicate functionality that may be better addressed by extending PrimeVue components with custom styling. The AssetSidebarTemplate component shows good separation of concerns but could benefit from more flexible, composable design patterns.
Security Considerations
The code handles external URLs and user-provided metadata without sufficient validation. Direct assignment of output.url to preview_url poses potential XSS risks if malicious content is provided. Type assertions using 'as any[]' bypass TypeScript safety mechanisms for user-provided data.
Performance Impact
No significant performance concerns identified. The use of VirtualGrid for asset rendering and computed properties for reactive data are appropriate patterns. The component properly leverages Vue 3's reactivity system.
Integration Points
The PR maintains backward compatibility while introducing new folder view functionality. The integration with existing media asset systems appears solid, with proper error handling for toast notifications and clipboard operations.
Positive Observations
- Excellent test coverage for the new UUID utility functions with comprehensive edge cases
- Proper use of Vue 3 Composition API and TypeScript throughout
- Good separation of concerns with template extraction
- Appropriate use of semantic CSS tokens for theming
- Proper i18n integration for new UI strings
References
Next Steps
- Address critical issues before merge (currently none)
- Consider architectural feedback for long-term maintainability
- Add proper validation for external URL handling
- Remove debug console.log statements
- Consider extending PrimeVue components instead of reimplementing tab functionality
This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.
src/platform/assets/composables/useMediaAssets/useInternalFilesApi.ts
Outdated
Show resolved
Hide resolved
cefad39 to
13c5b44
Compare
- Add folder view to display all outputs from a single batch job - Show output count badge on assets with multiple batch outputs - Add job ID display and copy functionality in folder view header - Display execution time for batch jobs - Implement download functionality for output assets only - Add inspect action to asset more menu - Extract prompt ID from asset IDs using new UUID utility - Add comprehensive tests for UUID extraction utilities
- Use existing formatDuration util from shared utils instead of custom implementation - Extract execution time formatting to computed property for cleaner template - Remove 'any' type assertion in MediaAssetActions, use proper types
- Extract sidebar template into reusable AssetSidebarTemplate component - Replace PrimeVue Tabs with TextButton for better visual consistency - Add i18n key for "Back to all assets" button - Improve job detail view header layout with better spacing - Maintain existing functionality while cleaning up template structure
- Add new Tab and TabList components with provide/inject pattern for state management - Replace TextButton-based tabs with new Tab components in AssetsSidebarTab - Update AssetSidebarTemplate to use semantic color tokens (bg-interface-panel-surface) - Improve tab styling with proper hover and focus states
492116b to
75c865c
Compare
- Replace type assertions with type guards and proper runtime checks - Add OutputAssetMetadata interface for structured metadata typing - Use uuid package instead of custom regex validation - Add i18n support for toast messages (Job ID copy) - Implement WAI-ARIA tab pattern with basic accessibility - Remove complex keyboard navigation in favor of simple tab key navigation - Add getAssetType utility function for consistent type handling - Use test.for for parameterized UUID validation tests - Simplify Tab components to focus on basic accessibility requirements
validation - Replace any type with proper Record<string, unknown> | undefined - Fix nodeId type check to support both string and number types - Remove redundant object type checks in type guard - Remove unused isValidUuidV4 function from uuidUtil - Simplify metadata validation logic
|
Thank you for the thorough review! I’ve addressed all feedback and implemented the requested changes. Changes Made Pending Item The suggestion to use the provide/inject pattern for MediaAssetCard actions (from @DrJKL’s review) will be handled in a separate PR to keep this one focused on the current feedback. All tests are passing, and the code is ready for review. Please let me know if anything needs clarification! |
b48636a
into
feature/media-asset-sidebar-tab
## Summary - Extract sidebar template into reusable AssetSidebarTemplate component - Replace PrimeVue Tabs with TextButton for better visual consistency - Improve job detail view header layout with better spacing ## Changes - Created `AssetSidebarTemplate.vue` as a reusable template component - Replaced PrimeVue Tabs with TextButton components for tab navigation - Added i18n translation key for "Back to all assets" button - Improved spacing and layout in job detail view header - Maintained all existing functionality while cleaning up template structure ## Test Plan - [ ] Verify tab switching between Imported and Generated tabs works correctly - [ ] Test job detail view displays properly with Job ID and execution time - [ ] Confirm "Back to all assets" button returns to main view - [ ] Check that all existing media asset features remain functional - [ ] Verify UI consistency with other sidebar tabs [screen-capture.webm](https://github.com/user-attachments/assets/4ed192e1-a9f7-4fc1-a41e-f732741dd55d)
## Summary - Extract sidebar template into reusable AssetSidebarTemplate component - Replace PrimeVue Tabs with TextButton for better visual consistency - Improve job detail view header layout with better spacing ## Changes - Created `AssetSidebarTemplate.vue` as a reusable template component - Replaced PrimeVue Tabs with TextButton components for tab navigation - Added i18n translation key for "Back to all assets" button - Improved spacing and layout in job detail view header - Maintained all existing functionality while cleaning up template structure ## Test Plan - [ ] Verify tab switching between Imported and Generated tabs works correctly - [ ] Test job detail view displays properly with Job ID and execution time - [ ] Confirm "Back to all assets" button returns to main view - [ ] Check that all existing media asset features remain functional - [ ] Verify UI consistency with other sidebar tabs [screen-capture.webm](https://github.com/user-attachments/assets/4ed192e1-a9f7-4fc1-a41e-f732741dd55d)
## Summary - Extract sidebar template into reusable AssetSidebarTemplate component - Replace PrimeVue Tabs with TextButton for better visual consistency - Improve job detail view header layout with better spacing ## Changes - Created `AssetSidebarTemplate.vue` as a reusable template component - Replaced PrimeVue Tabs with TextButton components for tab navigation - Added i18n translation key for "Back to all assets" button - Improved spacing and layout in job detail view header - Maintained all existing functionality while cleaning up template structure ## Test Plan - [ ] Verify tab switching between Imported and Generated tabs works correctly - [ ] Test job detail view displays properly with Job ID and execution time - [ ] Confirm "Back to all assets" button returns to main view - [ ] Check that all existing media asset features remain functional - [ ] Verify UI consistency with other sidebar tabs [screen-capture.webm](https://github.com/user-attachments/assets/4ed192e1-a9f7-4fc1-a41e-f732741dd55d)
## Summary - Extract sidebar template into reusable AssetSidebarTemplate component - Replace PrimeVue Tabs with TextButton for better visual consistency - Improve job detail view header layout with better spacing ## Changes - Created `AssetSidebarTemplate.vue` as a reusable template component - Replaced PrimeVue Tabs with TextButton components for tab navigation - Added i18n translation key for "Back to all assets" button - Improved spacing and layout in job detail view header - Maintained all existing functionality while cleaning up template structure ## Test Plan - [ ] Verify tab switching between Imported and Generated tabs works correctly - [ ] Test job detail view displays properly with Job ID and execution time - [ ] Confirm "Back to all assets" button returns to main view - [ ] Check that all existing media asset features remain functional - [ ] Verify UI consistency with other sidebar tabs [screen-capture.webm](https://github.com/user-attachments/assets/4ed192e1-a9f7-4fc1-a41e-f732741dd55d)
## Summary - Extract sidebar template into reusable AssetSidebarTemplate component - Replace PrimeVue Tabs with TextButton for better visual consistency - Improve job detail view header layout with better spacing ## Changes - Created `AssetSidebarTemplate.vue` as a reusable template component - Replaced PrimeVue Tabs with TextButton components for tab navigation - Added i18n translation key for "Back to all assets" button - Improved spacing and layout in job detail view header - Maintained all existing functionality while cleaning up template structure ## Test Plan - [ ] Verify tab switching between Imported and Generated tabs works correctly - [ ] Test job detail view displays properly with Job ID and execution time - [ ] Confirm "Back to all assets" button returns to main view - [ ] Check that all existing media asset features remain functional - [ ] Verify UI consistency with other sidebar tabs [screen-capture.webm](https://github.com/user-attachments/assets/4ed192e1-a9f7-4fc1-a41e-f732741dd55d)
## Summary - Extract sidebar template into reusable AssetSidebarTemplate component - Replace PrimeVue Tabs with TextButton for better visual consistency - Improve job detail view header layout with better spacing ## Changes - Created `AssetSidebarTemplate.vue` as a reusable template component - Replaced PrimeVue Tabs with TextButton components for tab navigation - Added i18n translation key for "Back to all assets" button - Improved spacing and layout in job detail view header - Maintained all existing functionality while cleaning up template structure ## Test Plan - [ ] Verify tab switching between Imported and Generated tabs works correctly - [ ] Test job detail view displays properly with Job ID and execution time - [ ] Confirm "Back to all assets" button returns to main view - [ ] Check that all existing media asset features remain functional - [ ] Verify UI consistency with other sidebar tabs [screen-capture.webm](https://github.com/user-attachments/assets/4ed192e1-a9f7-4fc1-a41e-f732741dd55d)
Summary
Changes
AssetSidebarTemplate.vueas a reusable template componentTest Plan
screen-capture.webm