-
Notifications
You must be signed in to change notification settings - Fork 4k
refactor: update media upload button and tooltip in media panel, so i… #557
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ import { processMediaFiles } from "@/lib/media-processing"; | |
| import { useMediaStore, type MediaItem } from "@/stores/media-store"; | ||
| import { | ||
| ArrowDown01, | ||
| CloudUpload, | ||
| Upload, | ||
| Grid2X2, | ||
| Image, | ||
| List, | ||
|
|
@@ -292,22 +292,27 @@ export function MediaView() { | |
| <div className="p-3 pb-2 bg-panel"> | ||
| {/* Search and filter controls */} | ||
| <div className="flex items-center gap-2"> | ||
| <Button | ||
| variant="outline" | ||
| size="lg" | ||
| onClick={handleFileSelect} | ||
| disabled={isProcessing} | ||
| className="!bg-background px-4 flex-1 justify-center items-center h-9 opacity-100 hover:opacity-75 transition-opacity" | ||
| > | ||
| {isProcessing ? ( | ||
| <Loader2 className="h-4 w-4 animate-spin" /> | ||
| ) : ( | ||
| <CloudUpload className="h-4 w-4" /> | ||
| )} | ||
| <span>Upload</span> | ||
| </Button> | ||
| <div className="flex items-center gap-0"> | ||
| <TooltipProvider> | ||
| <Tooltip> | ||
| <TooltipTrigger asChild> | ||
| <Button | ||
| variant="text" | ||
| size="icon" | ||
| onClick={handleFileSelect} | ||
| disabled={isProcessing} | ||
| > | ||
| {isProcessing ? ( | ||
| <Loader2 className="!size-4 animate-spin" /> | ||
| ) : ( | ||
| <Upload className="!size-4" /> | ||
| )} | ||
| </Button> | ||
| </TooltipTrigger> | ||
| <TooltipContent> | ||
| <p>Upload media</p> | ||
| </TooltipContent> | ||
| </Tooltip> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing closing View Details📝 Patch Detailsdiff --git a/apps/web/src/components/editor/media-panel/views/media.tsx b/apps/web/src/components/editor/media-panel/views/media.tsx
index ec85507..abca8b1 100644
--- a/apps/web/src/components/editor/media-panel/views/media.tsx
+++ b/apps/web/src/components/editor/media-panel/views/media.tsx
@@ -343,7 +343,8 @@ export function MediaView() {
: "Switch to grid view"}
</p>
</TooltipContent>
- <Tooltip>
+ </Tooltip>
+ <Tooltip>
<DropdownMenu>
<TooltipTrigger asChild>
<DropdownMenuTrigger asChild>
AnalysisThe tooltip structure for the view mode button (starting at line 316) is not properly closed before a new tooltip opens at line 346. The current structure has:
However, there's no The structure should be: </TooltipContent>
</Tooltip> // ← This is missing
<Tooltip>RecommendationAdd the missing </TooltipContent>
</Tooltip>
<Tooltip> |
||
| <Tooltip> | ||
| <TooltipTrigger asChild> | ||
| <Button | ||
|
|
||
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.
🛠️ Refactor suggestion
Add button type and accessible name; include titles on icons
Apply the following changes:
📝 Committable suggestion
🤖 Prompt for AI Agents