fix(ui): add cursor-pointer to all buttons globally#1182
Conversation
Instead of adding cursor-pointer to individual button classNames, set cursor: pointer on all button and [role="button"] elements via a single global CSS rule in globals.css. Also removes the now-redundant cursor-pointer class from the shared Button component. Co-authored-by: samuelswandi <samuel.swandi@gmail.com>
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughConsolidates FilesView rendering for search vs. tree, introduces FileSearchResultItem, moves NewItemInput placement, adds global Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 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 |
🚀 Preview Deployment🔗 Preview Links
Preview updates automatically with new commits |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceView/RightSidebar/FilesView/FilesView.tsx (1)
298-387:⚠️ Potential issue | 🟠 MajorSearch-mode new item creation can lose the input UI.
When
isSearchingis true,NewItemInputonly renders for the root path. If a user chooses “New File/Folder” from a search result in a subfolder,newItemModeis set but no input is rendered (tree branch is hidden). This makes those actions appear broken during search.Consider rendering
NewItemInputin the search branch for non-root parent paths or exiting search when creation starts.💡 Possible fix (render input in search mode for non-root paths)
- {isSearching ? ( - searchResultEntries.length > 0 ? ( - <div className="flex flex-col"> - {searchResultEntries.map((entry) => - renameEntry?.path === entry.path ? ( - <RenameInput - key={entry.id} - entry={entry} - onSubmit={handleRenameSubmit} - onCancel={handleRenameCancel} - /> - ) : ( - <FileSearchResultItem - key={entry.id} - entry={entry} - worktreePath={worktreePath} - onActivate={handleFileActivate} - onOpenInEditor={handleOpenInEditor} - onNewFile={handleNewFile} - onNewFolder={handleNewFolder} - onRename={handleRename} - onDelete={handleDeleteRequest} - /> - ), - )} - </div> - ) : ( - <div className="flex-1 flex items-center justify-center text-muted-foreground text-sm p-4"> - {isSearchFetching - ? "Searching files..." - : "No matching files"} - </div> - ) - ) : ( + {isSearching ? ( + <> + {newItemMode && + newItemParentPath !== worktreePath && ( + <NewItemInput + mode={newItemMode} + parentPath={newItemParentPath} + onSubmit={handleNewItemSubmit} + onCancel={handleNewItemCancel} + /> + )} + {searchResultEntries.length > 0 ? ( + <div className="flex flex-col"> + {searchResultEntries.map((entry) => + renameEntry?.path === entry.path ? ( + <RenameInput + key={entry.id} + entry={entry} + onSubmit={handleRenameSubmit} + onCancel={handleRenameCancel} + /> + ) : ( + <FileSearchResultItem + key={entry.id} + entry={entry} + worktreePath={worktreePath} + onActivate={handleFileActivate} + onOpenInEditor={handleOpenInEditor} + onNewFile={handleNewFile} + onNewFolder={handleNewFolder} + onRename={handleRename} + onDelete={handleDeleteRequest} + /> + ), + )} + </div> + ) : ( + <div className="flex-1 flex items-center justify-center text-muted-foreground text-sm p-4"> + {isSearchFetching + ? "Searching files..." + : "No matching files"} + </div> + )} + </> + ) : (
Fix property access on checkSlug response (available → status) and resolve TypeScript control flow narrowing issue in terminal handler tests.
Summary
button, [role="button"] { cursor: pointer }) inglobals.cssinstead of sprinklingcursor-pointeron individual button classNamescursor-pointerclass from the sharedButtoncomponentSupersedes #1087 with a simpler approach — one global rule covers all current and future buttons.
Co-authored-by: samuelswandi samuel.swandi@gmail.com
Summary by CodeRabbit
Style
New Features / UI
Bug Fixes
Tests