-
Notifications
You must be signed in to change notification settings - Fork 10
Migrate sidebar to @posthog/quill #1663
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
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9e96ccd
sidebar and project switcher => quill
adamleithp 17bac2e
small change
adamleithp f83e53e
fix sidebar item active
adamleithp 4d0371f
quill update
adamleithp 9da6257
quill update again
adamleithp 432a9a2
install npm quill instead of link
adamleithp feaa98a
task list TaskFilterMenu update: move to quill, align start so you ca…
adamleithp b731616
sidebar section now using quill button
adamleithp 50b70df
looking good
adamleithp d90f79d
conflicts, update beta badge to quill
adamleithp 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
Some comments aren't visible on the classic Files Changed page.
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
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
122 changes: 61 additions & 61 deletions
122
apps/code/src/renderer/features/command/components/Command.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,161 +1,161 @@ | ||
| import { Command as CmdkCommand } from "cmdk"; | ||
| import { | ||
| CommandDialog, | ||
| CommandEmpty, | ||
| CommandGroup, | ||
| CommandInput, | ||
| CommandItem, | ||
| CommandList, | ||
| CommandRoot, | ||
| } from "cmdk"; | ||
| import React from "react"; | ||
| import "./Command.css"; | ||
|
|
||
| interface CommandRootProps extends React.ComponentProps<typeof CmdkCommand> { | ||
| type CommandRootProps = React.ComponentPropsWithoutRef<typeof CommandRoot> & { | ||
| className?: string; | ||
| } | ||
| }; | ||
|
|
||
| const CommandRoot = React.forwardRef< | ||
| React.ElementRef<typeof CmdkCommand>, | ||
| const CommandRootWrapper = React.forwardRef< | ||
| React.ElementRef<typeof CommandRoot>, | ||
| CommandRootProps | ||
| >(({ className, ...props }, ref) => { | ||
| return ( | ||
| <CmdkCommand | ||
| <CommandRoot | ||
| ref={ref} | ||
| className={`flex h-full w-full flex-col overflow-hidden ${className || ""}`} | ||
| {...props} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| CommandRoot.displayName = "CommandRoot"; | ||
| CommandRootWrapper.displayName = "CommandRoot"; | ||
|
|
||
| interface CommandInputProps | ||
| extends React.ComponentProps<typeof CmdkCommand.Input> { | ||
| type CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandInput> & { | ||
| className?: string; | ||
| } | ||
| }; | ||
|
|
||
| const CommandInput = React.forwardRef< | ||
| React.ElementRef<typeof CmdkCommand.Input>, | ||
| const CommandInputWrapper = React.forwardRef< | ||
| React.ElementRef<typeof CommandInput>, | ||
| CommandInputProps | ||
| >(({ className, ...props }, ref) => { | ||
| return <CmdkCommand.Input ref={ref} className={className} {...props} />; | ||
| return <CommandInput ref={ref} className={className} {...props} />; | ||
| }); | ||
|
|
||
| CommandInput.displayName = "CommandInput"; | ||
| CommandInputWrapper.displayName = "CommandInput"; | ||
|
|
||
| interface CommandListProps | ||
| extends React.ComponentProps<typeof CmdkCommand.List> { | ||
| type CommandListProps = React.ComponentPropsWithoutRef<typeof CommandList> & { | ||
| className?: string; | ||
| } | ||
| }; | ||
|
|
||
| const CommandList = React.forwardRef< | ||
| React.ElementRef<typeof CmdkCommand.List>, | ||
| const CommandListWrapper = React.forwardRef< | ||
| React.ElementRef<typeof CommandList>, | ||
| CommandListProps | ||
| >(({ className, ...props }, ref) => { | ||
| return ( | ||
| <CmdkCommand.List | ||
| <CommandList | ||
| ref={ref} | ||
| className={`overflow-y-auto ${className || ""}`} | ||
| {...props} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| CommandList.displayName = "CommandList"; | ||
| CommandListWrapper.displayName = "CommandList"; | ||
|
|
||
| interface CommandItemProps | ||
| extends React.ComponentProps<typeof CmdkCommand.Item> { | ||
| type CommandItemProps = React.ComponentPropsWithoutRef<typeof CommandItem> & { | ||
| className?: string; | ||
| } | ||
| }; | ||
|
|
||
| const CommandItem = React.forwardRef< | ||
| React.ElementRef<typeof CmdkCommand.Item>, | ||
| const CommandItemWrapper = React.forwardRef< | ||
| React.ElementRef<typeof CommandItem>, | ||
| CommandItemProps | ||
| >(({ className, ...props }, ref) => { | ||
| return ( | ||
| <CmdkCommand.Item | ||
| <CommandItem | ||
| ref={ref} | ||
| className={`relative flex cursor-pointer select-none items-center px-3 py-2 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent-3 data-[disabled=true]:opacity-50 ${className || ""}`} | ||
| {...props} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| CommandItem.displayName = "CommandItem"; | ||
| CommandItemWrapper.displayName = "CommandItem"; | ||
|
|
||
| interface CommandGroupProps | ||
| extends React.ComponentProps<typeof CmdkCommand.Group> { | ||
| type CommandGroupProps = React.ComponentPropsWithoutRef<typeof CommandGroup> & { | ||
| className?: string; | ||
| heading?: string; | ||
| } | ||
| }; | ||
|
|
||
| const CommandGroup = React.forwardRef< | ||
| React.ElementRef<typeof CmdkCommand.Group>, | ||
| const CommandGroupWrapper = React.forwardRef< | ||
| React.ElementRef<typeof CommandGroup>, | ||
| CommandGroupProps | ||
| >(({ className, heading, children, ...props }, ref) => { | ||
| return ( | ||
| <CmdkCommand.Group | ||
| ref={ref} | ||
| className={`p-1 ${className || ""}`} | ||
| {...props} | ||
| > | ||
| <CommandGroup ref={ref} className={`p-1 ${className || ""}`} {...props}> | ||
| {heading && ( | ||
| <div className="px-2 py-1.5 text-gray-11" style={{ fontSize: "14px" }}> | ||
| {heading} | ||
| </div> | ||
| )} | ||
| {children} | ||
| </CmdkCommand.Group> | ||
| </CommandGroup> | ||
| ); | ||
| }); | ||
|
|
||
| CommandGroup.displayName = "CommandGroup"; | ||
| CommandGroupWrapper.displayName = "CommandGroup"; | ||
|
|
||
| interface CommandEmptyProps | ||
| extends React.ComponentProps<typeof CmdkCommand.Empty> { | ||
| type CommandEmptyProps = React.ComponentPropsWithoutRef<typeof CommandEmpty> & { | ||
| className?: string; | ||
| } | ||
| }; | ||
|
|
||
| const CommandEmpty = React.forwardRef< | ||
| React.ElementRef<typeof CmdkCommand.Empty>, | ||
| const CommandEmptyWrapper = React.forwardRef< | ||
| React.ElementRef<typeof CommandEmpty>, | ||
| CommandEmptyProps | ||
| >(({ className, ...props }, ref) => { | ||
| return ( | ||
| <CmdkCommand.Empty | ||
| <CommandEmpty | ||
| ref={ref} | ||
| className={`py-6 text-center text-sm ${className || ""}`} | ||
| {...props} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| CommandEmpty.displayName = "CommandEmpty"; | ||
| CommandEmptyWrapper.displayName = "CommandEmpty"; | ||
|
|
||
| interface CommandDialogProps | ||
| extends React.ComponentProps<typeof CmdkCommand.Dialog> { | ||
| type CommandDialogProps = React.ComponentPropsWithoutRef< | ||
| typeof CommandDialog | ||
| > & { | ||
| className?: string; | ||
| contentClassName?: string; | ||
| } | ||
| }; | ||
|
|
||
| const CommandDialog = ({ | ||
| const CommandDialogWrapper = ({ | ||
| className, | ||
| contentClassName, | ||
| children, | ||
| ...props | ||
| }: CommandDialogProps) => { | ||
| return ( | ||
| <CmdkCommand.Dialog | ||
| <CommandDialog | ||
| label="Command menu" | ||
| className={className} | ||
| contentClassName={`command-dialog-content ${contentClassName || ""}`} | ||
| overlayClassName="command-dialog-overlay" | ||
| {...props} | ||
| > | ||
| {children} | ||
| </CmdkCommand.Dialog> | ||
| </CommandDialog> | ||
| ); | ||
| }; | ||
|
|
||
| CommandDialog.displayName = "CommandDialog"; | ||
| CommandDialogWrapper.displayName = "CommandDialog"; | ||
|
|
||
| export const Command = { | ||
| Root: CommandRoot, | ||
| Dialog: CommandDialog, | ||
| Input: CommandInput, | ||
| List: CommandList, | ||
| Item: CommandItem, | ||
| Group: CommandGroup, | ||
| Empty: CommandEmpty, | ||
| Root: CommandRootWrapper, | ||
| Dialog: CommandDialogWrapper, | ||
| Input: CommandInputWrapper, | ||
| List: CommandListWrapper, | ||
| Item: CommandItemWrapper, | ||
| Group: CommandGroupWrapper, | ||
| Empty: CommandEmptyWrapper, | ||
| }; |
Oops, something went wrong.
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.
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.
would it make sense to put this into the pnpm catalog?