Repository navigation
Migrate bookmarks panel #3889
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
Merged
amitsingh-007
merged 12 commits into
feat-migrate-to-shadcn
from
feat-add-shadcn-ui-components
Feb 15, 2026
Merged
Migrate bookmarks panel #3889
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
be800b5
Add shadcn/ui components (Badge, Dialog, Input, Label, Textarea) and …
amitsingh-007 9706b44
Migrate BookmarksPanel components to Tailwind CSS and add hover-card
amitsingh-007 0879787
Migrate Folder components to Tailwind CSS
amitsingh-007 b5c4f67
Add shadcn/ui context-menu component and migrate context menus
amitsingh-007 14fa6a1
Add shadcn/ui components (Separator, ButtonGroup) and migrate ScrollB…
amitsingh-007 ef4fde0
Add shadcn/ui form components and migrate dialog components
amitsingh-007 6c5d5d5
Refactor FolderAddEditDialog with improved form structure
amitsingh-007 8b8f68f
Clean up dialog components and remove unused imports
amitsingh-007 d183422
Merge branch 'feat-migrate-to-shadcn' into feat-add-shadcn-ui-components
amitsingh-007 427d11d
Format UI components with Prettier and add prettierignore
amitsingh-007 8f410b7
Remove migration plan and clean up bookmark store
amitsingh-007 fdbb36e
Fix linting issues and improve code formatting
amitsingh-007 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| packages/ui/src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
apps/extension/src/entrypoints/background/misc/turnOffInputSuggestions.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 40 additions & 47 deletions
87
apps/extension/src/entrypoints/popup/components/ContextMenu.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,80 +1,73 @@ | ||
| import { HugeiconsIcon } from '@hugeicons/react'; | ||
| import { | ||
| Box, | ||
| type MantineColor, | ||
| type MantineStyleProps, | ||
| useMantineTheme, | ||
| } from '@mantine/core'; | ||
| import { | ||
| type ContextMenuItemOptions, | ||
| useContextMenu, | ||
| } from 'mantine-contextmenu'; | ||
| import { type PropsWithChildren, useMemo, useRef } from 'react'; | ||
| import { type IconType } from 'react-icons'; | ||
| import styles from './styles/ContextMenu.module.css'; | ||
| ContextMenu, | ||
| ContextMenuContent, | ||
| ContextMenuItem, | ||
| ContextMenuTrigger, | ||
| } from '@bypass/ui'; | ||
| import { useMemo, useRef } from 'react'; | ||
|
|
||
| export interface IMenuOption { | ||
| text: string; | ||
| icon: IconType; | ||
| icon: React.ComponentProps<typeof HugeiconsIcon>['icon']; | ||
| onClick: (id: string) => void; | ||
| color?: MantineColor; | ||
| variant?: 'default' | 'destructive'; | ||
| id: string; | ||
| } | ||
|
|
||
| type Props = PropsWithChildren<{ | ||
| wrapperHeight?: MantineStyleProps['h']; | ||
| interface Props { | ||
| options: IMenuOption[]; | ||
| children: React.ReactNode; | ||
| }>; | ||
| } | ||
|
|
||
| function ContextMenu({ wrapperHeight = '100%', options, children }: Props) { | ||
| const theme = useMantineTheme(); | ||
| const { showContextMenu } = useContextMenu(); | ||
| function ContextMenuWrapper({ options, children }: Props) { | ||
| const idRef = useRef(''); | ||
|
|
||
| const menuOptions = useMemo(() => { | ||
| return options.map<ContextMenuItemOptions>((option) => { | ||
| const { | ||
| text, | ||
| onClick, | ||
| icon: Icon, | ||
| color = theme.colors.blue[8], | ||
| id, | ||
| } = option; | ||
| const isRedColor = theme.colors.red.includes(color); | ||
| const className = `context-menu-item-${id}`; | ||
| return options.map((option) => { | ||
| const { text, onClick, icon, variant } = option; | ||
|
|
||
| return { | ||
| key: text, | ||
| title: text, | ||
| className, | ||
| icon: <Icon size="0.875rem" color={color} />, | ||
| color: isRedColor ? 'red' : undefined, | ||
| icon, | ||
| variant, | ||
| onClick() { | ||
| onClick(idRef.current); | ||
| idRef.current = ''; | ||
| }, | ||
| }; | ||
| }); | ||
| }, [options, theme.colors]); | ||
|
|
||
| const contextMenuHandler = showContextMenu(menuOptions, { | ||
| classNames: { | ||
| root: styles.root, | ||
| item: styles.item, | ||
| }, | ||
| }); | ||
| }, [options]); | ||
|
|
||
| const handleContextMenu: React.MouseEventHandler<HTMLDivElement> = (e) => { | ||
| const handleContextMenu = (e: React.MouseEvent) => { | ||
| const dataCtxId = (e.target as HTMLElement).dataset.contextId ?? ''; | ||
| idRef.current = dataCtxId; | ||
| contextMenuHandler(e); | ||
| }; | ||
|
|
||
| return ( | ||
| <Box w="100%" h={wrapperHeight} onContextMenu={handleContextMenu}> | ||
| {children} | ||
| </Box> | ||
| <ContextMenu> | ||
| <ContextMenuTrigger | ||
| className="h-full w-full" | ||
| onContextMenu={handleContextMenu} | ||
| > | ||
| {children} | ||
| </ContextMenuTrigger> | ||
| <ContextMenuContent className="min-w-40"> | ||
| {menuOptions.map((option) => ( | ||
| <ContextMenuItem | ||
| key={option.key} | ||
| className="gap-2" | ||
| variant={option.variant} | ||
| onClick={option.onClick} | ||
| > | ||
| <HugeiconsIcon icon={option.icon} className="size-4" /> | ||
| <span>{option.title}</span> | ||
| </ContextMenuItem> | ||
| ))} | ||
| </ContextMenuContent> | ||
| </ContextMenu> | ||
| ); | ||
| } | ||
|
|
||
| export default ContextMenu; | ||
| export default ContextMenuWrapper; |
12 changes: 0 additions & 12 deletions
12
apps/extension/src/entrypoints/popup/components/styles/ContextMenu.module.css
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.